AntDB Installation and Deployment Documentation - P6
Tags: database
Published: 2023-07-19 04:34:53

## FAQ

This chapter mainly answers the frequently occurring errors during the installation and deployment of the software. When you encounter problems, you can search for them first.

### Installation Errors

#### package antdb-4.0-1.el7.centos.x86\_64 is already installed

Cause explanation: The RPM package is already installed on the server. Solution: Please install it as an upgrade or uninstall it first before installing it. Here are some RPM installation and uninstallation methods. Query the installed antdb RPM package:

```
[root@cos01 ~]# rpm -qa antdb
antdb-4.0-1.el7.centos.x86_64
```

Query RPM package details: installation time, installation path, etc.:

```
[root@cos01 ~]# rpm -qi antdb-4.0-1.el7.centos.x86_64
Name        : antdb
Version     : 4.0
Release     : 1.el7.centos
Architecture: x86_64
Install Date: Sat 18 Feb 2017 02:34:47 PM CST
Group       : Applications/Internet
Size        : 45039454
License     : GPL
Signature   : (none)
Source RPM  : antdb-4.0-1.el7.centos.src.rpm
Build Date  : Sat 18 Feb 2017 01:33:04 PM CST
Build Host  : cos01
Relocations : /usr 
URL         : none
Summary     : ADB
Description :
adb2.2 build at 20170217.
```

List what files RPM contains, detailed list information:

```
[root@cos01 ~]# rpm -ql antdb-4.0-1.el7.centos.x86_64
/opt/antdb
/opt/antdb/bin
/opt/antdb/lib
/opt/antdb/share
/opt/antdb/include
```

Which package a program is installed by or which package contains this program:

```
    rpm -qf `which program name`    #Returns the full name of the package
    rpm -qif `which program name`   #Returns information about the package
    rpm -qlf `which program name`   #Returns a list of package files
```

Installing RPM:

```
[root@cos01 ~]# rpm -ivh adb-4.0-1.el7.centos.x86_64
```

Installing RPM as an upgrade:

```
[root@cos01 ~]# rpm -Uvh adb-4.0-1.el7.centos.x86_64
```

Uninstall RPM:

```
[root@cos01 ~]# rpm -e antdb
```

#### error: library 'crypto' is required for OpenSSL

Cause explanation: When installing AntDB, some system dependency packages are required. If similar error occurs, it means that AntDB dependency package is not installed. Solution: Just install as root user as described above.

```
yum install openssl openssl-devel
```

The complete dependency package is as follows:

```
yum install perl-ExtUtils-Embed flex bison readline-devel zlib-devel openssl-devel pam-devel libxml2-devel libxslt-devel openldap-devel python-devel libssh2-devel
```

#### rpm: relocations must begin with a /

Cause explanation: When installing the program using the rpm package provided by antdb, if you do not specify the installation path, it will be installed in the /opt/app/adb (or /opt/app/antdb) directory by default. However, customers generally require installation to the specified directory, so you can use the relocate option provided by the rpm command to adjust the default installation path to the specified directory (take the /data/sy/adb40sy/adb specified directory as an example).

```
sudo rpm -ivh adb-4.0.9ff827a8-10.el7.centos.x86_64.rpm --relocate=/opt/app/adb=$ADB_HOME
```

There should be no spaces between relocate and the configuration that follows. If spaces are present, the error message shown in the title is thrown Solution. Do not add spaces between relocate and value.

### Parameter problem

#### LOG: invalid value for parameter "max\_stack\_depth": 16384

Cause Explanation: The maximum security depth occupied by a database process at runtime STACK. If it is found that a complex recursive operation or a complex function cannot be run properly, it is recommended to increase the value of this configuration appropriately. Solution: Log in to the server and modify /etc/security/limits.conf to increase the user's stack depth size (using the antdb user as an example).

```
antdb soft stack unlimited
antdb hard stack unlimited
```

