Using Greenplum Command Center

VMware Tanzu Greenplum Command Center is a management and monitoring tool for VMware Tanzu Greenplum. This topic describes how to install and configure Command Center with VMware Tanzu Greenplum.

About Command Center in VMware Tanzu Greenplum for Kubernetes

Unlike with other VMware Tanzu Greenplum distributions, VMware Tanzu Greenplum for Kubernetes automatically includes the Command Center installation file as part of the Greenplum Docker image. You can easily execute the installer at /home/gpadmin/tools/installGPCC/gpccinstall-<version> from the master-0 pod, following the instructions at Installing and Upgrading VMware Tanzu Greenplum Command Center in the Command Center documentation.

The procedure that follows shows how to quickly install Command Center in a new VMware Tanzu Greenplum for Kubernetes installation, including how to open the default Command Center port to access Command Center outside of the Kubernetes cluster.

Prerequisites

The Prerequisites topic in the Command Center documentation describes the full list of prerequisites for running Command Center. The following prerequisites are especially relevant for VMware Tanzu Greenplum for Kubernetes deployments:

  • The directory where Greenplum Command Center will be installed must be writable by the gpadmin user on all Greenplum Database hosts. The default directory, /usr/local/ is not writable by gpadmin in new VMware Tanzu Greenplum for Kubernetes deployments. You can install Command Center to /greenplum to meet this prerequisite.

    Note: Do not install Command Center to /home/gpadmin, because files in that location are removed when the Greenplum deployment is deleted and restarted.

    To install to a different directory, follow the instructions in Selecting and Preparing an Installation Directory for Command Center in the Command Center documentation.
  • Use the PGPASSWORD environment variable before invoking the installer, to prevent the .pgpass file from being created. .pgpass is always created in /home/gpadmin and would be removed after the Greenplum instance is deleted and restarted.
  • The default Command Center port number, 28080, is not routed by default using the Greenplum service’s external IP address. The procedure that follows shows example instructions for how to route the default port number in a VMware Tanzu Greenplum for Kubernetes deployment.

Limitations

  • Using the .pgpass file is not recommended for VMware Tanzu Greenplum for Kubernetes deployments. The .pgpass file is always created in /home/gpadmin, and the contents of this directory are removed and recreated when you delete and redeploy VMware Tanzu Greenplum for Kubernetes. Instead, set the PGPASSWORD before you install Command Center, and before you run the gpcc command to perform actions such as starting, stopping, or displaying the status of Command Center.

  • After you delete and redeploy a VMware Tanzu Greenplum for Kubernetes deployment, you must manually restart Command Center. You must also reconfigure the Greenplum service to allow the Command Center port number to be accessed from an external IP address. Follow steps 4 and 5 in Installing Command Center to complete these steps.

Installing Command Center

To install Command Center in a new VMware Tanzu Greenplum for Kubernetes deployment:

  1. Set the PGPASSWORD environment variable and execute the Command Center installer, /home/gpadmin/tools/installGPCC/gpccinstall-<version>, where <version> is the Command Center version that was installed. The following example commands creates an input file for the installer to specify the /greenplum installation directory, and uses default values for all other installation options:

    $ kubectl exec master-0 -- bash -c 'echo -e "path = /greenplum" > /tmp/gpcc-config.txt && PGPASSWORD=changeme /tools/installGPCC/gpccinstall-* -c /tmp/gpcc-config.txt'
    

    If you want to specify a non-default port, language, or security setting, either add those options to the input file or run the installer in interactive mode. The following command runs the interactive installer, which prompts you for all installation options:

    $ kubectl exec -it master-0 -- bash -c "PGPASSWORD=changeme /home/gpadmin/tools/installGPCC/gpccinstall-*"
    
  2. Execute the gpcc_path.sh script and set the PGPASSWORD environment before starting Command Center. For example:

    $ kubectl exec -it master-0 -- bash -c 'source /greenplum/greenplum-cc/gpcc_path.sh && PGPASSWORD=changeme gpcc start'
    
    2020-10-08 18:39:15 Starting the gpcc agents and webserver...
    2020-10-08 18:39:18 Agent successfully started on 2/2 hosts
    2020-10-08 18:39:18 View Greenplum Command Center at http://master-0:28080
    
  3. At this point, Command Center is running on the indicated port, but the port is not mapped to the external IP address for the service. Follow these steps to add the port mapping:

    1. Load the Greenplum service configuration into your text editor:

      $ kubectl edit svc greenplum
      
    2. In the ports: section of the configuration, add a name: gpdb entry to identify the existing port configuration for Greenplum Database. For example, change the following stanza:

        ports:
        - nodePort: 32731
          port: 5432
          protocol: TCP
          targetPort: 5432
      

      to read:

        ports:
        - name: gpdb
          nodePort: 32731
          port: 5432
          protocol: TCP
          targetPort: 5432
      
    3. Add a new stanza to the ports: section to add a port configuration for GPCC. The following shows the completed ports: section with the new gpcc stanza that configured the default port, 28080:

        ports:
        - name: gpdb
          nodePort: 32731
          port: 5432
          protocol: TCP
          targetPort: 5432
        - name: gpcc
          port: 28080
          protocol: TCP
          targetPort: 28080
      
    4. Save your changes to the service configuration file.

    5. The service configuration should now show the available port number (28080 in the example above). For example:

      $ kubectl get svc greenplum
      
      NAME        TYPE           CLUSTER-IP       EXTERNAL-IP     PORT(S)                          AGE
      greenplum   LoadBalancer   10.102.197.205   10.102.197.205  5432:32731/TCP,28080:30684/TCP   20h
      
  4. Access Command Center from your browser, using the external IP address and port number you have configured. In the above example, Command Center would be accessed from http://10.102.197.205:28080 For a new installation, log in using the gpmon role and the password that you set in the PGPASSWORD environment variable.

Getting More Information

For more information about using Command Center, see the VMware Tanzu Greenplum Command Center documentation.