gbase之集群搭建

Posted xixi艾

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了gbase之集群搭建相关的知识,希望对你有一定的参考价值。

Do you accept the above licence agreement ([Y,y]/[N,n])? Y
*********************************************************************************
                     Welcome to install GBase products
*********************************************************************************
Environmental Checking on gcluster nodes.
Cgconfig service is not exist on host ['192.168.56.61', '192.168.56.62', '192.168.56.63'], resource manangement can not be used, continue ([Y,y]/[N,n])? Y
CoordinateHost:
192.168.56.61    192.168.56.62
DataHost:
192.168.56.61    192.168.56.62    192.168.56.63
Are you sure to install GCluster on these nodes ([Y,y]/[N,n])? Y
192.168.56.61        	start install on host 192.168.56.61
192.168.56.63        	start install on host 192.168.56.63
192.168.56.62        	start install on host 192.168.56.62
192.168.56.61        	start install on host 192.168.56.61
192.168.56.63        	start install on host 192.168.56.63
192.168.56.62        	start install on host 192.168.56.62
192.168.56.61        	mkdir /opt/cluster_prepare on host 192.168.56.61.
192.168.56.63        	mkdir /opt/cluster_prepare on host 192.168.56.63.
192.168.56.62        	mkdir /opt/cluster_prepare on host 192.168.56.62.
192.168.56.61        	mkdir /opt/cluster_prepare on host 192.168.56.61.
192.168.56.63        	mkdir /opt/cluster_prepare on host 192.168.56.63.
192.168.56.62        	mkdir /opt/cluster_prepare on host 192.168.56.62.
192.168.56.61        	Copying InstallTar.py to host 192.168.56.61:/opt/cluster_prepare
192.168.56.63        	Copying InstallTar.py to host 192.168.56.63:/opt/cluster_prepare
192.168.56.62        	Copying InstallTar.py to host 192.168.56.62:/opt/cluster_prepare
192.168.56.61        	Copying InstallFuns.py to host 192.168.56.61:/opt/cluster_prepare
192.168.56.63        	Copying InstallFuns.py to host 192.168.56.63:/opt/cluster_prepare
192.168.56.62        	Copying InstallFuns.py to host 192.168.56.62:/opt/cluster_prepare
192.168.56.61        	Copying InstallFuns.py to host 192.168.56.61:/opt/cluster_prepare
192.168.56.63        	Copying InstallFuns.py to host 192.168.56.63:/opt/cluster_prepare
192.168.56.62        	Copying InstallFuns.py to host 192.168.56.62:/opt/cluster_prepare
192.168.56.61        	Copying rmt.py to host 192.168.56.61:/opt/cluster_prepare
192.168.56.63        	Copying rmt.py to host 192.168.56.63:/opt/cluster_prepare
192.168.56.62        	Copying rmt.py to host 192.168.56.62:/opt/cluster_prepare
192.168.56.61        	Copying rmt.py to host 192.168.56.61:/opt/cluster_prepare
192.168.56.63        	Copying rmt.py to host 192.168.56.63:/opt/cluster_prepare
192.168.56.62        	Copying rmt.py to host 192.168.56.62:/opt/cluster_prepare
192.168.56.61        	Copying SSHThread.py to host 192.168.56.61:/opt/cluster_prepare
192.168.56.63        	Copying SSHThread.py to host 192.168.56.63:/opt/cluster_prepare
192.168.56.62        	Copying SSHThread.py to host 192.168.56.62:/opt/cluster_prepare
192.168.56.61        	Copying RestoreLocal.py to host 192.168.56.61:/opt/cluster_prepare
192.168.56.63        	Copying RestoreLocal.py to host 192.168.56.63:/opt/cluster_prepare
192.168.56.62        	Copying RestoreLocal.py to host 192.168.56.62:/opt/cluster_prepare
192.168.56.61        	Copying RestoreLocal.py to host 192.168.56.61:/opt/cluster_prepare
192.168.56.63        	Copying RestoreLocal.py to host 192.168.56.63:/opt/cluster_prepare
192.168.56.62        	Copying RestoreLocal.py to host 192.168.56.62:/opt/cluster_prepare
192.168.56.61        	Copying pexpect.py to host 192.168.56.61:/opt/cluster_prepare
192.168.56.63        	Copying pexpect.py to host 192.168.56.63:/opt/cluster_prepare
192.168.56.62        	Copying pexpect.py to host 192.168.56.62:/opt/cluster_prepare
192.168.56.61        	Copying pexpect.py to host 192.168.56.61:/opt/cluster_prepare
192.168.56.63        	Copying pexpect.py to host 192.168.56.63:/opt/cluster_prepare
192.168.56.62        	Copying pexpect.py to host 192.168.56.62:/opt/cluster_prepare
192.168.56.61        	Copying BUILDINFO to host 192.168.56.61:/opt/cluster_prepare
192.168.56.63        	Copying BUILDINFO to host 192.168.56.63:/opt/cluster_prepare
192.168.56.62        	Copying BUILDINFO to host 192.168.56.62:/opt/cluster_prepare
192.168.56.61        	Copying bundle.tar.bz2 to host 192.168.56.61:/opt/cluster_prepare
192.168.56.63        	Copying bundle.tar.bz2 to host 192.168.56.63:/opt/cluster_prepare
192.168.56.62        	Copying bundle.tar.bz2 to host 192.168.56.62:/opt/cluster_prepare
192.168.56.61        	Copying bundle.tar.bz2 to host 192.168.56.61:/opt/cluster_prepare
192.168.56.63        	Copying bundle.tar.bz2 to host 192.168.56.63:/opt/cluster_prepare
192.168.56.62        	Copying bundle.tar.bz2 to host 192.168.56.62:/opt/cluster_prepare
192.168.56.61        	Copying bundle.tar.bz2 to host 192.168.56.61:/opt/cluster_prepare
192.168.56.63        	Copying bundle.tar.bz2 to host 192.168.56.63:/opt/cluster_prepare
192.168.56.62        	Copying bundle.tar.bz2 to host 192.168.56.62:/opt/cluster_prepare
192.168.56.61        	Copying bundle.tar.bz2 to host 192.168.56.61:/opt/cluster_prepare
192.168.56.63        	Copying bundle.tar.bz2 to host 192.168.56.63:/opt/cluster_prepare
192.168.56.62        	Copying bundle.tar.bz2 to host 192.168.56.62:/opt/cluster_prepare
192.168.56.61        	Copying bundle_data.tar.bz2 to host 192.168.56.61:/opt/cluster_prepare
192.168.56.63        	Copying bundle_data.tar.bz2 to host 192.168.56.63:/opt/cluster_prepare
192.168.56.62        	Copying bundle_data.tar.bz2 to host 192.168.56.62:/opt/cluster_prepare
192.168.56.61        	Copying bundle_data.tar.bz2 to host 192.168.56.61:/opt/cluster_prepare
192.168.56.63        	Copying bundle_data.tar.bz2 to host 192.168.56.63:/opt/cluster_prepare
192.168.56.62        	Copying bundle_data.tar.bz2 to host 192.168.56.62:/opt/cluster_prepare
192.168.56.61        	Installing gcluster.
192.168.56.63        	Installing gcluster.
192.168.56.62        	Installing gcluster.
192.168.56.61        	Installing gcluster.
192.168.56.63        	Installing gcluster.
192.168.56.62        	Installing gcluster.
192.168.56.61        	Installing gcluster.
192.168.56.63        	Installing gcluster.
192.168.56.62        	Installing gcluster.
192.168.56.61        	Installing gcluster.
192.168.56.63        	Installing gcluster.
192.168.56.62        	Installing gcluster.
192.168.56.61        	Installing gcluster.
192.168.56.63        	Installing gcluster.
192.168.56.62        	Installing gcluster.
192.168.56.61        	Installing gcluster.
192.168.56.63        	Installing gcluster.
192.168.56.62        	Installing gcluster.
192.168.56.61        	Installing gcluster.
192.168.56.63        	Installing gcluster.
192.168.56.62        	Installing gcluster.
192.168.56.61        	Installing gcluster.
192.168.56.63        	Installing gcluster.
192.168.56.62        	Installing gcluster.
192.168.56.61        	Installing gcluster.
192.168.56.63        	Installing gcluster.
192.168.56.62        	Installing gcluster.
192.168.56.61        	Installing gcluster.
192.168.56.63        	Installing gcluster.
192.168.56.62        	Installing gcluster.
192.168.56.61        	Installing gcluster.
192.168.56.63        	Installing gcluster.
192.168.56.62        	Installing gcluster.
192.168.56.61        	Installing gcluster.
192.168.56.63        	Installing gcluster.
192.168.56.62        	Installing gcluster.
192.168.56.61        	Installing gcluster.
192.168.56.63        	Installing gcluster.
192.168.56.62        	Installing gcluster.
192.168.56.61        	Installing gcluster.
192.168.56.63        	Installing gcluster.
192.168.56.62        	Installing gcluster.
192.168.56.61        	Installing gcluster.
192.168.56.63        	Installing gcluster.
192.168.56.62        	Installing gcluster.
192.168.56.61        	Installing gcluster.
192.168.56.63        	Installing gcluster.
192.168.56.62        	Installing gcluster.
192.168.56.61        	Installing gcluster.
192.168.56.63        	Installing gcluster.
192.168.56.62        	Installing gcluster.
192.168.56.61        	Installing gcluster.
192.168.56.63        	Installing gcluster.
192.168.56.62        	Installing gcluster.
192.168.56.61        	Installing gcluster.
192.168.56.63        	install cluster on host 192.168.56.63 successfully.
192.168.56.62        	Installing gcluster.
192.168.56.61        	install cluster on host 192.168.56.61 successfully.
192.168.56.63        	install cluster on host 192.168.56.63 successfully.
192.168.56.62        	install cluster on host 192.168.56.62 successfully.
Starting all gcluster nodes...
start service failed on host 192.168.56.63.
start service failed on host 192.168.56.62.
start service failed on host 192.168.56.61.
adding new datanodes to gcware...
InstallCluster Successfully.
You have new mail in /var/spool/mail/gbase

