运维开发网
广告位招商联系QQ:123077622
 
广告位招商联系QQ:123077622

GBase 8a MPP Cluster 安装操作

运维开发网 https://www.qedev.com 2021-05-18 14:04 出处:51CTO 作者:李石岩
GBase 8a MPP Cluster 安装操作,GBase 8a MPP Cluster 安装操作

环境规划

三个物理节点IP

10.10.10.201、10.10.10.202、10.10.10.203

Coordinator节点为

10.10.10.201、10.10.10.202

DATA节点为

10.10.10.201、10.10.10.202、10.10.10.203

分片规则

gbase01 主分片  1 ,4   分片副本 5 ,3
gbase01 主分片  2 ,5   分片副本 1 ,6
gbase01 主分片  3 ,6   分片副本 4 ,2

操作步骤

解压

[[email protected] opt]# tar xfj GBase8a_MPP_Cluster-License-9.5.2.39-redhat7.3-x86_64.tar.bz2 
[[email protected] opt]# ll
total 140768
-rw-r--r-- 1 root  root  140464404 May 15 02:56 GBase8a_MPP_Cluster-License-9.5.2.39-redhat7.3-x86_64.tar.bz2
-rw-r--r-- 1 root  root    3673603 May 15 02:53 gccli-9.5.2.39-redhat7.3-x86_64.tar.bz2
drwxrwxr-x 2 vhost vhost      4096 Mar 14 02:06 gcinstall
[[email protected] opt]# 

三个节点上创建用户

useradd gbase
echo "gbase"|passwd --stdin gbase

将SetSysEnv.py放置于/opt目录下

[[email protected] gcinstall]# scp SetSysEnv.py  gbase02:/opt
SetSysEnv.py                                                              100%   27KB  15.9MB/s   00:00    
[[email protected] gcinstall]# scp SetSysEnv.py  gbase03:/opt
SetSysEnv.py                                                              100%   27KB  20.0MB/s   00:00    
[[email protected] gcinstall]# pwd
/opt/gcinstall
[[email protected] gcinstall]# cp SetSysEnv.py /opt
[[email protected] gcinstall]# cd ..
[[email protected] opt]# ls
GBase8a_MPP_Cluster-License-9.5.2.39-redhat7.3-x86_64.tar.bz2  gcinstall
gccli-9.5.2.39-redhat7.3-x86_64.tar.bz2                        SetSysEnv.py
[[email protected] opt]#

三个节点都执行环境变量

[[email protected] opt]# python SetSysEnv.py  --dbaUser=gbase --installPrefix=/opt --cgroup

三个节点赋权给目录

chmod -R 777 /opt
chmod -R 777 /tmp

201上编辑配置文件

[[email protected] gcinstall]$ vim demo.options 
[[email protected] gcinstall]$ cat demo.options 
installPrefix= /opt
coordinateHost = 192.168.151.234,192.168.151.235,192.168.151.237
coordinateHostNodeID = 234,235,237
dataHost = 192.168.151.234,192.168.151.235,192.168.151.237
#existCoordinateHost =
#existDataHost =
dbaUser = gbase
dbaGroup = gbase
dbaPwd = ''
rootPwd = ''
#rootPwdFile = rootPwd.json
[[email protected] gcinstall]$ vim demo.options 
[[email protected] gcinstall]$ cat demo.options 
installPrefix= /opt
coordinateHost = 10.10.10.201,10.10.10.202
coordinateHostNodeID = 201,202
dataHost = 10.10.10.201,10.10.10.202,10.10.10.203
#existCoordinateHost =
#existDataHost =
dbaUser = gbase
dbaGroup = gbase
dbaPwd = 'gbase'
rootPwd = 'redhat'
#rootPwdFile = rootPwd.json
[[email protected] gcinstall]$ 

静默安装

[[email protected] gcinstall]$ ./gcinstall.py --silent=demo.options
*********************************************************************************
Thank you for choosing GBase product!

Please read carefully the following licencing agreement before installing GBase product:
TIANJIN GENERAL DATA TECHNOLOGY CO., LTD. LICENSE AGREEMENT

