Prompt:How 错误 我是否在 GPDB 中创建新的基于用户的文件空间

Error at Prompt:How Do I create New user based Filespace in GPDB

我们有小型 gpdb 集群。当我尝试创建基于新用户的文件 space 时。 那是 调用 gpfilespace 实用程序

$gpfilespace -o gpfilespace_config

在创建文件prompt:At时出现以下错误space。

[gpadmin@mdw dfs]$ gpfilespace -o gpfilespace_config
20160615:15:17:07:027941 gpfilespace:mdw:gpadmin-[INFO]:-
A tablespace requires a file system location to store its database
files. A filespace is a collection of file system locations for all components
in a Greenplum system (primary segment, mirror segment and master instances).
Once a filespace is created, it can be used by one or more tablespaces.

20160615:15:17:07:027941 gpfilespace:mdw:gpadmin-[INFO]:-getting config
Enter a name for this filespace
> dfs_system

Checking your configuration:
Your system has 2 hosts with 1 primary and 1 mirror segments per host.
Your system has 2 hosts with 0 primary and 0 mirror segments per host.

Configuring hosts: [datanode1, datanode2]

Please specify 1 locations for the primary segments, one per line:
primary location 1> /data/primary/dfs/gpseg1
[Error]datanode2: /data/primary/dfs/gpseg1 : No such file or directory

我尝试了不同的方法,但用户文件 space 没有创建。

如有任何帮助,我们将不胜感激?

这个例子是我很久以前发给一个使用单节点虚拟机的客户的例子。

gpadmin$ mkdir /user
gpadmin$ cd data
gpadmin$ gpfilespace -o .
[INFO]:-
A tablespace requires a file system location to store its database
files. A filespace is a collection of file system locations for all components
in a Greenplum system (primary segment, mirror segment and master instances).
Once a filespace is created, it can be used by one or more tablespaces.

[INFO]:-getting config
Enter a name for this filespace
> userspace

Checking your configuration:
Your system has 1 hosts with 2 primary and 0 mirror segments per host.

Configuring hosts: [jonnymac]

Please specify 2 locations for the primary segments, one per line:
primary location 1> /user
primary location 2> /user

Enter a file system location for the master
master location> /user
gpfilespace:jonnymac:gpadmin-[INFO]:-Creating configuration file...
gpfilespace:jonnymac:gpadmin-[INFO]:-[created]
gpfilespace:jonnymac:gpadmin-[INFO]:-

gpadmin$ gpfilespace --config ./gpfilespace_config_xxxxxxxx_xxxxxx
[INFO]:-
A tablespace requires a file system location to store its database files. A 
filespace is a collection of file system locations for all components
in a Greenplum system (primary segment, mirror segment and master instances).
Once a filespace is created, it can be used by one or more tablespaces.

[INFO]:-getting config
[INFO]:-Connecting to database
[INFO]:-Filespace "userspace" successfully created

在这个单节点示例中,master 和 segments 在 /user 中。 gpseg-1 是主机,gpseg[0-1] 是段。你可以在这里看到:

gpadmin$ cd /user
gpadmin$ ls -la
total 0
drwxr-xr-x   5 gpadmin  admin   170 Oct 11 10:29 .
drwxrwxr-t  33 root     admin  1190 Oct 11 10:20 ..
drwx------   2 gpadmin  admin    68 Oct 11 10:29 gpseg-1
drwx------   2 gpadmin  admin    68 Oct 11 10:29 gpseg0
drwx------   2 gpadmin  admin    68 Oct 11 10:29 gpseg1
gpadmin$ psql
psql (8.2.15)
Type "help" for help.

现在您可以创建一个使用该文件空间的表空间。

gpdb=# create tablespace usertablespace filespace userspace;
CREATE TABLESPACE
gpdb=# select * from pg_tablespace;
spcname     | spcowner | spclocation | spcacl | spcprilocations | spcmirlocations | spcfsoid
----------------+----------+-------------+--------+-----------------+-----------------+----------
pg_default     |       10 |             |        |                 |                 |     3052
pg_global      |       10 |             |        |                 |                 |     3052
usertablespace |       10 |             |        |                 |                 |   271611
(3 rows)

gpdb=# \q