原 GreenPlum 6.26.1和gpcc 6.10单机版安装
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 162 163 164 165 166 167 168 169 170 171 172 | docker rm -f gpdb6261 docker run -itd --name gpdb6261 -h gpdb6261 \ -p 5631:5432 -p 26088:28080 \ -v /sys/fs/cgroup:/sys/fs/cgroup \ --privileged=true lhrbest/lhrcentos76:9.2 \ /usr/sbin/init docker exec -it gpdb6261 bash sed -i s/SELINUX=enforcing/SELINUX=disabled/g /etc/selinux/config setenforce 0 systemctl status firewalld.service systemctl disable firewalld.service systemctl start firewalld firewall-cmd --add-port=0-65535/tcp --permanent firewall-cmd --add-port=0-65535/udp --permanent firewall-cmd --reload firewall-cmd --list-ports systemctl stop firewalld.service cat >> /etc/security/limits.conf <<"EOF" * soft nofile 655350 * hard nofile 655350 * soft nproc 655350 * hard nproc 655350 EOF cat >> /etc/sysctl.conf <<"EOF" fs.file-max=9000000 fs.inotify.max_user_instances = 1000000 fs.inotify.max_user_watches = 1000000 kernel.pid_max=4194304 kernel.shmmax = 4398046511104 kernel.shmmni = 4096 kernel.shmall = 4000000000 kernel.sem = 32000 1024000000 500 32000 vm.overcommit_memory=1 vm.overcommit_ratio=95 net.ipv4.ip_forward=1 vm.swappiness=20 vm.dirty_background_bytes = 0 vm.dirty_background_ratio = 5 vm.dirty_bytes = 0 vm.dirty_expire_centisecs = 600 vm.dirty_ratio = 10 vm.dirty_writeback_centisecs = 100 vm.vfs_cache_pressure = 500 vm.min_free_kbytes = 2097152 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 su - gpadmin mkdir -p /home/gpadmin/conf/ cat > /home/gpadmin/conf/all_hosts <<"EOF" gpdb6261 EOF cat > /home/gpadmin/conf/seg_hosts <<"EOF" gpdb6261 EOF rpm -ivh /soft/greenplum-db-6.26.1-rhel7-x86_64.rpm chown -R gpadmin:gpadmin /usr/local/greenplum-db chown -R gpadmin:gpadmin /usr/local/greenplum-db-6.26.1 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 ssh-keygen -t rsa ssh-keygen -t dsa cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys cat ~/.ssh/id_dsa.pub >> ~/.ssh/authorized_keys -- or ./sshUserSetup.sh -user root -hosts "gpdb6261 gpdb6261" -advanced -noPromptPassphrase ./sshUserSetup.sh -user gpadmin -hosts "gpdb6261 gpdb6261" -advanced -noPromptPassphrase 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 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=gpdb6261 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 gpdb6261 -P 5433 -S /opt/greenplum/data/master_standby/gpseg-1 echo "host all all all md5" >> /opt/greenplum/data/master/gpseg-1/pg_hba.conf gpstop -u \password gpadmin psql -U gpadmin -h172.18.0.14 -p 5431 -d lhrgpdb chown -R gpadmin.gpadmin /usr/local/greenplum-db-6.26.1 chown -R gpadmin.gpadmin /usr/local/greenplum-db rm -rf /usr/local/greenplum-cc mkdir -p /usr/local/greenplum-cc-6.10.0 ln -sf /usr/local/greenplum-cc-6.10.0 /usr/local/greenplum-cc chown -R gpadmin:gpadmin /usr/local/greenplum-cc-6.10.0 chown -R gpadmin:gpadmin /usr/local/greenplum-cc su - gpadmin source /usr/local/greenplum-db/greenplum_path.sh unzip greenplum-cc-web-6.10.0-gp6-rhel7-x86_64.zip cd greenplum-cc-web-6.10.0-gp6-rhel7-x86_64/ ./gpccinstall-6.10.0 -W echo 'source /usr/local/greenplum-cc/gpcc_path.sh' >> ~/.bashrc source /usr/local/greenplum-cc/gpcc_path.sh cd $GPCC_HOME cd /usr/local/greenplum-cc-6.10.0/gppkg gppkg -i MetricsCollector-6.10.0_gp_6.26.0-rhel7-x86_64.gppkg gpstop -M fast -ar gpcc start ; gpcc status echo '*:5432:gpperfmon:gpmon:dbaup' > ~/.pgpass chmod 600 /home/gpadmin/.pgpass psql -d gpperfmon alter user gpmon with password 'dbaup'; http://172.16.7.162:26088 gpmon/dbaup |