READ THE TERMS OF THIS AGREEMENT AND ANY PROVIDED SUPPLEMENTAL LICENSETERMS (COLLECTIVELY "AGREEMENT") CAREFULLY BEFORE OPENING THE SOFTWAREMEDIA PACKAGE.  BY OPENING THE SOFTWARE MEDIA PACKAGE, YOU AGREE TO THE TERMS OF THIS AGREEMENT.  IF YOU ARE ACCESSING THE SOFTWARE ELECTRONICALLY, INDICATE YOUR ACCEPTANCE OF THESE TERMS.  IF YOU DO NOT AGREE TO ALL THESE TERMS, PROMPTLY RETURN THE UNUSED SOFTWARE TO YOUR PLACE OF PURCHASE FOR A REFUND.

1.  LICENSE TO USE.  GeneralData grants you a non-exclusive and non-transferable license for the internal use only of the accompanying software and documentation and any error corrections provided by GeneralData(collectively "Software"), by the number of users and the class of computer hardware for which the corresponding fee has been paid.

2.  RESTRICTIONS.  Software is confidential and copyrighted. Title to Software and all associated intellectual property rights is retained by GeneralData and/or its licensors.  Except as specifically authorized in any Supplemental License Terms, you may not make copies of Software, other than a single copy of Software for archival purposes.  Unless enforcement is prohibited by applicable law, you may not modify,decompile, or reverse engineer Software.  You acknowledge that Software is not designed, licensed or intended for use in the design,construction, operation or maintenance of any nuclear facility.  GeneralData disclaims any express or implied warranty of fitness for such uses.No right, title or interest in or to any trademark, service mark, logo or trade name of GeneralData or its licensors is granted under this Agreement.

3.  DISCLAIMER OF WARRANTY.  Unless specified in this agreement, all express of implied conditions, representations and warranties, including any implied warranty of merchantability, fitness for aparticular purpose or non-infringement are disclaimed, except to theextent that these disclaimers are held to be legally invalid.

4.  LIMITATION OF LIABILITY.  To the extent not prohibited by law, in no event will GeneralData or its licensors be liable for any lost revenue, profit or data, or for special, indirect, consequential,incidental orpunitive damages, however caused regardless of the theory of liability, arising out of or related to the use of or inability to use software, even if GeneralData has been advised of the possibility of such damages.In no event will GeneralData's libility to you, whether incontract, tort (including negligence), or otherwise, exceed the amount paid by you for Software under this Agreement.  The foregoing limitations will apply even if the above stated warranty fails of itsessential purpose.

5.  TERMINATION.  This Agreement is effective until terminated.  You may terminate this Agreement at any time by destroying all copies of Software.  This Agreement will terminate immediately without noticefrom GeneralData if you fail to comply with any provision of this Agreement.Upon Termination, you must destroy all copies of Software.

6.  EXPORT REGULATIONS.  All Software and technical data delivered under this Agreement are subject to US export control laws and may be subject to export or import regulations in other countries.  You agree to comply strictly with all such laws and regulations and acknowledge that you have the responsibility to obtain such licenses to export,re-export, or import as may be required after delivery to you.

7.  CHINESE GOVERNMENT RESTRICTED.  If Software is being acquired by or on behalf of the Chinese Government , then the Government's rights in Software and accompanying documentation will be only as set forth in this Agreement.

8.  GOVERNING LAW.  Any action related to this Agreement will be governed by Chinese law: "COPYRIGHT LAW OF THE PEOPLE'S REPUBLIC OF CHINA","PATENT LAW OF THE PEOPLE'S REPUBLIC OF CHINA","TRADEMARK LAW OF THE PEOPLE'S REPUBLIC OF CHINA","COMPUTER SOFTWARE PROTECTION REGULATIONS OF THE PEOPLE'S REPUBLIC OF CHINA".  No choice of law rules of any jurisdiction will apply."

9.  SEVERABILITY.  If any provision of this Agreement is held to be unenforceable, this Agreement will remain in effect with the provision omitted, unless omission would frustrate the intent of the parties, inwhich case this Agreement will immediately terminate.

