Installing the Greenplum Client Tools on commodity server

Running the Client Tools Installer

The Greenplum Database client tools installer installs the following client tools:

1.  PostgreSQL Interactive Terminal (psql)

2. Greenplum MapReduce Client Program (gpmapreduce)

To install the Greenplum Database client tools

1. Download the appropriate greenplum-clients-4.2.x.x-PLATFORM.bin installer package for your platform from the EMC Download Center. The currently supported platforms are RedHat Linux 32-bit, RedHat Linux 64-bit, and Solaris 64-bit.

2. Unzip the installer:

unzip greenplum-clients-4.2.x.x-PLATFORM.bin.zip

3. Run the installer:

/bin/bash greenplum-clients-4.2.x.x-PLATFORM.bin

4. The installer will prompt you to accept the license agreement and to provide an installation path. For the installation path, be sure to enter an absolute path if you 

choose not to accept the default location (for example, /mydir/gp-client-tools). The client tools are installed into greenplum-db-4.2.x.x by default.

Note: Your Greenplum Database client tools installation contains the following files and directories:

• bin — client command-line tools (psql and gpmapreduce)

• greenplum_clients_path.sh — environment variables

• include — libpq C header files

• lib — client tools library files

Configuring the Command-Line Tools

As a convenience, a greenplum_clients_path.sh file is provided in your client tools installation directory following installation. It has the following environment 

variable settings:

GPHOME_CLIENTS — The installation directory of the Greenplum Database client 

tools.

PATH — The paths to the command-line utilities.

LD_LIBRARY_PATH — The path to the library files.

You can source this file in your user’s startup shell profile (such as .bashrc or 

.bash_profile). 

For example, you could add a line similar to the following to your chosen profile files 

(making sure the right install path is used):

source greenplum-db-4.2.x.x/greenplum_clients_path.sh

After editing the chosen profile file, source it as the correct user to make the changes 

active. For example:

source ~/.bashrc

Additional Connection Environment Variables

The PostgreSQL command-line tools require several connection parameters in order to be able to connect to a Greenplum Database database. In order to save some typing on the command-line, you can create the following environment variables in your preferred profile file (such as .bashrc).

• PGDATABASE — The name of the default Greenplum database to connect to.

• PGHOST — The Greenplum master host name or IP address. 

• PGPORT — The port number that the Greenplum master instance (postmaster process) is running on.

• PGUSER — The default database role name to use for login

Enabling Greenplum Database for Remote Client Connections

In order for Greenplum Database to be able to accept remote client connections, you must configure your Greenplum Database master so that connections are allowed from the client hosts and database users that will be connecting to Greenplum Database.

To enable remote client connections

1. Make sure that the pg_hba.conf file of the Greenplum Database master is correctly configured to allow connections from the users to the database(s) using 

the authentication method you want. See the section on Editing the pg_hba.conf File in the Greenplum Database Administrator Guide and the section on Client 

Authentication in the PostgreSQL documentation for details. Make sure the authentication method you choose is supported by the client tool you are using. 

2. If you edited pg_hba.conf file, the change requires a server reload (using the gpstop -u command) to take effect.

3. Make sure that the databases and roles you are using to connect exist in the system and that the roles have the correct privileges to the database objects.

Accessing Greenplum Database with psql 

From a remote system, you can access a Greenplum Database that has Kerberos authentication enabled. 

To connect to Greenplum Database with psql

1. As the gpadmin user, open a command window. 

2. Start psql from the command window and specify a connection to the Greenplum Database specifying the user that is configured with Kerberos authentication.

This example logs into the Greenplum Database on the machine kerberos-gpdb as the gpadmin user with the Kerberos credentials gpadmin/kerberos-gpdb:

$ psql -U "gpadmin/kerberos-gpdb" -h kerberos-gpdb template1