手抄报 安全手抄报 手抄报内容 手抄报图片 英语手抄报 清明节手抄报 节约用水手抄报

centos7.2下greenplum-db的安装和配置

时间:2024-11-14 05:19:07

centos7.2下 greenplum-db 安装及配置步骤如下:

工具/原料

centos7.2 greenplum-db

1.系统要求

1、1.系统版本要求: 根据官方文档: greenplum-db支持以下几种linux系统:SUSE Linux Enterprise Server 64-bit 12 SP2 or SP3, with kernel 4.4.73-5.1 or newer SUSE Linux Enterprise Server 64-bit 11 SP4CentOS 64-bit 6.x or 7.xRed Hat Enterprise Linux (RHEL) 64-bit 6.x or 7.x作者的操作系统版本如下:

centos7.2下greenplum-db的安装和配置

2、2.文件系统要求: 数据存储目录为xfs文件系统 作者安装的系统格式如下:

centos7.2下greenplum-db的安装和配置

2.修改系统配置

1、1 gp服务器列表192.168.7.212 yanfa1 主节点192.168.7.218 yanfa11 数据节点1192.168.7.216 yanfa2 数据节点2192.168.7.221 yanfa21 主节点切换备份节点

2、2.修改系统配置项关闭SELINUXvi /etc/selinux/configSELINUX=disabled

3、3关闭防火墙systemctl status firewalldsystemctl stop firewalld.servicesystemctl disable firewalld.serviceiptable -L -n

4、4彭榧逡钚修改内核配置参数,并执行 sysctl -p使之生效vi /etc/sysctl.confkernel.shmmax = 500000000kernel.shmmni = 4096kernel.shmall = 4000000000kernel.sem = 2000 4096000 2000 2048kernel.sysrq = 1kernel.core_uses_pid = 1kernel.msgmnb = 65536kernel.msgmax = 65536kernel.msgmni = 2048net.ipv4.tcp_syncookies = 1net.ipv4.ip_forward = 0net.ipv4.conf.default.accept_source_route = 0net.ipv4.tcp_tw_recycle = 1net.ipv4.tcp_max_syn_backlog = 4096net.ipv4.conf.all.arp_filter = 1net.ipv4.ip_local_port_range = 1025 65535net.core.netdev_max_backlog = 10000net.core.rmem_max = 2097152net.core.wmem_max = 2097152vm.overcommit_memory = 2

5、vi /etc/security/limits.conf* soft nofile 65536* hard nofile 65536* soft nproc 131072* hard nproc 131072

6、5配置集群中各节点hosts信息vi /etc/hosts192.168.7.212 yanfa1 192.168.7.218 yanfa11192.168.7.216 yanfa2 192.168.7.221 yanfa21

centos7.2下greenplum-db的安装和配置

3.安装greenplum-db

1、1从greenplum官网下载以下2个包到/opt目录下greenplum-db-5.4.0-rhel7-x86_64.zipgreenplum-cc-web-3.3.1-LINUX-x86_64.zip执行unzip greenplum-db-5.4.0-rhel7-x86_64.zipunzipgreenplum-cc-web-3.3.1-LINUX-x86_64.zip解压后分别为greenplum-db-5.4.0-rhel7-x86_64.bingreenplum-cc-web-3.3.1-LINUX-x86_64.bin

2、2 开始安装执行./greenplum-db-5.4.0-rhel7-x86_64.bin按照提示输入安装目录/opt/greenplum-db执行./greenplum-cc-web-3.3.1-LINUX-x86_64.bin按照提示输入安装目录/opt/greenplum-cc-web

3、解压完成后以root身份创建gpadmi艘绒庳焰n用户和组,用来管理greenplum-dbgroupadd gpadmin # 创建分组 useradd gpadmin -g gpadmin # 创建用户并分配组 passwd gpadmin # 为gpadmin分配密码 cd /opt/greenplum-dbchown -R gpadmin:gpadmin greenplum-db/ chown -R gpadmin:gpadmin greenplum-cc-web/

centos7.2下greenplum-db的安装和配置

4、3切换到gpadmin用户下su - gpadmin mkdir -p /opt/greenplum-db/gpconfigs cd /opt/greenplum-db/gpconfigs创建配置文件vimhostfile_exkeys输入yanfa2yanfa1yanfa11yanfa21vi hostfileyanfa1yanfa11yanfa21

centos7.2下greenplum-db的安装和配置

5、在gpadmin和root用户下添加环境变量vi~/.bashrc#添加以下内容 export LD_LIBRARY_PATH=$GPHOME/lib export MASTER_DATA_DIRECTORY=/home/gpadmin/gpdata/master/gpseg-1 source /opt/greenplum-db/greenplum_path.sh source /opt/greenplum-cc-web/gpcc_path.sh保存退出,执行下面语句使其生效source~/.bashrc