10. INTEGRATION.  This Agreement is the entire agreement between you and GeneralData relating to its subject matter.  It supersedes all prior or contemporaneous oral or written communications, proposals,representations and warranties and prevails over any conflicting or additional terms of any quote, order, acknowledgment, or other communication between the parties relating to its subject matter during the term of this Agreement.  No modification of this Agreement will be binding, unless in writing and signed by an authorize depresentative of each party. When the translation document has the different meaning or has the conflicting views with Chinese original text conflict, should take the laws and regulations promulgation unit as well as the Generaldata issue Chinese original text as the standard. 

*********************************************************************************
Do you accept the above licence agreement ([Y,y]/[N,n])? y
*********************************************************************************
                     Welcome to install GBase products
*********************************************************************************
Environmental Checking on gcluster nodes.
CoordinateHost:
10.10.10.201    10.10.10.202
DataHost:
10.10.10.201    10.10.10.202    10.10.10.203
Are you sure to install GCluster on these nodes ([Y,y]/[N,n])? y
10.10.10.201            start install on host 10.10.10.201
10.10.10.203            start install on host 10.10.10.203
10.10.10.202            start install on host 10.10.10.202
10.10.10.201            mkdir /opt/cluster_prepare on host 10.10.10.201.
10.10.10.203            mkdir /opt/cluster_prepare on host 10.10.10.203.
10.10.10.202            mkdir /opt/cluster_prepare on host 10.10.10.202.
10.10.10.201            Copying InstallTar.py to host 10.10.10.201:/opt/cluster_prepare
10.10.10.203            Copying InstallTar.py to host 10.10.10.203:/opt/cluster_prepare
10.10.10.202            Copying InstallFuns.py to host 10.10.10.202:/opt/cluster_prepare
10.10.10.201            Copying rmt.py to host 10.10.10.201:/opt/cluster_prepare
10.10.10.203            Copying rmt.py to host 10.10.10.203:/opt/cluster_prepare
10.10.10.202            Copying rmt.py to host 10.10.10.202:/opt/cluster_prepare
10.10.10.201            Copying SSHThread.py to host 10.10.10.201:/opt/cluster_prepare
10.10.10.203            Copying SSHThread.py to host 10.10.10.203:/opt/cluster_prepare
10.10.10.202            Copying RestoreLocal.py to host 10.10.10.202:/opt/cluster_prepare
10.10.10.201            Copying pexpect.py to host 10.10.10.201:/opt/cluster_prepare
10.10.10.203            Copying pexpect.py to host 10.10.10.203:/opt/cluster_prepare
10.10.10.202            Copying pexpect.py to host 10.10.10.202:/opt/cluster_prepare
10.10.10.201            Copying BUILDINFO to host 10.10.10.201:/opt/cluster_prepare
10.10.10.203            Copying bundle.tar.bz2 to host 10.10.10.203:/opt/cluster_prepare
10.10.10.202            Copying bundle.tar.bz2 to host 10.10.10.202:/opt/cluster_prepare
10.10.10.201            Copying bundle.tar.bz2 to host 10.10.10.201:/opt/cluster_prepare
10.10.10.203            Copying bundle.tar.bz2 to host 10.10.10.203:/opt/cluster_prepare
10.10.10.202            Copying bundle.tar.bz2 to host 10.10.10.202:/opt/cluster_prepare
10.10.10.201            Copying bundle_data.tar.bz2 to host 10.10.10.201:/opt/cluster_prepare
10.10.10.203            Copying bundle_data.tar.bz2 to host 10.10.10.203:/opt/cluster_prepare
10.10.10.202            Copying bundle_data.tar.bz2 to host 10.10.10.202:/opt/cluster_prepare
10.10.10.201            Installing gcluster.
10.10.10.203            Installing gcluster.
10.10.10.202            Installing gcluster.
10.10.10.201            Installing gcluster.
10.10.10.203            Installing gcluster.
10.10.10.202            Installing gcluster.
10.10.10.201            Installing gcluster.
10.10.10.203            Installing gcluster.
10.10.10.202            Installing gcluster.
10.10.10.201            Installing gcluster.
10.10.10.203            Installing gcluster.
10.10.10.202            Installing gcluster.
10.10.10.201            Installing gcluster.
10.10.10.203            Installing gcluster.
10.10.10.202            Installing gcluster.
10.10.10.201            Installing gcluster.
10.10.10.203            Installing gcluster.
10.10.10.202            Installing gcluster.
10.10.10.201            Installing gcluster.
10.10.10.203            Installing gcluster.
10.10.10.202            Installing gcluster.
10.10.10.201            Installing gcluster.
10.10.10.203            Installing gcluster.
10.10.10.202            Installing gcluster.
10.10.10.201            Installing gcluster.
10.10.10.203            Installing gcluster.
10.10.10.202            Installing gcluster.
10.10.10.201            Installing gcluster.
10.10.10.203            Installing gcluster.
10.10.10.202            Installing gcluster.
10.10.10.201            Installing gcluster.
10.10.10.203            Installing gcluster.
10.10.10.202            Installing gcluster.
10.10.10.201            Installing gcluster.
10.10.10.203            Installing gcluster.
10.10.10.202            Installing gcluster.
10.10.10.201            Installing gcluster.
10.10.10.203            Installing gcluster.
10.10.10.202            Installing gcluster.
10.10.10.201            Installing gcluster.
10.10.10.203            Installing gcluster.
10.10.10.202            Installing gcluster.
10.10.10.201            Installing gcluster.
10.10.10.203            Installing gcluster.
10.10.10.202            Installing gcluster.
10.10.10.201            Installing gcluster.
10.10.10.203            Installing gcluster.
10.10.10.202            Installing gcluster.
10.10.10.201            Installing gcluster.
10.10.10.203            Installing gcluster.
10.10.10.202            Installing gcluster.
10.10.10.201            Installing gcluster.
10.10.10.203            Installing gcluster.
10.10.10.202            Installing gcluster.
10.10.10.201            Installing gcluster.
10.10.10.203            Installing gcluster.
10.10.10.202            Installing gcluster.
10.10.10.201            Installing gcluster.
10.10.10.203            Installing gcluster.
10.10.10.202            Installing gcluster.
10.10.10.201            Installing gcluster.
10.10.10.203            Installing gcluster.
10.10.10.202            Installing gcluster.
10.10.10.201            Installing gcluster.
10.10.10.203            Installing gcluster.
10.10.10.202            Installing gcluster.
10.10.10.201            Installing gcluster.
10.10.10.203            install cluster on host 10.10.10.203 successfully.
10.10.10.202            Installing gcluster.
10.10.10.201            Installing gcluster.
10.10.10.203            install cluster on host 10.10.10.203 successfully.
10.10.10.202            install cluster on host 10.10.10.202 successfully.
10.10.10.201            install cluster on host 10.10.10.201 successfully.
10.10.10.203            install cluster on host 10.10.10.203 successfully.
10.10.10.202            install cluster on host 10.10.10.202 successfully.
Starting all gcluster nodes...
start service failed on host 10.10.10.203.
start service failed on host 10.10.10.202.
start service failed on host 10.10.10.201.
adding new datanodes to gcware...
InstallCluster Successfully.

