vertica数据库增加/删除节点

标签:
it原创 |
分类: Vertica |
一.增加节点
新加入集群的服务器node3,其IP如下:10.10.10.103 & 192.168.100.103
到/etc/hosts里。(在该例子里10.10.10.X 是vertica的对外服务IP,192.168.100.X
为数据库的私有通信IP),修改后如下所示
[root@node1 sbin]# more /etc/hosts
127.0.0.1 localhost localhost.localdomain
localhost4 localhost4.localdomain4
::1
localhost localhost.localdomain localhost6
localhost6.localdomain6
10.10.10.101
node1
10.10.10.102
node2
10.10.10.103
node3
192.168.100.101
node1-priv
192.168.100.102
node2-priv
192.168.100.103
node3-priv
其中 -A
表示要增加的节点,这里可以是IP,也可以是/etc/hosts 文件里定义的hostname
这里有一点要注意,该脚本会自动在新节点上创建dbadmin用户和dbadmingroup,在执行阶段需要我们数据该用户的密码。
[root@node1 tmp]# /opt/vertica/sbin/update_vertica -A
192.168.100.103 -r
/tmp/vertica-6.1.1-0.x86_64.RHEL5.rpm -p dbadmin
Vertica Analytic Database 6.1.1-0 Installation Tool
Starting installation tasks...
Getting system information for cluster (this may take a
while)....
backing up admintools.conf on
192.168.100.102
backing up admintools.conf on
192.168.100.101
Installing rpm on 1 hosts....
installing node.... 192.168.100.103
NTP service not synchronized on the hosts:
['192.168.100.103']
Check your NTP configuration for valid NTP servers.
Vertica recommends that you keep the system clock synchronized
using
NTP or some other time synchronization mechanism to keep all
hosts
synchronized. Time variances can cause (inconsistent) query
results
when using Date/Time Functions. For instructions, see:
Info: the package 'pstack' is useful during troubleshooting.
Vertica recommends this package is
installed.
Checking/fixing OS parameters.....
Setting vm.min_free_kbytes to 4096 ...
Detected cpufreq module loaded on 192.168.100.102
Detected cpufreq module loaded on 192.168.100.103
Detected cpufreq module loaded on 192.168.100.101
CPU frequency scaling is enabled. This may
adversely affect the performance of your database.
Vertica recommends that cpu frequency scaling be turned off or
set to 'performance'
Creating/Checking Vertica DBA group
Creating/Checking Vertica DBA user
Installing/Repairing SSH keys for dbadmin
Password:
Modifying existing Vertica DBA user
Creating Vertica Data Directory...
Testing N-way network test. (this may take a
while)
Verifying system requirements on cluster.
Running Consistency Tests
Running Network Connectivity and Throughput Tests...
Waiting for 1 of 3 sites...
...
=========================
=====================
Updating spread configuration...
Verifying spread is running on old cluster
Signaling spread to reload configuration
Verifying new spread configuration on the existing
cluster
Verifying spread configuration on whole cluster.
Creating node node0003 definition for host
192.168.100.103
... Done
Error Monitor 0 errors 3
warnings
Installation completed with warnings.
Installation complete.
To create a database:
1. Logout and login as dbadmin.**
2. Run /opt/vertica/bin/adminTools as dbadmin
3. Select Create Database from the Configuration Menu
** The installation modified the group privileges for
dbadmin.
To add or remove hosts, select Cluster Management from the
Advanced Menu
3.在新增节点node3上创建数据存放文件夹,并把数据文件夹的own改为dbadmin(在这里vertica数据库的catalog
和datafile统一都存放在每个节点的/dta/vertica下面)
total 20
drwx------ 2 dbadmin verticadba 16384 Mar 26
2013 lost+found
drwxrwxr-x 4 root root
4096 Dec Advanced Tools Menu21 20:37
vertica
[root@node3 data]# chown -R dbadmin:dbadmin vertica
[root@node3 data]# ll
total 20
drwx------ 2 dbadmin verticadba 16384 Mar 26
2013 lost+found
drwxrwxr-x 4 dbadmin dbadmin
4096 Dec 21 20:37 vertica
4.以dbadmin用户登陆node1执行adminools命令,进入图形界面
确认信息,点击Yes
输入数据库超级用户dbadmin的密码
5.安装完毕后我们来检测下
[dbadmin@node1 ~]$ vsql
Password:
Welcome to vsql, the Vertica Analytic Database interactive
terminal.
Type: \h or \? for help with vsql
commands
dbadmin=> select * from nodes;
----------------------+-------------------+------------+-----------------+-----------------+----------------------------------------------------------------------+--------------
(3 rows)
可以看出node3节点已经成功加入数据库
二 删除节点
1.把节点从数据库里移除
2.把节点从集群里移除