When attempting to run gpexpand to add a new segment servers, you seeing the following error:
gpadmin@cdw$ gpexpand -i gpexpand_input_file 20210722:12:45:17:094154 gpexpand:cdw:gpadmin-[INFO]:-local Greenplum Version: 'postgres (Greenplum Database) 6.7.0 build commit:2fbc274bc15a19b5de3c6e44ad5073464cd4f47b' 20210722:12:45:17:094154 gpexpand:cdw:gpadmin-[INFO]:-master Greenplum Version: 'PostgreSQL 9.4.24 (Greenplum Database 6.7.0 build commit:2fbc274bc15a19b5de3c6e44ad5073464cd4f47b) on x86_64-unknown-linux-gnu, compiled by gcc (GCC) 6.4.0, 64-bit compiled on Apr 16 2020 02:24:06' 20210722:12:45:17:094154 gpexpand:cdw:gpadmin-[INFO]:-Querying gpexpand schema for current expansion state 20210722:12:45:19:094154 gpexpand:cdw:gpadmin-[INFO]:-Heap checksum setting consistent across cluster 20210722:12:45:19:094154 gpexpand:cdw:gpadmin-[INFO]:-Syncing Greenplum Database extensions 20210722:12:45:19:094154 gpexpand:cdw:gpadmin-[INFO]:-The packages on gplss-kn-p1 are consistent. 20210722:12:45:20:094154 gpexpand:cdw:gpadmin-[INFO]:-The packages on gplss-kn-p3 are consistent. 20210722:12:45:20:094154 gpexpand:cdw:gpadmin-[INFO]:-The packages on gplss-kn-p2 are consistent. 20210722:12:45:21:094154 gpexpand:cdw:gpadmin-[INFO]:-Locking catalog 20210722:12:45:21:094154 gpexpand:cdw:gpadmin-[INFO]:-Locked catalog 20210722:12:45:21:094154 gpexpand:cdw:gpadmin-[ERROR]:-gpexpand failed: [Errno 2] No such file or directory: 'gpexpand_input_file.ts'
This error occurs when the user manually created the "gpexpand_input_file", however the environment contained user defined tablespaces.
postgres=# select oid, * from pg_tablespace ; oid | spcname | spcowner | spcacl | spcoptions --------+------------+----------+--------+------------ 1663 | pg_default | 10 | | 1664 | pg_global | 10 | | 134826 | temp_space | 10 | | (3 rows)
As a result, a .ts file "gpexpand_input_file.ts" is also needed with the "gpexpand_input_file" for gpexpand to run successfully.
It is recommended to create the configuration files by running "gpexpand" without options. This will ask questions regarding how the cluster is to be expanded and will create the required configuration files.
Manually create the .ts file with the format: There may be more than one user defined tablespaces.
tableSpaceNameOrders=<tablespace_name>[|<tablespace_name>...] tableSpaceOidOrders=<tablespace_oid>[|<tablespace_oid>...] <dbid>|<tablespace_directory>[|<tablespace_directory>...]
For the example above:
tableSpaceNameOrders=temp_space tableSpaceOidOrders=134826 196|/data13/temp_tablespace 197|/data13/temp_tablespace 198|/data13/temp_tablespace 199|/data13/temp_tablespace 200|/data13/temp_tablespace 201|/data13/temp_tablespace
Example of multiple tablespaces:
tableSpaceNameOrders=temp_space|user_space tableSpaceOidOrders=134826|143926 196|/data13/temp_tablespace|/data14/user_tablespace 197|/data13/temp_tablespace|/data14/user_tablespace 198|/data13/temp_tablespace|/data14/user_tablespace 199|/data13/temp_tablespace|/data14/user_tablespace 200|/data13/temp_tablespace|/data14/user_tablespace 201|/data13/temp_tablespace|/data14/user_tablespace