查看集群情况

[[email protected] opt]# su - gbase
Last login: Tue May 18 00:40:40 CST 2021 from gbase01 on pts/4
[[email protected] ~]$ gcadmin
CLUSTER STATE:         ACTIVE

===============================================================
|            GBASE COORDINATOR CLUSTER INFORMATION            |
===============================================================
|   NodeName   |  IpAddress   | gcware | gcluster | DataState |
---------------------------------------------------------------
| coordinator1 | 10.10.10.201 |  OPEN  |  CLOSE   |     0     |
---------------------------------------------------------------
| coordinator2 | 10.10.10.202 |  OPEN  |  CLOSE   |     0     |
---------------------------------------------------------------
=============================================================
|         GBASE CLUSTER FREE DATA NODE INFORMATION          |
=============================================================
| NodeName  |  IpAddress   | gnode | syncserver | DataState |
-------------------------------------------------------------
| FreeNode1 | 10.10.10.201 | CLOSE |    OPEN    |     0     |
-------------------------------------------------------------
| FreeNode2 | 10.10.10.202 | CLOSE |    OPEN    |     0     |
-------------------------------------------------------------
| FreeNode3 | 10.10.10.203 | CLOSE |    OPEN    |     0     |
-------------------------------------------------------------

0 Virtual cluster
2 coordinator node
3 free data node

