0

We have small gpdb cluster. When i am trying to create New user based Filespace. that is Calling gpfilespace utility

$gpfilespace -o gpfilespace_config

Getting following error at prompt:At the time of creation of filespace .

[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

I have tried different ways but user file space is not creating.

Any help on it would be much appreciated ?

4

1 回答 1

1

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

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

在这个单节点示例中,主节点和段在 /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
于 2016-06-15T21:15:57.733 回答