KAEzip Does Not Take Effect After Being Enabled
Symptom
KAEzip does not take effect after being enabled.
Key Process and Cause Analysis
To ensure that the Greenplum service can find the path where the KAEzip library file is located during startup, you need to set environment variables properly before starting Greenplum. Generally, the Greenplum service is started through the gpstart and gpstop tools, which inherit the environment variables used for the execution of the startup script or command. Therefore, before starting the Greenplum service, ensure that Greenplum can find the path of the KAEzip library file.
When installing Greenplum, environment variables are usually configured in ~/.bashrc or ~/.bash_profile. However, the environment variables of KAEzip need to be added in ~/.bashrc. In this way, upon the Greenplum service startup, Greenplum can find the path of the KAEzip library file and run properly.
Conclusion and Solution
- Method 1 (recommended): Add the path of the KAEzip library file to the Greenplum configuration file ~/.bashrc.
- Stop the Greenplum service.
gpstop
- Modify the environment variables in the Greenplum configuration file.
- Open the file.
vim ~/.bashrc
- Press i to enter the insert mode and add the following statement to the end of the configuration file:
export LD_LIBRARY_PATH=/usr/local/kaezip/lib:$LD_LIBRARY_PATH
- Press Esc, type :wq!, and press Enter to save the file and exit.
- Make the modification take effect.
source ~/.bashrc
If the Greenplum environment variables are configured in the .bash_profile file, run the following command for the modification to take effect:source ~/.bash_profile
- Open the file.
- Restart Greenplum.
gpstart
If KAEzip is not required anymore, you can comment out the preceding added statement, make the modified environment variables take effect, and restart the database. Otherwise, other operations may fail.
- Stop the Greenplum service.
- Method 2: Replace the dynamic library file directly.
- When Greenplum is running, it searches for the KAEzip library file in the /lib64 directory by default. Therefore, back up the /lib64/libz.so.1.2.11 file and copy the /usr/local/kaezip/lib/libz.so.1.2.1 file to the /lib64/ directory.
mv /lib64/libz.so.1.2.11 /lib64/libz.so.1.2.11-bak cp -r /usr/local/kaezip/lib/libz.so.1.2.11 /lib64/ ldd /lib64/libz.so.1.2.11 ldd /lib64/libz.so.1
If the libkaezip.so file (located in /usr/local/kaezip/lib/libkaezip.so) exists in the dependencies of /lib64/libz.so.1.2.11 and /lib64/libz.so.1, the replication is successful.
- Restart the database.
If KAEzip is not required anymore, you can restore the /lib64/libz.so.1.2.11 file that is backed up in step 1 and restart the database. Otherwise, other operations may fail.
mv /lib64/libz.so.1.2.11-bak /lib64/libz.so.1.2.11
- When Greenplum is running, it searches for the KAEzip library file in the /lib64 directory by default. Therefore, back up the /lib64/libz.so.1.2.11 file and copy the /usr/local/kaezip/lib/libz.so.1.2.1 file to the /lib64/ directory.