当前位置:网站首页>03 gp cluster construction
03 gp cluster construction
2022-08-01 16:33:00 【blue wind 9】
前言
呵呵 Recently a series of environmental building related requirements
记录一下
gp 三个节点 : 192.168.110.72, 192.168.110.73, 192.168.110.75
72 为 master, 73 为 slave01, 75 为 slave02
Three machines have done trusted shell
gp 单节点 docker 搭建
参照 Docker Hub
gp 搭建步骤
三节点集群
72, 73, 75 三台机器
72 作为 admin, 73, 75 作为 segment
71 别名为 gp1, 72 别名为 gp2, 75 别名为 75
1. 修改 hosts, 以及 hostname, 然后重启
192.168.110.72 gp1
192.168.110.73 gp2
192.168.110.75 gp3
2. 将 gp_yum.tar.gz, greenplum-db-6.0.0-rhel7-x86_64.rpm
按照 installWithDeps.txt In order to install
Connect the soft greenplum-db 修改为 gpdb
greenplum_path.sh 增加可执行权限
上传 hostfile, seg_hosts 到 gpdb 里面
上传 initgp_config 到 docs/cli_help/gpconfigs/ 目录下, Please note that according to the actual host adjust initgp_config 的 hostname
3. 新建 master 目录, 和 segment 目录
mkdir -p /data/gpdb/master
mkdir -p /data/gpdb/mdata1
mkdir -p /data/gpdb/pdata1
mkdir -p /data/gpdb/mdata2
mkdir -p /data/gpdb/pdata2
4. 新建用户 And adjust the user permissions
groupadd gpadmin
useradd -g gpadmin gpadmin
passwd gpadmin gpadmin
chown -R gpadmin:gpadmin /usr/local/gpdb/
chown -R gpadmin:gpadmin /data/gpdb
5. 配置内核参数
配置内核参数,添加如下内容:
vi /etc/sysctl.conf
net.ipv4.ip_forward = 0
net.ipv4.conf.default.accept_source_route = 0
kernel.sysrq = 1
kernel.core_uses_pid = 1
net.ipv4.tcp_syncookies = 1
kernel.msgmnb = 65536
kernel.msgmax = 65536
kernel.sem = 250 64000 100 512
kernel.shmmax = 500000000
kernel.shmmni = 4096
kernel.shmall = 4000000000
kernel.sem = 250 64000 100 512
net.ipv4.tcp_tw_recycle=1
net.ipv4.tcp_max_syn_backlog=4096
net.core.netdev_max_backlog=10000
vm.overcommit_memory=2
net.ipv4.conf.all.arp_filter = 1
6. 配置 gpadmin 环境变量, vim /home/gpadmin/.bashrc
source /usr/local/gpdb/greenplum_path.sh
export MASTER_DATA_DIRECTORY=/data/gpdb/master/gpseg-1
export LD_LIBRARY_PATH=/usr/local/gpdb/lib
7. 配置 gp1 到 gp2, gp3 的免密码登录
ssh-keygen
ssh-copy-id -i ~/.ssh/id_rsa.pub [email protected]
ssh-copy-id -i ~/.ssh/id_rsa.pub [email protected]
ssh-copy-id -i ~/.ssh/id_rsa.pub [email protected]
8. 防火墙开放相关端口
firewall-cmd --add-port=5432/tcp --permanent
firewall-cmd --add-port=6000-6010/tcp --permanent
firewall-cmd --add-port=30000-65535/udp --permanent
firewall-cmd --reload
firewall-cmd --list-all
9. 在 gp1 The host to perform above 初始化
gpinitsystem -c /usr/local/gpdb/docs/cli_help/gpconfigs/initgp_config -h /usr/local/gpdb/seg_hosts
# Need to perform can delete related, Number and the corresponding process, 锁文件
rm -rf /data/gpdb/master/*
rm -rf /data/gpdb/mdata1/*
rm -rf /data/gpdb/mdata2/*
rm -rf /data/gpdb/pdata1/*
rm -rf /data/gpdb/pdata2/*
10. 创建用户以及授权
CREATE USER pico WITH PASSWORD 'pico-nf-8100';
GRANT ALL PRIVILEGES ON DATABASE meiya TO pico;
如果默认的ssh端口不为 22
This is our deployment of a problem in the process of, 尝试过修改 gpinitsystem, gpstart 脚本来解决问题
但是 太过于复杂,
The final way is 修改 initgp_config 中的 TRUSTED_SHELL 的配置, 原来为 "ssh", 更新为 "ssh -p 3333"
And at least the following documents, The following parts of the update
[[email protected] gpdb]# grep -R 55566 *
bin/gpssh-exkeys: args = ['ssh', '-p 55566', self.m_host, '-o', 'BatchMode=yes', '-o', 'StrictHostKeyChecking=yes', '-n',
bin/gpssh-exkeys: args = ['ssh -p 55566', self.m_host, '-o', 'BatchMode=yes', '-o', 'StrictHostKeyChecking=yes',
bin/gpssh-exkeys: cmd = 'ssh -p 55566 -o "BatchMode=yes" -o "StrictHostKeyChecking=no" %s true 2>%s' % (hostname, errfile)
bin/gpssh-exkeys: cmd = ['ssh -p 55566', remoteHost.host(), '-o', 'BatchMode=yes', '-o', 'StrictHostKeyChecking=yes', 'true']
bin/gpssh-exkeys: cmd = ('scp -P 55566 -q -o "BatchMode yes" -o "NumberOfPasswordPrompts 0" ' +
bin/gpssh-exkeys: cmd = ('scp -P 55566 -q -o "BatchMode yes" -o "NumberOfPasswordPrompts 0" ' +
bin/lib/gp_bash_functions.sh:if [ x"$TRUSTED_SHELL" = x"" ]; then TRUSTED_SHELL="$SSH -p 55566"; fi
bin/lib/gp_bash_functions.sh:if [ x"$TRUSTED_COPY" = x"" ]; then TRUSTED_COPY="$SCP -P 55566"; fi
docs/cli_help/gpconfigs/initgp_config:TRUSTED_SHELL="ssh -p 55566"
Binary file lib/python/gppylib/commands/base.pyc matches
lib/python/gppylib/commands/base.py: cmd.cmdStr = "ssh -p 55566 -o StrictHostKeyChecking=no -o ServerAliveInterval=60 " \
The host name has been adjusted, 但是 gpinitsystem, gpstart In the process of or use localhost.domain
这个需要进入到 gpMaster 的 template1 数据库 查询节点信息, 然后调整 节点 数据
进入postgre PGOPTIONS="-c gp_session_role=utility" psql -d postgres
数据库查看 \l
数据分布 select * from gp_segment_configuration order by dbid;
报错 ERROR: permission denied: "gp_segment_configuration" is a system catalog
set allow_system_table_mods='TRUE';
Attached the above mentioned gp6.0 相关
greenplum6.0安装相关-C++文档类资源-CSDN下载
完
边栏推荐
猜你喜欢
随机推荐
搭建云计算平台(云计算管理平台搭建)
面试必问的HashCode技术内幕
1个月写900多条用例,2线城市年薪33W+的测试经理能有多卷?
Break the limit of file locks and use storage power to help enterprises grow new momentum
Flink - SQL can separate a certain parallelism of operator node configuration?
聊下自己转型测试开发的历程
MUI as a mobile phone to return to the action bar
全新升级!《云原生架构白皮书 2022 版》重磅发布
Go unit tests
5年测试,只会功能要求17K,功能测试都敢要求这么高薪资了?
Convert tensor to image in pytorch
Go 单元测试
A full review of mainstream timed task solutions
短剧正在抢长剧的生意
kubelet node pressure eviction
酷逼了 Pathetic Dog 第 304 场周赛
MySQL可以做多台vps的双向同步吗?
MySQL【创建和管理表】
七夕专属博文-使用QGraphics画“红心“或“黑心“(含数学模型讲解)
七夕到了——属于程序员的浪漫









