[Linux deployment] detailed installation steps of the latest version of greenplus-6.19.0 libnsl/libcrypto/libssl/libreadline No such file or directory problem solving

File network disk resources required for problem solving:

Link: https://pan.baidu.com/s/1uMrhVmHlvEQ-sEGZtqhqiw 
Extraction code: kkab

File list:

libnsl-2.17.so
libcrypto.so.1.0.2k
libssl.so.1.0.2k
libreadline.so.6.2

1. Environmental description

   firewall: after it is turned on, various settings are required, which may cause various external connections to fail, such as ftp, telnet, ssh... (some problems are not floating on the surface, and you don't know it's the pot of the firewall). For simplicity, ECS can turn off the firewall and use an easily configured security group.
   SELinux: SELinux policy is a white list principle. It can be configured only after you know the permissions used by the installed software (the trouble is not to mention the configuration, but you don't know what permissions are required). Linux already has a relatively perfect Security Best Practice. Deployment on Linux has more practical experience and feasible schemes to ensure the security of the system. Even without SELinux, everyone generally chooses to close SELinux.

# Check whether the firewall is closed or not (systemctl stop firewalld)
systemctl status firewalld
● firewalld.service - firewalld - dynamic firewall daemon
   Loaded: loaded (/usr/lib/systemd/system/firewalld.service; disabled; vendor preset: enabled)
   Active: inactive (dead)
     Docs: man:firewalld(1)

# Check the selinux status and do not close the modification (SELINUX=disabled)
cat /etc/selinux/config
# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
#     enforcing - SELinux security policy is enforced.
#     permissive - SELinux prints warnings instead of enforcing.
#     disabled - No SELinux policy is loaded.
SELINUX=disabled
# SELINUXTYPE= can take one of three two values:
#     targeted - Targeted processes are protected,
#     minimum - Modification of targeted policy. Only selected processes are protected.
#     mls - Multi Level Security protection.
SELINUXTYPE=targeted
# System version
[root@aliyun ~]# rpm -qi centos-release
Name        : centos-release
Version     : 8.1
Release     : 1.1911.0.8.el8
Architecture: x86_64

# jdk version
[root@aliyun ~]# java -version
openjdk version "11" 2018-09-25
OpenJDK Runtime Environment 18.9 (build 11+28)
OpenJDK 64-Bit Server VM 18.9 (build 11+28, mixed mode)

The Greenplum file installed this time is: open-source-greenplum-db-6.19.0-rhel7-x86_64.rpm, the following installation steps are subject to this version.

2. Environment configuration

# 1. Modify kernel parameters [configure as needed, not modified this time]
vim /etc/sysctl.conf
# modify
kernel.shmall = 4000000000
kernel.shmmax = 500000000
kernel.shmmni = 4096
vm.overcommit_memory = 2
vm.overcommit_ratio = 95
net.ipv4.ip_local_port_range = 10000 65535
kernel.sem = 500 2048000 200 40960
kernel.sysrq = 1
kernel.core_uses_pid = 1
kernel.msgmnb = 65536
kernel.msgmax = 65536
kernel.msgmni = 2048
net.ipv4.tcp_syncookies = 1
net.ipv4.conf.default.accept_source_route = 0
net.ipv4.tcp_max_syn_backlog = 4096
net.ipv4.conf.all.arp_filter = 1
net.core.netdev_max_backlog = 10000
net.core.rmem_max = 2097152
net.core.wmem_max = 2097152
vm.swappiness = 10
vm.zone_reclaim_mode = 0
vm.dirty_expire_centisecs = 500
vm.dirty_writeback_centisecs = 100
vm.dirty_background_ratio = 0
vm.dirty_ratio = 0
vm.dirty_background_bytes = 1610612736
vm.dirty_bytes = 4294967296

# 2. Set remove ipc = no to avoid database downtime caused by removing all IPC
echo "RemoveIPC=no" >> /etc/systemd/logind.conf
service systemd-logind restart

# 3. Modify the open file limit [configure as needed, not modified this time]
vim /etc/security/limits.conf
# End of file
* soft nofile 524288
* hard nofile 524288
* soft nproc 131072
* hard nproc 131072

# 4. Modify the number of ssh connections [because it is a stand-alone version, it is not modified]
cat <<EOF>> /etc/ssh/sshd_config
MaxStartups 200
MaxSessions 200
EOF

Restart the server after modification.

3. User documents and authorization

Adding groups and users is very important. Many operations must be performed under specific users. Before installing postgresql, we encountered many problems in this regard. Be careful.

# 1. Add groups and users
groupadd gpadmin
useradd -r -m -g gpadmin gpadmin
# Delete group groupdel gpadmin delete user userdel gpadmin

# 2. Document Authorization and password creation
chown -R gpadmin:gpadmin /home/gpadmin/
# Set password
[root@aliyun ~]# echo gpadmin | passwd --stdin gpadmin
Changing password for user gpadmin.
passwd: all authentication tokens updated successfully.

# 3. Create folders and authorize
mkdir /usr/local/greenplum
chown -R gpadmin:gpadmin /usr/local/greenplum/

4. Installation

The installation package is placed in the / usr / local / greenplus / Directory:

# [not used] using rpm to install the report dependency is missing
[root@acloud greenplum]# rpm -Uvh open-source-greenplum-db-6.19.0-rhel7-x86_64.rpm
error: Failed dependencies:
        apr is needed by open-source-greenplum-db-6-6.19.0-1.el7.x86_64
        apr-util is needed by open-source-greenplum-db-6-6.19.0-1.el7.x86_64
        krb5-devel is needed by open-source-greenplum-db-6-6.19.0-1.el7.x86_64
        perl is needed by open-source-greenplum-db-6-6.19.0-1.el7.x86_64

# 1. Directly use yum install to automatically install the required dependencies
[root@tcloud greenplum]# yum install -y ./open-source-greenplum-db-6.19.0-rhel7-x86_64.rpm

# It is installed under / usr/local by default
lrwxrwxrwx   1 root root  30 Jan 21 15:41 greenplum-db -> /usr/local/greenplum-db-6.19.0
drwxr-xr-x  11 root root 238 Jan 21 15:41 greenplum-db-6.19.0

# 2. Transfer the file to gpadmin
chown -R gpadmin:gpadmin /usr/local/greenplum*

# 3. Make environmental variables effective
source /usr/local/greenplum-db/greenplum_path.sh

5. Initialization preparation

# 1. Create an instance directory (the number of gpnode s in the master node and segment instance storage folder depends on the server)
mkdir -p /home/greenplum/gpdata/master
mkdir -p /home/greenplum/gpdata/gpnode1
mkdir -p /home/greenplum/gpdata/gpnode2
mkdir -p /home/greenplum/gpdata/gpnode3
mkdir -p /home/greenplum/gpdata/gpnode4

# 2. Modify the directory owner
chown -R gpadmin:gpadmin /home/greenplum/
chown -R gpadmin:gpadmin /home/greenplum/gpdata
chown -R gpadmin:gpadmin /home/greenplum/gpdata/master
chown -R gpadmin:gpadmin /home/greenplum/gpdata/gpnode*

6. Use the gpadmin user operation below

# Switch to gpadmin user
su gpadmin

# Create a key pair [ specific operations will not be posted ]
ssh-keygen -t rsa
# Issuing key [password of gpadmin user needs to be entered]
ssh-copy-id aliyun

# 1. Environment variable configuration
# The default port number of postgresql is 5432. 2345 is used here
cat <<EOF>> /home/greenplum/.bashrc
source /usr/local/greenplum-db/greenplum_path.sh
export PGPORT=2345
export PGUSER=gpadmin
export MASTER_DATA_DIRECTORY=/home/greenplum/gpdata/master/gpseg-1
export PGDATABASE=gpdb
# export LD_PRELOAD=/lib64/libz.so.1 ps 
EOF
# Configuration effective
source /home/greenplum/.bashrc

# 2. Node host configuration (configure a master node for stand-alone version)
cat <<EOF>> /home/greenplum/hostfile_exkeys
aliyun
EOF

# 3.ssh permission interworking settings
gpssh-exkeys -f /home/greenplum/hostfile_exkeys

Error 1 ️⃣ two ️⃣ three ️⃣

  • (1) Error: unable to import module: libssl.so.10: cannot open shared object file: No such file or directory
  • (2) Error: unable to import module: libcrypto.so.10: cannot open shared object file: No such file or directory
  • (3) Error: unable to import module: /lib64/libcrypto.so.10: version `libcrypto.so.10' not found (required by /usr/local/greenplum-db-6.19.0/ext/python/lib/python2.7/lib-dynload/_hashlib.so)

Problem handling:

# Handling of error reports: create a soft connection under the root user [to be created according to the file under / usr/lib64]
ln -s /usr/lib64/libssl.so.1.1.1k  libssl.so.10
ln -s /usr/lib64/libcrypto.so.1.1.1k  libcrypto.so.10
# The front soft connection still reports an error
# It is found that the version is incorrect. Use the following two files and create a soft connection
ln -s /usr/lib64/libssl.so.1.0.2k  libssl.so.10
ln -s /usr/lib64/libcrypto.so.1.0.2k  libcrypto.so.10
# 4. Set the node server (the stand-alone version is the master node)
cat <<EOF>> /home/greenplum/seg_hosts_file
aliyun
EOF

# 5. Edit gp initialization file
cp /usr/local/greenplum-db/docs/cli_help/gpconfigs/gpinitsystem_config /home/greenplum/gpinitsystem_config
# Modify profile content
vim /home/greenplum/gpinitsystem_config
declare -a DATA_DIRECTORY=(/home/greenplum/gpdata/gpnode1 /home/greenplum/gpdata/gpnode2) 
MASTER_HOSTNAME=aliyun
MASTER_DIRECTORY=/home/greenplum/gpdata/master    
MASTER_PORT=2345
DATABASE_NAME=gpdb

# 6. Initialization (- s xx means that the standby primary node is xx machine, which does not need to be configured)
bin/gpinitsystem -c /home/greenplum/gpinitsystem_config -h /home/greenplum/seg_hosts_file

Error reporting 4 ️⃣

/usr/local/greenplum-db-6.19.0/bin/postgres: error while loading shared libraries: libnsl.so.1: cannot open shared object file: No such file or directory

handle:

# Add the file libnsl-2.17 So and create a soft connection
ln -s /usr/lib64/libnsl-2.17.so libnsl.so.1

Error reporting 5 ️⃣

psql: error while loading shared libraries: libreadline.so.6: cannot open shared object file: No such file or directory
# Add the file libreadline so. 6.2 and create a soft connection
ln -s /usr/lib64/libreadline.so.6.2 libreadline.so.6

Initialize, enter Y to continue


The log is too long, not all screenshots are taken, and some errors are reported.

source /usr/local/greenplum-db/greenplum_path.sh
source /home/greenplum/.bashrc

7. Use settings

# psql login password modification
psql -p 2345
# Modify database password
alter role gpadmin with password 'gpadmin';
# Remote connection configuration
vim /home/greenplum/gpdata/master/gpseg-1/pg_hba.conf
# add to:
host     all         gpadmin         0.0.0.0/0               md5
# Reload profile
gpstop -u

Use Navicat to verify that the database connection is successful:

8. Other orders

gpstart #Normal start 
gpstop #Normal shutdown 
gpstop -M fast #Quick close 
gpstop –r #restart

summary

The configuration file in the second part has not been modified. This part should be configured according to the actual situation. This paper aims to install the latest version of GP database on a single machine. The specific use methods need more learning 😄

Keywords: Linux Database Big Data GreenPlum Distribution

Added by reub77 on Sat, 22 Jan 2022 16:31:07 +0200