./gcinstall.py --silent=demo.options因此时未导入lincense,启动可能不成功
后续用gcadmin登录,第一次登录会报错,应该重新su - gbase下登录。
[gbase@gbase1 ~]$ gcadmin
bash: gcadmin: command not found…

6.导入license(全部节点)

接着上文继续

./gethostsid -n 192.168.56.61,192.168.56.62,192.168.56.63  -u root  -p beijing  -f  /opt/finger.txt

将finger.txt邮件给gbase公司,收到lincense文件,将其分别导入三个服务器节点,注属组为gbase

[root@localhost opt]# ls -l
total 32
-rw-r--r--. 1 gbase gbase  1478 May 18 11:35 20210518-09.lic
drwxr-xr-x. 5 gbase gbase    45 May 18 10:44 gcluster
drwxrwxr-x. 6 gbase gbase    61 May 18 10:44 gnode
drwxrwxrwx. 2 root  root      6 Jun 18  2018 rh
-rwxr-xr-x. 1 root  root  27849 May 18 10:38 SetSysEnv.py
[gbase@gbase1 gcinstall]$ ./License  -n 192.168.56.61,192.168.56.62,192.168.56.63  -u gbase -p gbase -f  /opt/20210518-09.lic
Successful node nums:	3

7.启动各节点(全部节点)

