mkdir -p /data/seg1/pg_pri_cdr
mkdir -p /data/seg2/pg_pri_cdr
mkdir -p /data/seg1/pg_mir_cdr
mkdir -p /data/seg2/pg_mir_cdr
以上内容每台节点都需要执行
主实例建如下目录
mkdir -p /data/master/pg_master_cdr
执行命令
$ gpfilespace -o .
根据提示
Enter a name for this filespace
> fastdisk
Checking your configuration:
Your system has 2 hosts with 2 primary and 2 mirror segments per host.
Configuring hosts: [sdw1, sdw2]
Please specify 2 locations for the primary segments, one per line:
primary location 1> /data/seg1/pg_pri_cdr
primary location 2> /data/seg2/pg_pri_cdr
Please specify 2 locations for the mirror segments, one per line:
mirror location 1> /data/seg1/pg_mir_cdr
mirror location 2> /data/seg2/pg_mir_cdr
Enter a file system location for the master:
master location> /data/master/pg_master_cdr
Example filespace configuration file:
filespace:fastdisk
mdw:1:/gp_master_filespc/gp-1
sdw1:2:/gp_pri_filespc/gp0
sdw1:3:/gp_mir_filespc/gp1
sdw2:4:/gp_mir_filespc/gp0
sdw2:5:/gp_pri_filespc/gp1
Execute the configuration file to create the filespace in Greenplum Database:
$ gpfilespace -c gpfilespace_config_1
在SQL窗口执行如下SQL创建表空间
CREATE TABLESPACE mytablespace OWNER gpadmin
FILESPACE fastdisk