检查license

[[email protected] gcinstall]$ ./chkLicense -n 10.10.10.201,10.10.10.202,10.10.10.203 -u gbase -p gbase
======================================================================
10.10.10.201
is_exist:no
======================================================================
10.10.10.203
is_exist:no
======================================================================
10.10.10.202
is_exist:no
[[email protected] gcinstall]$ 

[[email protected] gcinstall]$ ./chkLicense -n 10.10.10.201,10.10.10.202,10.10.10.203 -u gbase -p gbase
======================================================================
10.10.10.201
is_exist:no
======================================================================
10.10.10.203
is_exist:no
======================================================================
10.10.10.202
is_exist:no

获取指纹信息

[[email protected] gcinstall]$ ./gethostsid -n 10.10.10.201,10.10.10.202,10.10.10.203 -u root -p redhat -f /opt/finger.text
======================================================================
Successful node nums:  3
======================================================================

将指纹信息发送给gbase公司,得到license


[[email protected] gcinstall]$ more /opt/finger.text 

[[email protected] gcinstall]$ cd /opt
[[email protected] opt]$ ll
total 140800
-rw-rw-r--  1 gbase gbase       690 May 18 00:48 finger.text
-rwxrwxrwx  1 root  root  140464404 May 15 02:56 GBase8a_MPP_Cluster-License-9.5.2.39-redhat7.3-x86_64.tar.bz2
-rwxrwxrwx  1 root  root    3673603 May 15 02:53 gccli-9.5.2.39-redhat7.3-x86_64.tar.bz2
drwxrwxrwx  2 vhost vhost      4096 May 18 00:42 gcinstall
drwxr-xr-x  6 gbase gbase        61 May 18 00:40 gcluster
drwxr-xr-x 13 gbase gbase       148 May 18 00:40 gcware
drwxrwxr-x  6 gbase gbase        61 May 18 00:40 gnode
-rwxrwxrwx  1 root  root      27849 May 18 00:31 SetSysEnv.py
[[email protected] opt]$ sz finger.text 

导入license信息到三台机器。注意导出是root,导入是gbase

./License  -n 10.10.10.201,10.10.10.202,10.10.10.203 -u gbase -p gbase -f  /opt/20210518.lic

例如:
[[email protected] gcinstall]$ ./License  -n 10.10.10.201,10.10.10.202,10.10.10.203 -u gbase -p gbase -f /home/gbase/20210518-08.lic 
======================================================================
Successful node nums:   3
======================================================================
[[email protected] gcinstall]$ gcadmin
CLUSTER STATE:         ACTIVE

===============================================================
|            GBASE COORDINATOR CLUSTER INFORMATION            |
===============================================================
|   NodeName   |  IpAddress   | gcware | gcluster | DataState |
---------------------------------------------------------------
| coordinator1 | 10.10.10.201 |  OPEN  |   OPEN   |     0     |
---------------------------------------------------------------
| coordinator2 | 10.10.10.202 |  OPEN  |  CLOSE   |     0     |
---------------------------------------------------------------
=============================================================
|         GBASE CLUSTER FREE DATA NODE INFORMATION          |
=============================================================
| NodeName  |  IpAddress   | gnode | syncserver | DataState |
-------------------------------------------------------------
| FreeNode1 | 10.10.10.201 | OPEN  |    OPEN    |     0     |
-------------------------------------------------------------
| FreeNode2 | 10.10.10.202 | CLOSE |    OPEN    |     0     |
-------------------------------------------------------------
| FreeNode3 | 10.10.10.203 | CLOSE |    OPEN    |     0     |
-------------------------------------------------------------

0 Virtual cluster
2 coordinator node
3 free data node

