原 GreenPlum适配国产化操作系统的情况
Tags: 原创GreenPlum国产操作系统欧拉银河麒麟统信UOS国产化
欧拉系统:可行
EulerOS 在2019年开源后更名为openEuler。
在openEuler 22.03和EulerOS 22.03上,在X86_64系统上通过rpm包和源码编译安装都可以,不过需要安装一些额外的包,
请参考:https://www.dbaup.com/greenplum-6-jiyuopeneuler22-03bianyianzhuangbuzhichi.html
麒麟系统
银河麒麟:可行
1、在“Kylin Linux Advanced Server V10”的SP1、SP2和SP3上,在X86_64系统上使用rpm包安装没有问题,需要提前安装如下包:
1 2 3 4 5 6 7 | dnf install -y libnsl hostname ln -s /usr/lib64/libreadline.so.7.0 /usr/lib64/libreadline.so.6 -- 安装包:RHEL8推荐 open-source-greenplum-db-6.25.1-rhel8-x86_64.rpm -- 或 open-source-greenplum-db-6.25.1-rhel7-x86_64.rpm |
2、在“Kylin Linux Advanced Server V10”的SP1、SP2和SP3上,在X86_64系统上使用编译安装没有问题
二进制安装
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 | docker rm -f kylingpdb docker run -itd --name kylingpdb -h kylingpdb \ -v /sys/fs/cgroup:/sys/fs/cgroup \ --privileged=true lhrbest/kylinos:v10_sp3_2.0 \ init docker exec -it kylingpdb bash dnf install -y libnsl hostname ln -s /usr/lib64/libreadline.so.7.0 /usr/lib64/libreadline.so.6 sed -i s/SELINUX=enforcing/SELINUX=disabled/g /etc/selinux/config setenforce 0 cat >> /etc/security/limits.conf <<"EOF" * soft nofile 655350 * hard nofile 655350 * soft nproc 655350 * hard nproc 655350 EOF cat >> /etc/sysctl.conf <<"EOF" kernel.shmmax = 4398046511104 kernel.shmmni = 4096 kernel.shmall = 4000000000 kernel.sem = 32000 1024000000 500 32000 vm.overcommit_memory=1 vm.overcommit_ratio=95 EOF sysctl -p groupadd -g 530 gpadmin useradd -g 530 -u 530 -m -d /home/gpadmin -s /bin/bash gpadmin chown -R gpadmin:gpadmin /home/gpadmin echo "gpadmin:lhr" | chpasswd -- rpm -ivh /soft/open-source-greenplum-db-6.23.1-rhel7-x86_64.rpm chown -R gpadmin:gpadmin /usr/local/greenplum-db echo ". /usr/local/greenplum-db/greenplum_path.sh" >> /home/gpadmin/.bashrc echo "export MASTER_DATA_DIRECTORY=/opt/greenplum/data/master/gpseg-1" >> /home/gpadmin/.bashrc echo "export PGDATABASE=postgres" >> /home/gpadmin/.bashrc echo "export PGPORT=5432" >> /home/gpadmin/.bashrc ./sshUserSetup.sh -user root -hosts "mdw mdw" -advanced exverify –confirm ./sshUserSetup.sh -user gpadmin -hosts "mdw mdw" -advanced exverify –confirm chmod 600 /home/gpadmin/.ssh/config mkdir -p /opt/greenplum/data/master mkdir -p /opt/greenplum/data/primary mkdir -p /opt/greenplum/data/mirror mkdir -p /opt/greenplum/data/master_standby mkdir -p /opt/greenplum/data/ chown -R gpadmin:gpadmin /opt/greenplum su - gpadmin mkdir -p /home/gpadmin/conf/ cat > /home/gpadmin/conf/all_hosts <<"EOF" kylingpdb EOF cat > /home/gpadmin/conf/seg_hosts <<"EOF" kylingpdb EOF ssh-keygen -t rsa ssh-keygen -t dsa cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys cat ~/.ssh/id_dsa.pub >> ~/.ssh/authorized_keys ssh kylingpdb date su - gpadmin cat > /home/gpadmin/conf/initgp_config <<"EOF" declare -a DATA_DIRECTORY=(/opt/greenplum/data/primary /opt/greenplum/data/primary) declare -a MIRROR_DATA_DIRECTORY=(/opt/greenplum/data/mirror /opt/greenplum/data/mirror) ARRAY_NAME="lhrgp" SEG_PREFIX=gpseg PORT_BASE=6000 MIRROR_PORT_BASE=7000 MASTER_PORT=5432 MASTER_HOSTNAME=kylingpdb MASTER_DIRECTORY=/opt/greenplum/data/master DATABASE_NAME=lhrgpdb MACHINE_LIST_FILE=/home/gpadmin/conf/seg_hosts EOF gpinitsystem -c /home/gpadmin/conf/initgp_config -e=lhr -s kylingpdb -P 5433 -S /opt/greenplum/data/master_standby/gpseg-1 |
麒麟系统编译安装GP
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 | docker rm -f kylingpdb docker run -itd --name kylingpdb -h kylingpdb \ -v /sys/fs/cgroup:/sys/fs/cgroup \ --privileged=true lhrbest/kylinos:v10_sp3_3.0 \ init docker exec -it kylingpdb bash wget https://ghproxy.com/https://github.com/greenplum-db/gpdb/releases/download/6.25.1/6.25.1-src-full.tar.gz dnf install -y libnsl apr-devel xerces-c xerces-c-devel hostname ln -s /usr/lib64/libreadline.so.7.0 /usr/lib64/libreadline.so.6 dnf groupinstall -y 'Development Tools' # GCC, libtools etc dnf install -y curl-devel bzip2-devel python-devel openssl-devel readline-devel libzstd-devel dnf install -y perl-ExtUtils-Embed # If enable perl dnf install -y libxml2-devel # If enable XML support dnf install -y openldap-devel # If enable LDAP dnf install -y pam pam-devel # If enable PAM dnf install -y perl-devel # If need installcheck-world dnf install -y sudo python2 mkdir -p ~/.pip cat > ~/.pip/pip.conf << EOF [global] timeout = 6000 index-url = http://mirrors.aliyun.com/pypi/simple/ index-index-url = http://pypi.douban.com/simple/ [install] trusted-host = mirrors.aliyun.com pypi.douban.com EOF -- 需要python2.7.18,且PATH中的python和python2的可执行程序存在 wget https://bootstrap.pypa.io/pip/2.7/get-pip.py python2 /soft/get-pip.py pip2 install psutil lockfile paramiko setuptools epydoc tar -zxvf 6.25.1-src-full.tar.gz cd gpdb_src/ ./configure --prefix=/usr/local/gpdb --with-perl --with-python --disable-gpcloud --disable-orca make -j16 ##若成功会提示:All of Greenplum Database successfully made. Ready to install. make install ##Greenplum Database installation complete. -- 测试:使用gpadmin用户 groupadd -g 530 gpadmin useradd -g 530 -u 530 -m -d /home/gpadmin -s /bin/bash gpadmin chown -R gpadmin:gpadmin /home/gpadmin echo "gpadmin:lhr" | chpasswd chown gpadmin.gpadmin -R /soft/gpdb_src/gpAux/gpdemo/ su - gpadmin ssh-keygen -t rsa ssh-keygen -t dsa cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys cat ~/.ssh/id_dsa.pub >> ~/.ssh/authorized_keys ssh kylingpdb date cd /soft/gpdb_src/gpAux/gpdemo source /usr/local/gpdb/greenplum_path.sh export PGHOST=`hostname` make source gpdemo-env.sh sed -i s/SELINUX=enforcing/SELINUX=disabled/g /etc/selinux/config setenforce 0 cat >> /etc/security/limits.conf <<"EOF" * soft nofile 655350 * hard nofile 655350 * soft nproc 655350 * hard nproc 655350 EOF ulimit -HSn 65535 cat >> /etc/sysctl.conf <<"EOF" kernel.shmmax = 4398046511104 kernel.shmmni = 4096 kernel.shmall = 4000000000 kernel.sem = 32000 1024000000 500 32000 vm.overcommit_memory=1 vm.overcommit_ratio=95 EOF sysctl -p groupadd -g 530 gpadmin useradd -g 530 -u 530 -m -d /home/gpadmin -s /bin/bash gpadmin chown -R gpadmin:gpadmin /home/gpadmin echo "gpadmin:lhr" | chpasswd -- rpm -ivh /soft/open-source-greenplum-db-6.23.1-rhel7-x86_64.rpm chown -R gpadmin:gpadmin /usr/local/gpdb echo ". /usr/local/gpdb/greenplum_path.sh" >> /home/gpadmin/.bashrc echo "export MASTER_DATA_DIRECTORY=/opt/greenplum/data/master/gpseg-1" >> /home/gpadmin/.bashrc echo "export PGDATABASE=postgres" >> /home/gpadmin/.bashrc echo "export PGPORT=5432" >> /home/gpadmin/.bashrc ssh-keygen -t rsa ssh-keygen -t dsa cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys cat ~/.ssh/id_dsa.pub >> ~/.ssh/authorized_keys ssh kylingpdb date ./sshUserSetup.sh -user root -hosts "mdw mdw" -advanced exverify –confirm ./sshUserSetup.sh -user gpadmin -hosts "mdw mdw" -advanced exverify –confirm chmod 600 /home/gpadmin/.ssh/config mkdir -p /opt/greenplum/data/master mkdir -p /opt/greenplum/data/primary mkdir -p /opt/greenplum/data/mirror mkdir -p /opt/greenplum/data/master_standby mkdir -p /opt/greenplum/data/ chown -R gpadmin:gpadmin /opt/greenplum su - gpadmin mkdir -p /home/gpadmin/conf/ cat > /home/gpadmin/conf/all_hosts <<"EOF" kylingpdb EOF cat > /home/gpadmin/conf/seg_hosts <<"EOF" kylingpdb EOF su - gpadmin cat > /home/gpadmin/conf/initgp_config <<"EOF" declare -a DATA_DIRECTORY=(/opt/greenplum/data/primary /opt/greenplum/data/primary) declare -a MIRROR_DATA_DIRECTORY=(/opt/greenplum/data/mirror /opt/greenplum/data/mirror) ARRAY_NAME="lhrgp" SEG_PREFIX=gpseg PORT_BASE=6000 MIRROR_PORT_BASE=7000 MASTER_PORT=5432 MASTER_HOSTNAME=kylingpdb MASTER_DIRECTORY=/opt/greenplum/data/master DATABASE_NAME=lhrgpdb MACHINE_LIST_FILE=/home/gpadmin/conf/seg_hosts EOF gpinitsystem -c /home/gpadmin/conf/initgp_config -e=lhr -s kylingpdb -P 5433 -S /opt/greenplum/data/master_standby/gpseg-1 |
open麒麟,openKylin 1.0,基于Debian 12
在openKylin 1.0上,通过deb包和编译安装都不可行,但是直接将银河麒麟上安装好的包文件拷贝到openKylin 1.0却可以正常运行
二进制安装
1 2 3 4 5 6 7 | -- deb安装文件不可行 greenplum-db-6.25.1-ubuntu18.04-amd64.deb apt install -y krb5-multidev libevent-dev zip libreadline-dev libexpat1-dev libcurl4-openssl-dev libbz2-dev libyaml-dev locale-gen en_US.UTF-8 python2 ln -s /lib/x86_64-linux-gnu/libreadline.so.8 /lib/x86_64-linux-gnu/libreadline.so.7 |
安装过程没有问题,但是启动的时候报错了,没找解决办法:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | gpadmin@openkylin:~$ gpstart -a Traceback (most recent call last): File "/usr/local/greenplum-db-6.25.1/bin/gpstart", line 12, in <module> from gppylib.mainUtils import * File "/usr/local/greenplum-db-6.25.1/lib/python/gppylib/mainUtils.py", line 28, in <module> from gppylib.commands import gp, unix File "/usr/local/greenplum-db-6.25.1/lib/python/gppylib/commands/gp.py", line 11, in <module> import pipes File "/usr/local/greenplum-db-6.25.1/ext/python/lib/python2.7/pipes.py", line 62, in <module> import tempfile File "/usr/local/greenplum-db-6.25.1/ext/python/lib/python2.7/tempfile.py", line 35, in <module> from random import Random as _Random File "/usr/local/greenplum-db-6.25.1/ext/python/lib/python2.7/random.py", line 49, in <module> import hashlib as _hashlib File "/usr/local/greenplum-db-6.25.1/ext/python/lib/python2.7/hashlib.py", line 127, in <module> new = __py_new NameError: name '__py_new' is not defined |
安装过程: