gbase8a  4节点安装配置过程

来源:互联网 发布:电影台词拼接软件 编辑:程序博客网 时间:2024/06/08 04:30

192.168.98.165
192.168.98.166
192.168.98.167
192.168.98.168


配置主机名
禁用selinux
禁用防火墙
重启 

 

[root@node015 ~]# cd /home
[root@node015 home]# ls
gbase GBase8a_MPP_Cluster-8.5.1.2-build5.1-utf8-redhat6.2-x86_64.tar.gz gcinstall  storm  upload
[root@node015 home]# cd gcinstall/
[root@node015 gcinstall]# ls
authkey.demo       DBDCluster.py   DBname.pyc       gcinstall.py        netverify.py  sshtrust_conf.sh
auto_add_sg.py     DBfunctions.py  demo.options     gcluster.xml        netverify.pyc  SystemProfileFactory.py
auto_install.sh    DBfunctions.pyc designerTests.py gen_demo_options.py pexpect.py    SystemProfileFactory.pyc
bundle.tar.gz      DBinclude.py    Diagnostics.py   install_config      pexpect.pyc   TXTlcheck.py
c3_conf.sh         DBinclude.pyc   ErrorMonitor.py  log                 SSH.py        unInstall.py
commandLineCtrl.py DBname.py       ErrorMonitor.pyc LogRotate.py        SSH.pyc       unInstall.sh
[root@node015 gcinstall]# vi demo.options

authkey_file_name = authkey.demo
gcluster_dba_group = gbase
#gcluster_dba_group_id = 1234
gcluster_dba_user = gbase
#gcluster_dba_user_id = 1234
gcluster_dba_user_password = gbase
hosts = 192.168.98.165,192.168.98.166,192.168.98.167,192.168.98.168
mcast_addr = 226.94.1.39
mcast_port = 5493
root_password = jianguo123
source = 192.168.98.165
skip_network_test = false~
~
~
~
"demo.options" 12L, 369C written
[root@node015 gcinstall]# ps -ef|grep gbase
root     3207  3185  0 14:14pts/6   00:00:00 grep gbase
[root@node015 gcinstall]# pwd
/home/gcinstall
[root@node015 gcinstall]# ls
authkey.demo       DBDCluster.py   DBname.pyc       gcinstall.py        netverify.py  sshtrust_conf.sh
auto_add_sg.py     DBfunctions.py  demo.options     gcluster.xml        netverify.pyc  SystemProfileFactory.py
auto_install.sh    DBfunctions.pyc designerTests.py gen_demo_options.py pexpect.py    SystemProfileFactory.pyc
bundle.tar.gz      DBinclude.py    Diagnostics.py   install_config      pexpect.pyc   TXTlcheck.py
c3_conf.sh         DBinclude.pyc   ErrorMonitor.py  log                 SSH.py        unInstall.py
commandLineCtrl.py DBname.py       ErrorMonitor.pyc LogRotate.py        SSH.pyc       unInstall.sh
[root@node015 gcinstall]# pwd
/home/gcinstall
[root@node015 gcinstall]# ./gcinstall.py--silent=demo.options
GBase Database 8.5.1.2 Installation Tool

Starting installation tasks...

Getting system information for cluster (this may take awhile)....

Begin Installation
['192.168.98.165', '192.168.98.166', '192.168.98.167','192.168.98.168']
Very first check on all nodes:
Checking/fixing OS parameters.....

Detected cpufreq module loaded on 192.168.98.168
Detected cpufreq module loaded on 192.168.98.165
Detected cpufreq module loaded on 192.168.98.167
Detected cpufreq module loaded on 192.168.98.166
CPU frequency scaling is enabled.  This mayadversely affect the performance of your database.
GBase recommends that cpu frequency scaling be turned off or set to'performance'


Creating/Checking GBase DBA group

Creating/Checking GBase DBA user

Setting /etc/security/limits.conf nproc  to7855 ...
Setting /etc/security/limits.conf nproc  to 7855...
Setting /etc/security/limits.conf nproc  to 7855...
Setting /etc/security/limits.conf nproc  to 7855...
Installing/Repairing SSH keys for gbase

Creating GBase Data Directory...

Testing N-way network test.  (this may take awhile)
 All hosts areavailable                           ... 
Hostavailability                                 ...
 IPconfiguration                                  ... 
 IPconfiguration                                  ... 
 IPconfiguration                                  ... 
 IPconfiguration                                  ... 


Running Consistency Tests
 LANG and TZ environmentvariables                 ... 
Running Network Connectivity and Throughput Tests...
Waiting for 1 of 4sites...                        ... 

  Consistency Test (ok) 
=========================

  Info: The $TZ environment variable is not seton  192.168.98.165
  Info: The $TZ environment variable is not seton  192.168.98.166
  Info: The $TZ environment variable is not seton  192.168.98.167
  Info: The $TZ environment variable is not seton  192.168.98.168

  Network Test (ok) 
=====================

    Networkcommunication (ok) 
  ------------------------------
    Lowthroughput 192.168.98.165 to 192.168.98.165: 31.4338126942 Mbps;check network interface/switch configuration
    Lowthroughput 192.168.98.166 to 192.168.98.166: 31.8648917117 Mbps;check network interface/switch configuration
    Lowthroughput 192.168.98.167 to 192.168.98.167: 31.7004921194 Mbps;check network interface/switch configuration
 

Install on all nodes...
Install on all nodes...

 

Error Monitor  0 errors  1warnings
Installation completed with warnings. 
[root@node015 gcinstall]#

 

添加safegroup
su - gbsae