#### ERROR: unrecognized configuration parameter "shared\_buffers"

Cause explanation: In some scenarios, since the param information of adbmgr is not initialized, manually execute the above command to initialize it and then set the parameters. Solution: Log in to adbmgr and execute the following command.

```
flush param;
```

#### FATAL: could not create shared memory segment: Cannot allocate memory

Cause explanation: The shared\_buffer setting is not reasonable and exceeds the system configuration of kernel.shmmax. Solution: It is recommended to reduce the shared\_buffer value, or increase the kernel parameters, such as shmall, shmmax values. If the shared\_buffer is set too large, it will be reported as Invalid argument.

```
FATAL: invalid value for parameter "shared_buffers": "222222GB" HINT: Value exceeds integer range.
```

#### FATAL: could not create semaphores: No space left on device

Cause Explanation: The max\_connections setting is not reasonable and exceeds the system configuration of kernel.sem. max\_connections is the maximum number of connections, that is, the maximum number of connections allowed for clients to connect, increasing connections can allow more clients to access, but setting too large will also cause DB startup failure semget is a function to get signals, that is, get semaphore. The above-mentioned space does not mean that the disk space is not enough, but the space parameter is not enough when creating semaphores, and the system call parameter semget reports an error. Solution: Decrease max\_connections, or increase kernel parameters, such as semmni, semmns, etc.

### Login Error

#### error while loading shared libraries: libpq.so.5: cannot open shared object file: No such file or directory

Cause explanation: Some special software or plugins only recognize .bashrc but not .bash\_profile, so after adding it, log out of the terminal and log in again.

Solution: In the .bashrc environment variable, is the following environment variable LD\_LIBRARY\_PATH set.

```
export LD_LIBRARY_PATH=$ADB_HOME/lib:$LD_LIBRARY_PATH
```

#### Authentication failed (username/password)

Cause Explanation: AntDB mgr manages each node remotely through ssh, so you need to configure ssh mutual trust or add password option. Solution: Is mutual trust configured between each host. Or add password 'xxxx' option after the command. An example is given below to illustrate.

```
postgres=# start agent all;
 hostname | status |                description                
----------+--------+-------------------------------------------
 antdb01  | f      | Authentication failed (username/password)
 antdb02  | f      | Authentication failed (username/password)
(2 rows)

postgres=# 
postgres=# start agent all password'123';
 hostname | status | description 
----------+--------+-------------
 antdb01  | t      | success
 antdb02  | t      | success
(2 rows)
```

#### unable to exchange encryption keys

This error may occur when starting the agent in the cluster version because: the version of libssh2 is too low, which can be solved by upgrading the version of libssh2. You can install libssh2 by compiling the source code. Step 1 Download at https://www.libssh2.org/ Step 2 Compile and install the source code (root execution)

```
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
```

A C code to check the libssh2 version is provided here, saved as check\_libssh2.c.

```
#include <stdio.h>
#include <libssh2.h>

int main ()
{
    printf("libssh2 version: %s\n", LIBSSH2_VERSION );
}
```

Compile:

```
gcc check_libssh2.c -o check_libssh2
```

Execute:

```
./check_libssh2 
```

The expected output is as foloows: 

```
libssh2 version: 1.9.0
```

## Appendix A Explanation of Terms

This section describes the terminology used in this document.

| Terminology| Explanation
|----------|----------
| gtmcoord| Global transaction management, which is responsible for generating and maintaining globally unique information such as global transaction IDs, transaction snapshots, and timestamps.
| coordinator| Responsible for providing external application interfaces and data storage, optimizing global execution plans, distributing execution plans, and aggregating and processing execution results.
| datanode| Data nodes, the nodes in the cluster that hold specific data, are divided into primary and secondary.
| agent| adbmgr manages the AntDB cluster through the agent process. One agent process is started on each host.
| adbmgr| Cluster management tools, providing users/operators with easy and fast configuration and management of AntDB clusters.