[gbase@localhost ~]$ gcluster_services all start
[gbase@localhost gcinstall]$ gcluster_services all start
Starting gcware : [ OK ]
Starting gcluster : [ OK ]
Starting gcrecover : [ OK ]
Starting gbase : [ OK ]
Starting syncserver : [ OK ]
Starting GCMonit success!

[gbase@localhost ~]$ gcluster_services all info
gcware is running
gcluster is running
gcrecover is running
gbase is running
syncserver is running

8.设置集群分片信息(主节点)

[gbase@localhost gcinstall]$ gcadmin distribution gcChangeInfo.xml p 2 d 1 pattern 1
[gbase@localhost gcinstall]$ gcadmin showdistribution node

9. 连接数据库

[gbase@localhost gcinstall]$ gccli uroot -p
Enter password: 
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
[gbase@localhost gcinstall]$ gccli 

GBase client 9.5.2.39.126761. Copyright (c) 2004-2021, GBase.  All Rights Reserved.

gbase> show database;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your GBase server version for the right syntax to use near 'database' at line 1
gbase> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| performance_schema |
| gbase              |
| gctmpdb            |
+--------------------+
4 rows in set (Elapsed: 00:00:00.00)

三、卸载

[root@gbase1 opt]# rm -rf gcluster/ gnode/ gcware/
重新执行 [gbase@gbase1 gcinstall]$ ./gcinstall.py --silent=demo.options

总结

到此结束,基础原理一定要明白。

以上是关于gbase之集群搭建的主要内容,如果未能解决你的问题,请参考以下文章

gbase之集群搭建

gbase之集群搭建

gbase之集群搭建

gbase之集群搭建

gbase集群搭建

gbase删除数据节点会影响数据吗