Vertica增加一个数据存储的目录
2015-06-03 21:05 AlfredZhao 阅读(1558) 评论(0) 编辑 收藏 举报Vertica增加一个数据存储的目录
操作语法为:
ADD_LOCATION ( 'path' , [ 'node' , 'usage', 'location_label' ] )
1. 各节点添加目录,并赋予正确的权限
比如新增/verticadata2挂节点,需求为在/verticadata2挂节点下新增目录vertica,用于Vertica的数据目录。 各节点执行 `mkdir -p /verticadata2/vertica;chown -R dbadmin:verticadba /verticadata2/vertica;ls -lh /verticadata2` 实现创建目录,赋权,检查是否正确。实操过程记录:
[root@vertica1 ~]# mkdir -p /verticadata2/vertica;chown -R dbadmin:verticadba /verticadata2/vertica;ls -lh /verticadata2
总用量 20K
drwx------ 2 root root 16K 6月 3 10:08 lost+found
drwxr-xr-x 2 dbadmin verticadba 4.0K 6月 3 10:40 vertica
[root@vertica1 ~]# ssh vertica2
root@vertica2's password:
Last login: Wed Jun 3 10:36:38 2015 from vertica1
[root@vertica2 ~]# mkdir -p /verticadata2/vertica;chown -R dbadmin:verticadba /verticadata2/vertica;ls -lh /verticadata2
总用量 20K
drwx------ 2 root root 16K 6月 3 10:14 lost+found
drwxr-xr-x 2 dbadmin verticadba 4.0K 6月 3 10:41 vertica
[root@vertica2 ~]# ssh vertica3
root@vertica3's password:
Last login: Wed Jun 3 10:37:01 2015 from vertica2
[root@vertica3 ~]# mkdir -p /verticadata2/vertica;chown -R dbadmin:verticadba /verticadata2/vertica;ls -lh /verticadata2
总用量 20K
drwx------ 2 root root 16K 6月 3 09:58 lost+found
drwxr-xr-x 2 dbadmin verticadba 4.0K 6月 3 10:41 vertica
[root@vertica3 ~]# exit
logout
Connection to vertica3 closed.
[root@vertica2 ~]# exit
logout
Connection to vertica2 closed.
[root@vertica1 ~]#
2. vsql命令行下添加对应的目录
查询节点名称: `select node_name from nodes;` 在节点1执行下面的添加目录命令即可。 ``` SELECT ADD_LOCATION('/verticadata2/vertica/','v_testdb_node0001','DATA'); SELECT ADD_LOCATION('/verticadata2/vertica/','v_testdb_node0002','DATA'); SELECT ADD_LOCATION('/verticadata2/vertica/','v_testdb_node0003','DATA'); ```实操过程记录:
[root@vertica1 ~]# su - dbadmin
[dbadmin@vertica1 ~]$ vsql
Password:
Welcome to vsql, the Vertica Analytic Database interactive terminal.
Type: \h or \? for help with vsql commands
\g or terminate with semicolon to execute query
\q to quit
dbadmin=> select node_name from nodes;
node_name
-------------------
v_testdb_node0001
v_testdb_node0002
v_testdb_node0003
(3 rows)
dbadmin=> SELECT ADD_LOCATION('/verticadata2/vertica/','v_testdb_node0001','DATA');
SELECT ADD_LOCATION('/verticadata2/vertica/','v_testdb_node0002','DATA');
SELECT ADD_LOCATION('/verticadata2/vertica/','v_testdb_node0003','DATA');
ADD_LOCATION
------------------------------
/verticadata2/vertica added.
(1 row)
dbadmin=> SELECT ADD_LOCATION('/verticadata2/vertica/','v_testdb_node0002','DATA');
ADD_LOCATION
------------------------------
/verticadata2/vertica added.
(1 row)
dbadmin=> SELECT ADD_LOCATION('/verticadata2/vertica/','v_testdb_node0003','DATA');
ADD_LOCATION
------------------------------
/verticadata2/vertica added.
(1 row)
dbadmin=>
3. 查询验证
`select * from storage_locations;`
AlfredZhao©版权所有「从Oracle起航,领略精彩的IT技术。」