gcadmin addsg --nodes 192.168.98.165, 192.168.98.166 --namesnode1, node2
gcadmin addsg --nodes 192.168.98.167, 192.168.98.168 --names node3,node4


[gbase@node015 ~]$ gcadmin addsg --nodes 192.168.98.165,192.168.98.166 --names node1, node2
Address:       [192.168.98.165] <--> Node id : [2774706368]
dpname value:   [n1].
nodename value: [node1]
Address:       [192.168.98.166] <--> Node id : [2791483584]
dpname value:   [n2].
nodename value: [node2]
safegroup name: [sg01]

[addsafegroup] Add SafeGroup Complete.


[gbase@node015 ~]$ gcadmin addsg --nodes 192.168.98.167,192.168.98.168 --names node3, node4
Address:       [192.168.98.167] <--> Node id : [2808260800]
dpname value:   [n3]
nodename value: [node3]
Address:       [192.168.98.168] <--> Node id : [2825038016]
dpname value:   [n4]
nodename value: [node4]
safegroup name: [sg02]

init new safegroup node,there may be consume some time,pleasewait a moment...
init the 192.168.98.167 node environment from source node192.168.98.165...
Warning: Permanently added '192.168.98.167' (RSA) to the list ofknown hosts.
 
Init server ok!
Warning: Permanently added '192.168.98.167' (RSA) to the list ofknown hosts.
init the 192.168.98.168 node environment from source node192.168.98.167...
/usr/bin/gc_sync_cpnode.py 192.168.98.167 192.168.98.165
Warning: Permanently added '192.168.98.168' (RSA) to the list ofknown hosts.
 
Warning: Permanently added '192.168.98.168' (RSA) to the list ofknown hosts.
[addsafegroup] Add SafeGroup Complete.

[gbase@node015 ~]$


[gbase@node015 ~]$ gcadmin

  CLUSTER STATE: ACTIVED
  CLUSTERMODE:   NORMAL

 =========================================================================================================================
                                                 GCLUSTERINFORMATION                                                  |
 =========================================================================================================================
  ------- ---------- ---------------- ---------------- --------- --------- ---------- ------------ ----------------------
 | rowid | nodename|   IpAddress   | sgname | dpname |gcware gnode  | gcluster | syncserver | datastate |nodestate |
  ------- ---------- ---------------- ---------------- --------- --------- ---------- ------------ ----------------------
     node1  |192.168.98.165 |  sg01  n1   | Online  OPEN   OPEN    OPEN   [0]     [0]     |
  ------- ---------- ---------------- ---------------- --------- --------- ---------- ------------ ----------------------
     node2  |192.168.98.166 |  sg01  n2   | Online  OPEN   OPEN    OPEN   [0]     [0]     |
  ------- ---------- ---------------- ---------------- --------- --------- ---------- ------------ ----------------------
     node3  |192.168.98.167 |  sg02  n3   | Online  OPEN   OPEN    OPEN   [0]     [0]     |
  ------- ---------- ---------------- ---------------- --------- --------- ---------- ------------ ----------------------
     node4  |192.168.98.168 |  sg02  n4   | Online  OPEN   OPEN    OPEN   [0]     [0]     |
  ------- ---------- ---------------- ---------------- --------- --------- ---------- ------------ ----------------------
[gbase@node015 ~]$

[gbase@node015 ~]$ gccli -ugbase -pgbase20110531 -h127.0.0.1-P5258
Welcome to the GBase monitor.  Commands end with ;or \g.
Your gcluster connection id is 6
Server version: 8.5.1.2

Type 'help;' or '\h' for help. Type '\c' to clear the currentinput statement.

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

gbase>
初始化数据库

gbase> initnodedatamap;
Query OK, 0 rows affected (Elapsed: 00:00:07.09)

创建数据库

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

重新连接数据库,创建表

base> create table ljg (name varchar(10) ,oldsnumeric(8));
ERROR 1046 (3D000): No database selected
gbase> show databases;
--------------------
|Database          |
--------------------
| information_schema |
|cup               |
|gbase             |
|gclusterdb        |
|gctmpdb           |
--------------------
5 rows in set (Elapsed: 00:00:00.00)

gbase> use cup
    ->;
Query OK, 0 rows affected (Elapsed: 00:00:00.01)

gbase> create table ljg (name varchar(10) ,oldsnumeric(8));
Query OK, 0 rows affected (Elapsed: 00:00:04.02)

 


5258端口连接的是8a

5050端口连接的是8a node(在各节点创建的对象属于本地对象,不属于全局对象)
[gbase@node017 ~]$  gccli -ugbase -pgbase20110531-h127.0.0.1 -P 5050
Welcome to the GBase monitor.  Commands end with ;or \g.
Your gcluster connection id is 6
Server version: 8.5.1.2

Type 'help;' or '\h' for help. Type '\c' to clear the currentinput statement.

gbase> show databases;
--------------------
|Database          |
--------------------
| information_schema |
|cup               |
|gbase             |
|gclusterdb        |
|gctmpdb           |
--------------------
5 rows in set (Elapsed: 00:00:00.00)

gbase> use cup
    ->;
Query OK, 0 rows affected (Elapsed: 00:00:00.00)

gbase> desc ljg;
ERROR 1146 (42S02): Table 'cup.ljg' doesn't exist
gbase> select * from dual;
ERROR 1096 (HY000): No tables used
gbase>


显示当前连接的是哪个数据库
gbase> select database();
------------
| database() |
------------
|cup       |
------------
1 row in set (Elapsed: 00:00:00.00)

 

0 1