[[email protected] gcinstall]$ gc
gcadmin                  gcc-ar                   gcdump                   gcluster_file_info       gcm-import               gcmonit.sh               gconftool-2              gcrecover                gc_sync_server
gcadmin_tar_codi_tbl.sh  gccli                    gcexp                    gcluster_services        gcm-inspect              gcm-picker               gcore                    gcr-viewer               gcware
gcalccmd                 gcc-nm                   gcimp                    gcluster_sql_statistics  gcmmonit                 gcm-viewer               gcov                     gc_sync_client           gcwexec
gcc                      gcc-ranlib               gclusterd                gcm-calibrate            gcmonit                  gconf-merge-tree         gcrcman.py               gc_syncpacklog.sh        

[[email protected] gcinstall]$ gcluster_services all start
Starting gcware :                                          [  OK  ]
Starting gcluster :                                        [  OK  ]
Starting gcrecover :                                       [  OK  ]
Starting gbase :                                           [  OK  ]
Starting syncserver :                                      [  OK  ]
Starting GCMonit success!

[[email protected] ~]$ gcluster_services all start
Starting gcware :                                          [  OK  ]
Starting gcluster :                                        [  OK  ]
Starting gcrecover :                                       [  OK  ]
Starting gbase :                                           [  OK  ]
Starting syncserver :                                      [  OK  ]
Starting GCMonit success!
[[email protected] ~]$ 

Last login: Tue May 18 10:53:50 CST 2021 from gbase01 on pts/0
[[email protected] ~]$ gcluster_services all start
Starting gbase :                                           [  OK  ]
Starting syncserver :                                      [  OK  ]
Starting GCMonit success!
[[email protected] ~]$ 

再次核查下license是否存在

[[email protected] gcinstall]$ ./chkLicense -n 10.10.10.201,10.10.10.202,10.10.10.203 -u gbase -p gbase

[[email protected] gcinstall]$  ./chkLicense -n 10.10.10.201,10.10.10.202,10.10.10.203 -u gbase -p gbase
======================================================================
10.10.10.201
is_exist:yes
version:trial
expire_time:20210818
is_valid:yes
======================================================================
10.10.10.203
is_exist:yes
version:trial
expire_time:20210818
is_valid:yes
======================================================================
10.10.10.202
is_exist:yes
version:trial
expire_time:20210818
is_valid:yes

三个节点重启下集群服务

gcluster_services all restart

生成distribution表

gcadmin distribution gcChangeInfo.xml  p 2 d 1 pattern 1

[[email protected] gcinstall]$ gcadmin distribution gcChangeInfo.xml  p 2 d 1 pattern 1
gcadmin generate distribution ...

NOTE: node [10.10.10.201] is coordinator node, it shall be data node too
NOTE: node [10.10.10.202] is coordinator node, it shall be data node too
gcadmin generate distribution successful

然后查看gcadmin

gcadmin showdistribution node

[[email protected] gcinstall]$ gcadmin showdistribution node
                                      Distribution ID: 1 | State: new | Total segment num: 6

====================================================================================================================================
|  nodes   |             10.10.10.201              |             10.10.10.202              |             10.10.10.203              |
------------------------------------------------------------------------------------------------------------------------------------
| primary  |                  1                    |                  2                    |                  3                    |
| segments |                  4                    |                  5                    |                  6                    |
------------------------------------------------------------------------------------------------------------------------------------
|duplicate |                  3                    |                  1                    |                  2                    |
|segments 1|                  5                    |                  6                    |                  4                    |
====================================================================================================================================
[[email protected] gcinstall]$ 

启动分布表

gccli -u root -p
也可以
gccli

登录进入以后在命令行输入

show databases;
create database test;
没有初始化,无法操作。
initnodedatamap;  --初始化
create database test;

例如:

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

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

gbase> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| performance_schema |
| gbase              |
| gctmpdb            |
+--------------------+
4 rows in set (Elapsed: 00:00:00.02)

gbase> create database test;
ERROR 1707 (HY000): gcluster command error: (GBA-02CO-0003) nodedatamap is not initialized.
gbase> initnodedatamap
    -> ;
Query OK, 0 rows affected (Elapsed: 00:00:00.63)

gbase> create database test;
Query OK, 1 row affected (Elapsed: 00:00:00.02)

gbase> 

扫码领视频副本.gif

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号