Software Installation
This section describes how to install AntDB, divided into stand-alone and clustered versions.
Centralized master node installation
Installation with RPM package (not recommended)
Dependency package installationdependence
For offline environment, it is recommended to build a local yum source on the host computer through the image file of the operating system to facilitate the installation of dependencies. Under cento or redhat operating system, execute the following command to install the dependencies.
sudo yum install -y perl-ExtUtils-Embed
sudo yum install -y flex
sudo yum install -y bison
sudo yum install -y readline-devel
sudo yum install -y zlib-devel
sudo yum install -y openssl-devel
sudo yum install -y pam-devel
sudo yum install -y libxml2-devel
sudo yum install -y libxslt-devel
sudo yum install -y openldap-devel
sudo yum install -y python-devel
sudo yum install -y gcc-c++
For other operating systems, please just change the installation command, and the dependency package names will remain the same. Some dependencies do not provide libssh2 package, you can install it by compiling the source code.
• Download at: https://www.libssh2.org/download/
• Source code compilation and installation (executed by root).
wget https://www.libssh2.org/download/libssh2-1.9.0.tar.gz
tar xzvf libssh2-1.9.0.tar.gz
cd libssh2-1.9.0
./configure
make
make install
Installing RPM packages
Upload the RPM package provided by the deliverer to the server and install it under root or a user with sudo privileges. Install to the default path /opt/app/antdb.
sudo rpm -ivh antdb-xxx.rpm
If you want to install to other paths, you can do so as follows:
sudo rpm -ivh antdb-xxx.rpm --relocate=/opt/app/antdb=$ADBHOME
$ADBHOME as a custom directory, the name is best to be known by its name, e.g.:
/home/antdb/app/antdb
After the RPM package is installed, the value of the variable ADB_HOME will either be /opt/app/antdb, or a directory of your choice. Next, you need to modify the directory permissions.
sudo chown -R antdb:antdb $ADBHOME
sudo chmod -R 755 $ADBHOME
Configure Environment Variables
After installing the RPM package, executable files such as initdb and pg_ctl will be created in the bin directory of the specified directory (i.e. $ADBHOME directory). To initialize the database you also need to configure the PATH variable in order to do so. Append the following to the hidden file .bashrc under the current user (execute vim ~/.bashrc to open the file).
export ADBHOME=/opt/app/antdb
export PATH=$ADBHOME/bin:$PATH
export LD_LIBRARY_PATH=$ADBHOME/lib:$LD_LIBRARY_PATH
export PGDATABASE=postgres
Note: ADBHOME needs to be set according to the installation path of the RPM package. Then just execute the following command to make it effective.
source ~/.bashrc
Install with tar package
Copy the installation package (ADB-Community.tar.gz) to the directory of AntDB user (e.g. uatadb), and modify the permissions of the package.
chown -R uatadb:uatadb ADB-Community.tar.gz #Change the user permissions of the installer to uatadb
Log in to the new user to install AntDB.
su - uatadb #Login to the newly created AntDB user
tar -xzvf ADB-Community.tar.gz #Unzip the installation package
cd ADB-Community #Enter the unzipped directory ADB-Community with the cd command.
Use the tarball installation, and execute the AntDB_install.sh script to achieve interactive installation and silent installation.
Interactive installation
Execute sh AntDB_install.sh under ADB-Community for interactive installation of AntDB.
sh AntDB_install.sh
The interactive installation can be customized in three places, as shown below. You can choose the default value or customize it. In the second place, choose the default value or "c", which means the installation is centralized database.
# Step one:
# Select whether to agree to the user agreement, only if you agree(Y) can you continue to install, if not (N), it will exit the installation.
Do you agree?(Y/N)[Default:Y]
You input:
OK, you agree to the agreement. continue...
check_agreement...success.
# Step two:
# Select the mode in which you want to install, centralized (c), distributed (d). The default selection is c, for a centralized installation. Enter Q to abort this installation.
# Here, we choose c for a centralized database installation
Please enter the deployment mode "(c)entralized" or "(d)istributed" or "Q" to exit the installation.[Default:centralized]c
You input : c
# Step three:
# Fill in the installation path. Note: You need to fill in the absolute path.
# If the user does not fill in the absolute path, just enter, it will be installed to the default path. Enter Q to abort this installation.
Please enter a valid empty directory to install antdb. Or enter "Q/q" to exit the installation.[Default:/data/adb01/app/antdb]
You input :
Use default install path:[/data/adb01/app/antdb]. continue...
check install path...
check install path ...success.
decompress_package...
decompress_package...success.
copy files...
copy files...success.
set bash environment...
please excute cmd 'source /data/adb01/.bashrc' to make the environment variables take effect.
set bash environment...success.
set kernel config...
Please refer to the following files in the installation directory to manually set the recommended kernel config.
/data/adb01/app/antdb/setup/common/kernel_limits.conf
/data/adb01/app/antdb/setup/common/kernel_sysctl.conf
antdb install ...success.
After the above execution, according to the prompt, you need to source the environment variables, and after the source is done, the installation of the binaries is finished.
source /data/adb01/.bashrc
Silent form installation
Execute sh AntDB_install.sh -s under ADB-Community for non-interactive installation of AntDB.
sh AntDB_install.sh -s
By default, the silent installation selects the centralized version and installs in the default path. After execution, you need to source the environment variable, and after source, the binary is installed.
source /data/adb01/.bashrc