Creating the gpperfmon Database
This topic describes how to create the Command Center gpperfmon database and enable the gpperfmon data collection agents. This task must be completed one time for the Greenplum Database system, before you install Greenplum Command Center.
When the data collection agents are enabled, their processes are started and stopped (using
gpstop) on the Greenplum segment hosts along with the Greenplum Database server processes.
Greenplum Database includes a
gpperfmon_install utility that performs the following tasks:
- Creates the Command Center database (gpperfmon).
- Creates the Command Center superuser role (
- Configures Greenplum Database server to accept connections from the
gpmonrole (edits the
- Sets the Command Center server configuration parameters in the Greenplum Database server
gpperfmon_install utility and the agents are part of the Greenplum Database software. The tasks in this topic can be performed before or after the Command Center software is installed.
Log in to the Greenplum master host as the
$ su - gpadmin
Source the path file from the Greenplum Database installation directory:
# source /usr/local/greenplum-db/greenplum_path.sh
gpperfmon_installutility with the
--enableoption. You must supply the connection port of the Greenplum Database master server process, and set the password for the
gpmonsuperuser that will be created. For example:
$ gpperfmon_install --enable --password changeme --port 5432
gpperfmon_installutility creates entries for the
gpmonuser in the
$MASTER_DATABASE/pg_hba.conffile. See gpmon User Authentication for notes about restricting the gpmon user’s access to databases.
The password you specify is saved in a
.pgpassfile in the
gpadminuser’s home directory. See Changing the gpmon Password for steps to change the
When the utility completes, restart Greenplum Database server. The data collection agents do not start until the database is restarted.
$ gpstop -r
pscommand, verify that the data collection process is running on the Greenplum master. For example:
$ ps -ef | grep gpmmon
Run the following command to verify that the
gpmonuser can authenticate and that the data collection processes are writing to the Command Center database. If all of the segment data collection agents are running, you should see one row per segment host.
$ psql -U gpmon gpperfmon -c 'SELECT * FROM system_now;'
The data collection agents are now running, and your Greenplum system now has a gpperfmon database installed. This is the database where historical Command Center data is stored. You can connect to it as follows:
$ psql gpperfmon
- Copy the
$MASTER_DATA_DIRECTORY/pg_hba.conffile from your primary master host to your standby master host. This ensures that the required connection options are also set on the standby master.
- Copy your
~/.pgpassfile from your primary master host to your standby master host. This file usually resides in the
gpadminuser’s home directory. Note that the permissions on
.pgpassmust be set to 600 (for example:
chmod 0600 ~/.pgpass).
gpperfmon_install utility adds entries for the
gpmon user to the
pg_hba.conf file, which allows the
gpmon user to make a local connection to any database in the Greenplum cluster.
local gpperfmon gpmon md5 host all gpmon 127.0.0.1/28 md5 host all gpmon ::1/128 md5
For Greenplum Command Center, the
gpmon user must also have host access from the host where the Command Center web server and backend run. This requires that you add an entry for the Command Center host. Edit the
$MASTER_DATA_DIRECTORY/pg_hba.conf file and add a line like the following.
host all gpmon <cc-host-ip>/32 md5
gpmon role is a Greenplum Database superuser, you may wish to restrict the role from accessing other databases. Edit these lines:
List gpperfmon and the databases you want to monitor with Command Center in the second field:
local gpperfmon,userdb1,userdb2 gpmon md5 host gpperfmon,userdb1,userdb2 gpmon 127.0.0.1/28 md5 host gpperfmon,userdb1,userdb2 gpmon ::1/128 md5 host gpperfmon,userdb1,userdb2 gpmon <cc-host-ip>/32 md5
See Changing the gpmon Password for steps to change the
gpmon user’s password.