After installing the client package "greenplum-db-clients-6.7.0-rhel7-x86_64.rpm" on an external Centos system, you run into the error "cannot find greenplum environment file: environment misconfigured" when trying to load to a Greenplum Database (GPDB) 6.x environment.
root@vmtools ~]# ll /usr/local/greenplum-db-clients/*sh -rwxr-xr-x. 1 root root 1124 21 avril 11:06 /usr/local/greenplum-db-clients/greenplum_clients_path.sh [root@vmtools ~]# gpload -d demo -h 192.168.114.158 -f /tmp/gpload/gpload_simple.conf -U gpadmin -bash: gpload : commande introuvable [root@vmtools ~]# source /usr/local/greenplum-db-clients/greenplum_clients_path.sh [root@vmtools ~]# gpload -d demo -h 192.168.114.158 -f /tmp/gpload/gpload_simple.conf -U gpadmin 2020-04-21 12:02:59|INFO|gpload session started 2020-04-21 12:02:59 2020-04-21 12:02:59|INFO|setting schema 'public' for table 'test_gpload' 2020-04-21 12:02:59|ERROR|cannot find greenplum environment file: environment misconfigured 2020-04-21 12:02:59|INFO|rows Inserted = 0 2020-04-21 12:02:59|INFO|rows Updated = 0 2020-04-21 12:02:59|INFO|data formatting errors = 0 2020-04-21 12:02:59|INFO|gpload failed
Product Version: 6.4
This issue occurs because gpload calls the shell script "greenplum_loaders_path.sh", but this script doesn't exist and there is only the "greenplum_clients_path.sh" script available:
[root@gpdb-sandbox greenplum-db-clients]# ll /usr/local/greenplum-db- clients/*.sh -rwxr-xr-x 1 gpadmin gpadmin 1124 20 avril 18:59 /usr/local/greenplum-db-clients/greenplum_clients_path.sh
1. Create the file greenplum_loaders_path.sh by duplicating the file greenplum_clients_path.sh:
[root@vmtools ~]# cp /usr/local/greenplum-db-clients/greenplum_clients_path.sh /usr/local/greenplum-db-clients/greenplum_loaders_path.sh
2. In the .bashrc of your user on the source Centos host, add the lines below (or run manually these two commands before running gpload):
source /usr/local/greenplum-db-clients/greenplum_clients_path.sh export GPHOME_LOADERS=$GPHOME_CLIENTS
See the result below:
[root@vmtools ~]# source /usr/local/greenplum-db-clients/greenplum_clients_path.sh [root@vmtools ~]# export GPHOME_LOADERS=$GPHOME_CLIENTS [root@vmtools ~]# gpload -d demo -h 192.168.114.158 -f /tmp/gpload/gpload_simple.conf -U gpadmin 2020-04-21 12:20:43|INFO|gpload session started 2020-04-21 12:20:43 2020-04-21 12:20:43|INFO|setting schema 'public' for table 'test_gpload' 2020-04-21 12:20:43|INFO|started gpfdist -p 8080 -P 8081 -f "/tmp/gpload/data/fic_test.dat" -t 30 2020-04-21 12:20:43|INFO|reusing external table ext_gpload_reusable_423cb816_83b6_11ea_9525_000c29f1da05 2020-04-21 12:20:43|INFO|running time: 0.07 seconds 2020-04-21 12:20:43|INFO|rows Inserted = 10 2020-04-21 12:20:43|INFO|rows Updated = 0 2020-04-21 12:20:43|INFO|data formatting errors = 0 2020-04-21 12:20:43|INFO|gpload succeeded