6、切换到root用户:gpssh-exkeys -酆璁冻嘌f /opt/greenplum-db/gpconfigs/hostfile_exkeys #拷贝mster节点公钥至各segment节点 gpseginstall -f /opt/greenplum-db/gpconfigs/hostfile_exkeys -p gpadmin说明gpssh-exkeys -f hostfile_exkeys将会在master节点生成公私钥,并拷贝至hostfile_exkeys各segment节点,实现后续无密钥登陆gpseginstall -f /opt/greenplum-db/gpconfigs/hostfile_exkeys -p gpadmin使用默认用户名(gpadmin) 密码:gpadmin 在各segment节点安装Greenplum-db

7、4在master及各segment节点创建数据存储目录mkdir /home/gpadmin/gpdata/master艘早祓胂cd /home/gpadmin/chown -R gpadmin:gpadmin gpdata/mastergpssh -f /opt/greenplum-db/gpconfigs/hostfile -e "mkdir -p /home/gpadmin/gpdata/data1/primary;mkdir -p /home/gpadmin/gpdata/data2/primary”gpssh -f /opt/greenplum-db/gpconfigs/hostfile -e "mkdir -p /home/gpadmin/gpdata/data1/mirror;mkdir -p /home/gpadmin/gpdata/data2/mirror"gpssh -f /opt/greenplum-db/gpconfigs/hostfile -e "chown -R gpadmin:gpadmin /home/gpadmin/gpdata"gpssh -f /opt/greenplum-db/gpconfigs/hostfile_exkeys -v -e 'ntpd'切换到gpadmin用户下,初始化数据库集群su - gpadmincd /opt/greenplum-db/cp /opt/greenplum-db/docs/cli_help/gpconfigs/gpinitsystem_config /opt/greenplum-db/gpconfigs/gpinitsystem_configvi /opt/greenplum-db/gpconfigs/gpinitsystem_config###修改以下内容MASTER_HOSTNAME=mdwPORT_BASE=40000declare -a DATA_DIRECTORY=(/home/gpadmin/gpdata/data1/primary /home/gpadmin/gpdata/data1/primary /home/gpadmin/gpdata/data2/primary /home/gpadmin/gpdata/data2/primary)MASTER_DIRECTORY=/home/gpadmin/gpdata/masterMASTER_PORT=5432MIRROR_PORT_BASE=50000REPLICATION_PORT_BASE=41000MIRROR_REPLICATION_PORT_BASE=51000declare -a MIRROR_DATA_DIRECTORY=(/home/gpadmin/gpdata/data1/mirror /home/gpadmin/gpdata/data1/mirror /home/gpadmin/gpdata/data2/mirror /home/gpadmin/gpdata/data2/mirror)DATABASE_NAME=gpdbMACHINE_LIST_FILE=/opt/greenplum-db/gpconfigs/hostfile

8、5配置修改完成之后,执行以下命令初始化数据库gpinitsystem -c /opt/greenplum-db/gpconfigs/gpinitsystem_config -h /opt/greenplum-db/gpconfigs/hostfile出现下面的日志表示安装成功:

centos7.2下greenplum-db的安装和配置

9、6 psql修改数据库密码:psql -d gpdb gpdb=# alter user gpadmin with password 'gpadmin' gpdb=# \q 然后,重启greenplumdb集群gpstop -agpstart -a上述gpdb已安装完成,下面安装gpcc

10、7.遏捍街熘启动greenplum-db commond center(gpcc)gpperfmon_install--enable--port5432--passwordgpadmin重启gre髫潋啜缅enplumdb集群,加载gpperfmon_install采集数据gpstop -agpstart -a启动web控制台界面gpcmdr--setup按照提示输入实例名、监听端口信息等#Please enter the instance namegpcc#Press ENTER to use instance namegpcc#Is the master host for the Greenplum Database remote? Yy/Nn (default=N)N#What port does the Greenplum Database use? (default=5432)5432#Enable kerberos login for this instance? Yy/Nn (default=N)N#What port would you like the new web server to use for this instance? (default=28080)28080启动、停止gpcmdr --start #启动gpcmdr --stop #停止

11、8.web登录gpcc控制台http://master:28080/输入用户名和密码:gpmon/gpadmin

centos7.2下greenplum-db的安装和配置

12、如果密码不对,请修改gpadmin用户目录下文件.pgpass

centos7.2下greenplum-db的安装和配置

13、文件内容为:*:5432:gpperfmon:gpmon:gpadmin

14、登录后效果如下:

centos7.2下greenplum-db的安装和配置

15、9图形界面工具pgAdmin4安装下载工具:pgadmin4-3.3-x86.exe登录地址:http://127.0.0.1:64918/browser/登录界面:

centos7.2下greenplum-db的安装和配置

16、如果登录不成功,一般报错如下样子:psql: FATAL: no pg_hba.conf entry for host "192.168.xxx.xxx",表示访问权限不够修改文件/home/gpadmin/gpdata/master/gpseg-1/pg_hba.conf

centos7.2下greenplum-db的安装和配置

17、最后登录成功如下:

centos7.2下greenplum-db的安装和配置
© 手抄报圈