IP | 角色 | OS | hostID |
---|---|---|---|
172.16.9.173 | 管理、数据、主节点 | RedHat7.3 | node173 |
172.16.9.174 | 管理、数据节点 | RedHat7.3 | node174 |
172.16.9.175 | 管理、数据节点 | RedHat7.3 | node175 |
标识符约定:
# 表示以 root 账户执行
[173]# 表示在 173 节点以 root 账户执行
$ 表示以 DBA 账户执行
[173]$ 表示在 173 节点以 DBA 账户执行
准备 SSH 工具:
推荐 XManager 5 以上。使用 XShell 模块分别连接三个 IP 创建三个 Session 窗口,方便在工具底部 Compose Bar中输入命令,同时发送命令到三个 Session 窗口。
节点联通测试:
在 node173 窗口分别执行
# ssh [email protected]
# ssh [email protected]
若能成功跳转,则说明节点互通。
检查所有节点防火墙是否关闭:
# systemctl status firewalld.service
如果没关闭,则执行下面命令永久关闭
# systemctl stop firewalld
# systemctl disable firewalld
检查所有节点 selinux 服务是否禁用:
执行
# sestatus
系统提示以下信息说明 selinux 已被禁用
SELinux status: disabled
否则修改配置文件/etc/selinux/config,将SELINUX参数设置为 disabled,即 SELINUX=disabled
保存退出后,需要重新启动才能生效。
准备安装包:
请将下载的安装包 GBase8a_MPP_Cluster-License-9.5.2.39-redhat7.3-x86_64.tar.bz2 上传到 node173:/opt 下。
# useradd gbase
# passwd gbase
本文,gbase 账户密码设置为 dba@gbase8a
# mkdir -p /opt/gbase
# chown gbase:gbase /opt/gbase
# chown gbase:gbase /tmp
[173]# cd /opt
[173]# tar xfj GBase8a_MPP_Cluster-License-9.5.2.39-redhat7.3-x86_64.tar.bz2
解压缩完成后,opt 下能看到生成 gcinstall 安装目录。
scp [email protected]:/opt/gcinstall/SetSysEnv.py /opt
scp [email protected]:/opt/gcinstall/SetSysEnv.py /opt
python SetSysEnv.py --dbaUser=gbase --installPrefix=/opt/gbase --cgroup
python SetSysEnv.py --dbaUser=gbase --installPrefix=/opt/gbase --cgroup
python SetSysEnv.py --dbaUser=gbase --installPrefix=/opt/gbase --cgroup
如果遇到 IPV6 protocol not supported,please turn it on…的错误提示,
请手动开启 IPV6,执行:
# echo "net.ipv6.conf.all.disable_ipv6 = 0" >> /etc/sysctl.conf
# echo "net.ipv6.conf.default.disable_ipv6 = 0" >> /etc/sysctl.conf
# sysctl -p # 立即生效
su - gbase
cd /opt/gcinstall/
vi demo.options
installPrefix = /opt/gbase
coordinateHost = 172.16.9.173,172.16.9.174,172.16.9.175
coordinateHostNodeID = 173,174,175
dataHost = 172.16.9.173,172.16.9.174,172.16.9.175
#existCoordinateHost =
#existDataHost =
dbaUser = gbase
dbaGroup = gbase
dbaPwd = 'dba@gbase8a'
rootPwd = 'peixun'
#rootPwdFile = rootPwd.json
dbaPwd 是 gbase 账户的密码
rootPwd 是 root 账户的密码
[173]$ ./gcinstall.py --silent=demo.options
备注:在安装过程中,先进行环境检查,可能会有错,列出缺少rpm依赖包名称,说明操作系统没有安装全必须的rpm包,需要根据rpm包的名称去各节点逐个安装。
8a需要的必备依赖包列表,请查看安装目录gcinstall下的 dependRpms 文件
[173]$ cat dependRpms
注意:如果操作系统没cgroup(资源管理)组件,会出现如下警告,输入 Y 回车即可。
安装结束之后,查看集群的状态。
$ gcadmin
因为没有注册授权,gcluster 和 gnode 服务是 close 状态属于正常现象。
CLUSTER STATE: ACTIVE
===============================================================
| GBASE COORDINATOR CLUSTER INFORMATION |
===============================================================
| NodeName | IpAddress | gcware | gcluster | DataState |
---------------------------------------------------------------
| coordinator1 | 172.16.9.173 | OPEN | CLOSE | 0 |
---------------------------------------------------------------
| coordinator2 | 172.16.9.174 | OPEN | CLOSE | 0 |
---------------------------------------------------------------
| coordinator3 | 172.16.9.175 | OPEN | CLOSE | 0 |
---------------------------------------------------------------
===============================================================
| GBASE CLUSTER FREE DATA NODE INFORMATION |
===============================================================
| NodeName | IpAddress | gnode | syncserver | DataState |
---------------------------------------------------------------
| Freenode1| 172.16.9.173 | CLOSE | OPEN | 0 |
---------------------------------------------------------------
| Freenode2| 172.16.9.174 | CLOSE | OPEN | 0 |
---------------------------------------------------------------
| Freenode3| 172.16.9.175 | CLOSE | OPEN | 0 |
---------------------------------------------------------------
0 virtual cluster
3 coordinator node
3 free data node
① 导出集群各节点的指纹信息:
[173]$ ./gethostsid -n 172.16.9.173,172.16.9.174,172.16.9.175 -u root -p peixun -f /tmp/finger.txt
② 申请授权
该档案中 “其他说明” 栏位是 “每期培训代码”,请关注学习群内公布的信息。
GBASE 公司:
附件为本人 GBase 8a 授权申请信息。
③ 授权申请处理时间点为工作日9:30、13:30和17:30。学员收到授权文件(*.lic)后上传到主节点的 /tmp 下。
① 导入授权:
[173]$ ./License -n 172.16.9.173,172.16.9.174,172.16.9.175 -f /tmp/20210608.lic -u gbase -p dba@gbase8a
② 检查授权导入情况:
[173]$ ./chkLicense -n 172.16.9.173,172.16.9.174,172.16.9.175 -u gbase -p dba@gbase8a
License 状态说明:
若发现授权失效(is_valid is no),可能由于集群节点硬件变更,请重新生成指纹文件并发邮件申请授权。
# su - gbase
$ gcluster_services all start
查看集群状态:
$ gcadmin
CLUSTER STATE: ACTIVE
VIRTUAL CLUSTER MODE: NORMAL
===============================================================
| GBASE COORDINATOR CLUSTER INFORMATION |
===============================================================
| NodeName | IpAddress | gcware | gcluster | DataState |
---------------------------------------------------------------
| coordinator1 | 172.16.9.173 | OPEN | OPEN | 0 |
---------------------------------------------------------------
| coordinator2 | 172.16.9.174 | OPEN | OPEN | 0 |
---------------------------------------------------------------
| coordinator3 | 172.16.9.175 | OPEN | OPEN | 0 |
---------------------------------------------------------------
=======================================================================
| GBASE DATA CLUSTER INFORMATION |
=======================================================================
| NodeName | IpAddress | gnode | syncserver | DataState |
-----------------------------------------------------------------------
| node1 | 172.16.9.173 | OPEN | OPEN | 0 |
-----------------------------------------------------------------------
| node2 | 172.16.9.174 | OPEN | OPEN | 0 |
-----------------------------------------------------------------------
| node3 | 172.16.9.175 | OPEN | OPEN | 0 |
-----------------------------------------------------------------------
[173]$ gcadmin distribution gcChangeInfo.xml p 2 d 1 pattern 1
"1.0" encoding="utf-8"?>
"172.16.9.173"/>
"172.16.9.174"/>
"172.16.9.175"/>
gcadmin
CLUSTER STATE: ACTIVE
VIRTUAL CLUSTER MODE: NORMAL
===============================================================
| GBASE COORDINATOR CLUSTER INFORMATION |
===============================================================
| NodeName | IpAddress | gcware | gcluster | DataState |
---------------------------------------------------------------
| coordinator1 | 172.16.9.173 | OPEN | OPEN | 0 |
---------------------------------------------------------------
| coordinator2 | 172.16.9.174 | OPEN | OPEN | 0 |
---------------------------------------------------------------
| coordinator3 | 172.16.9.175 | OPEN | OPEN | 0 |
---------------------------------------------------------------
============================================================================
| GBASE DATA CLUSTER INFORMATION |
============================================================================
| NodeName | IpAddress | DistributionId | gnode | syncserver | DataState |
----------------------------------------------------------------------------
| node1 | 172.16.9.173 | 1 | OPEN | OPEN | 0 |
----------------------------------------------------------------------------
| node2 | 172.16.9.174 | 1 | OPEN | OPEN | 0 |
----------------------------------------------------------------------------
| node3 | 172.16.9.175 | 1 | OPEN | OPEN | 0 |
----------------------------------------------------------------------------
gcadmin showdistribution node
Distribution ID: 1 | State: new | Total segment num: 6
============================================================================
| nodes | 172.16.9.173 | 172.16.9.174 | 172.16.9.175 |
----------------------------------------------------------------------------
| primary | 1 | 2 | 3 |
| segments | 4 | 5 | 6 |
----------------------------------------------------------------------------
|duplicate | 3 | 1 | 2 |
|segments 1| 5 | 6 | 4 |
============================================================================
gccli -u root -p
initnodedatamap;
初始化成功,则整个8a集群安装完毕,可以创建第一个库和表。
gbase> create database test;
gbase>show databases;
gbase>use test;
gbase>create table t(id int ,name varchar(20));
gbase>show tables;
gcluster_services all stop
gcluster_services all stop
gcluster_services all stop
Stopping GCMonit success!
Stopping gcrecover : [ OK ]
Stopping gcluster : [ OK ]
Stopping gcware : [ OK ]
Stopping gbase : [ OK ]
Stopping syncserver : [ OK ]
cd /opt/gcinstall
./unInstall.py --silent=demo.options
Q01. 集群安装成功后,在管理节点执行 gcadmin,系统提示找不到命令
exit
su gbase
Q02. 在管理节点执行 gcadmin,系统提示
Could not initialize CRM instance error: [122]->[can not connect to any server]
gcluster_services all start
gcluster_services all start
gcluster_services all start
Q03 SSH 服务确认22端口被禁止,能安装8a集群吗?
cd /etc/ssh
vi ssh_config
service sshd restart
netstat -tunlp | grep ssh
gcluster_services all stop
gcluster_services all stop
gcluster_services all stop
gcluster_services all start
gcluster_services all start
gcluster_services all start
Q04. 查看安装8a集群的依赖包列表
$ cat /opt/gcinstall/dependRpms
pcre
krb5-libs
libdb
glibc
keyutils-libs
libidn
libuuid
ncurses-libs
libgpg-error
libgomp
libstdc++
libcom_err
libgcc
python-libs
libselinux
libgcrypt
nss-softokn-freebl
在安装脚本执行过程中,如果系统提示缺少rpm依赖包,需要按照以上rpm列表名,在各节点安装缺少的包。