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
[root@node015 home]# cd gcinstall/
[root@node015 gcinstall]# ls
authkey.demo
auto_add_sg.py
auto_install.sh
bundle.tar.gz
c3_conf.sh
commandLineCtrl.py
[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 =
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
[root@node015 gcinstall]# pwd
/home/gcinstall
[root@node015 gcinstall]# ls
authkey.demo
auto_add_sg.py
auto_install.sh
bundle.tar.gz
c3_conf.sh
commandLineCtrl.py
[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 a while)....
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.
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
Setting /etc/security/limits.conf nproc
Setting /etc/security/limits.conf nproc
Setting /etc/security/limits.conf nproc
Installing/Repairing SSH keys for gbase
Creating GBase Data Directory...
Testing N-way network test.
Host availability
Running Consistency Tests
Running Network Connectivity and Throughput Tests...
Waiting for 1 of 4 sites...
=========================
=====================
Install on all nodes...
Install on all nodes...
Error Monitor
Installation completed with warnings.
[root@node015 gcinstall]#
添加safegroup
su - gbsae
gcadmin addsg --nodes 192.168.98.165, 192.168.98.166 --names node1, 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:
dpname value:
nodename value: [node1]
Address:
dpname value:
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:
dpname value:
nodename value: [node3]
Address:
dpname value:
nodename value: [node4]
safegroup name: [sg02]
init new safegroup node,there may be consume some time,please wait a moment...
init the 192.168.98.167 node environment from source node 192.168.98.165...
Warning: Permanently added '192.168.98.167' (RSA) to the list of known hosts.
Init server ok!
Warning: Permanently added '192.168.98.167' (RSA) to the list of known hosts.
init the 192.168.98.168 node environment from source node 192.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 of known hosts.
Warning: Permanently added '192.168.98.168' (RSA) to the list of known hosts.
[addsafegroup] Add SafeGroup Complete.
[gbase@node015 ~]$
[gbase@node015 ~]$ gcadmin
[gbase@node015 ~]$
[gbase@node015 ~]$ gccli -ugbase -pgbase20110531 -h127.0.0.1 -P5258
Welcome to the GBase monitor.
Your gcluster connection id is 6
Server version: 8.5.1.2
Type 'help;' or '\h' for help. Type '\c' to clear the current input 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) ,olds numeric(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) ,olds numeric(8));
Query OK, 0 rows affected (Elapsed: 00:00:04.02)
5258端口连接的是8a
5050端口连接的是8a node(在各节点创建的对象属于本地对象,不属于全局对象)
[gbase@node017 ~]$
Welcome to the GBase monitor.
Your gcluster connection id is 6
Server version: 8.5.1.2
Type 'help;' or '\h' for help. Type '\c' to clear the current input 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)