设为首页 收藏本站
查看: 730|回复: 0

[经验分享] 实战:Install greenplum cluster on ubuntu 16.04

[复制链接]

尚未签到

发表于 2018-4-29 09:50:37 | 显示全部楼层 |阅读模式
  规划:1个msater, 2个segments
  环境:ubuntu 16.04
  Greenplum Version: 'postgres (Greenplum Database) 5.3.0 build 2155c5a-oss
  1、安装

  sudo add-apt-repository ppa:greenplum/db
  sudo apt-get update
  sudo apt-get install greenplum-db-oss
  2. 配置/etc/hosts
  Edit the /etc/hosts file and make sure that it includes the host names and all interface address names for every machine participating in your Greenplum Database system.
  3、关闭防火墙
  service iptables stop
  4、修改/etc/sysctl.conf,添加
  kernel.shmmax = 500000000
  kernel.shmmni = 4096
  kernel.shmall = 4000000000
  kernel.sem = 250 512000 100 2048
  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_tw_recycle = 1
  net.ipv4.tcp_max_syn_backlog = 4096
  net.ipv4.conf.all.arp_filter = 1
  
  net.ipv4.ip_forward=0
  net.ipv4.ip_local_port_range = 1025 65535
  net.core.netdev_max_backlog = 10000
  net.core.rmem_max = 2097152
  net.core.wmem_max = 2097152
  vm.overcommit_memory = 2
  5、配置 /etc/security/limits.conf,添加
  * soft nofile 65536* hard nofile 65536* soft nproc 131072* hard nproc 131072
  6. 设置预读块大小
  /sbin/blockdev --setra 16384 /dev/sda
  7、重启系统
  8、安装greenplum
  http://greenplum.org/install-greenplum-oss-on-ubuntu/
  https://launchpad.net/~greenplum/+archive/ubuntu/db
  Installation into /opt/gpdb
  ---------------------------
  sudo apt-get install -y software-properties-common
  sudo add-apt-repository ppa:greenplum/db
  sudo apt-get update
  sudo apt-get install -y greenplum-db-oss
  9、初始化环境变量
  $ su root
  $ source /opt/gpdb/greenplum_path.sh
  10、创建主机文件 all_hosts
  $ vi all_hosts
  ifreBigData1
  ifreBigData2
  ifreBigData4
  11、运行gpseginstall工具
  $ gpseginstall -f all_hosts -u gpadmin-p gpadmin
  有可能免密失败
  20171215:08:55:57:054683 gpseginstall:ifreBigData1:root-[INFO]:-exchange ssh keys for user root
  20171215:08:55:57:054683 gpseginstall:ifreBigData1:root-[INFO]:-Cmd 'gpssh-exkeys -f all_hosts' failed with error code 1
  20171215:08:55:57:054683 gpseginstall:ifreBigData1:root-[INFO]:-gppsh-exkeys failed running from within pexpect ... now try outside of pexpect
  Problem getting hostname for ifreBigData1: [Errno 0] Resolver Error 0 (no error)
  Traceback (most recent call last):
  File &quot;/opt/gpdb/bin/gpssh-exkeys&quot;, line 534, in <module>
  (primary, aliases, ipaddrs) = socket.gethostbyaddr(hostname)
  socket.herror: [Errno 0] Resolver Error 0 (no error)
  20171215:08:55:58:054683 gpseginstall:ifreBigData1:root-[ERROR]:-error on cmd: gpssh-exkeys -f all_hosts
  解决方法
  $su gpadmin
  $source /opt/gpdb/greenplum_path.sh
  $gpssh-exkeys -f all_hosts
  12.验证安装及免密登录
  $ gpssh -f all_hosts -e ls $GPHOME
  13. 将source /opt/gpdb/greenplum_path.sh添加到.bashrc文件最后(所有的节点都要做)
  14、创建存储区域
  a) 创建Master数据存储区域
  mkdir -p /data/master
  b)改变目录所有权
  chown gpadmin /data/master
  c)创建包含所有segment主机的文件seg_hosts
  d)root用户用gpssh 工具在segment主机上创建主数据和镜像数据目录
  $ su root
  $ source /opt/gpdb/greenplum_path.sh
  $ gpssh-exkeys -f all_hosts
  gpssh -f seg_hosts -e 'mkdir -p /data/primary'
  gpssh -f seg_hosts -e 'mkdir -p /data/mirror'
  gpssh -f seg_hosts -e ‘chown gpadmin /data/primary'
  gpssh -f seg_hosts -e ‘chown gpadmin /data/mirror'
  15、同步系统时间
  在各个机器安装 ntp
  a.gpssh -f all_hosts -e 'apt install -y ntp'
  b.修改/etc/ntp.conf添加
  server masterhostname
  c.gpssh -f /data/all_hosts -e 'ntpd'
  16、验证操作系统设置
  #gpcheck -f /data/all_hosts -m ifreBigData1
  17、初始化GP数据库系统
  #su - gpadmin
  $ cp /opt/gpdb/docs/cli_help/gpconfigs/gpinitsystem_config ~/gpinitsystem_config
  $ chmod 775 gpinitsystem_config
  $ vi gpinitsystem_config
  ARRAY_NAME=&quot;Greenplum Data Platform&quot;
  SEG_PREFIX=ifreseg
  PORT_BASE=40000
  declare -a DATA_DIRECTORY=(/data/primary)
  MASTER_HOSTNAME=ifreBigData1
  MASTER_DIRECTORY=/data/master
  MASTER_PORT=5432
  #### OPTIONAL MIRROR PARAMETERS
  MIRROR_PORT_BASE=50000
  REPLICATION_PORT_BASE=41000
  MIRROR_REPLICATION_PORT_BASE=51000
  declare -a MIRROR_DATA_DIRECTORY=(/data/mirror)
  a)运行初始化工具
  $ cp /data/seg_hosts ~
  $ gpinitsystem -c gpinitsystem_config -h seg_hosts
  检查结果

  b)设置环境变量
  添加
  export MASTER_DATA_DIRECTORY=/data/master/ifreseg-1
  到master 的~/.bashrc
  在segment机器上做同样的操作
  18、启动停止数据库
  $ gpstart
  $gpstop
  验证
  $ psql -d template1

运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-453426-1-1.html 上篇帖子: Ubuntu 17.04安装redis4.01及主从复制部署实战 下篇帖子: Ubuntu 16.04 LTS 常用工具软件整理(陆续更新)
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表