Connect to the Cluster Using GFXD and Pulse

gfxd implements a command-line tool that is based on the Apache Derby ij tool. You can use gfxd to connect to a GemFire XD cluster and run scripts or interactive queries. You execute gfxd using the gfxd or gfxd.bat script.

Procedure
  1. In the same command prompt or terminal window in which you started the GemFire XD cluster, change to the quickstart directory:
    $ cd path-to-gemfirexd-installation/quickstart

    Substitute path-to-gemfirexd-installation with the actual path to your GemFire XD installation. The quickstart directory contains example SQL script files that you will use later in the tutorial.

  2. Start an interactive gfxd session:
    $ gfxd
    gfxd version 1.4.0
    gfxd> 

    This command starts the interactive shell and displays the prompt: gfxd>.

  3. Print a brief list of the available gfxd commands:
    gfxd> help;
  4. To connect to the GemFire XD cluster using the JDBC thin client driver, use the connect client command and specify the host and port number of the GemFire XD locator:
    gfxd> connect client 'localhost:1527';

    Notice that GemFire XD does not have the concept of a "database". When you connect to a GemFire XD cluster, the distributed system that you connect to is defined by the locator (or alternately, the mcast-port) specified in the JDBC, ODBC, or ADO.NET connection.

  5. Use the following command to view tables in the "sys" schema:
    gfxd> show tables in sys;
    TABLE_SCHEM      |TABLE_NAME                    |REMARKS            
    --------------------------------------------------------------------
    SYS              |ASYNCEVENTLISTENERS           |                   
    SYS              |GATEWAYRECEIVERS              |                   
    SYS              |GATEWAYSENDERS                |                   
    SYS              |SYSALIASES                    |                   
    SYS              |SYSCHECKS                     |                   
    SYS              |SYSCOLPERMS                   |                   
    SYS              |SYSCOLUMNS                    |                   
    SYS              |SYSCONGLOMERATES              |                   
    SYS              |SYSCONSTRAINTS                |                   
    SYS              |SYSDEPENDS                    |                   
    SYS              |SYSDISKSTORES                 |                   
    SYS              |SYSFILES                      |                   
    SYS              |SYSFOREIGNKEYS                |                   
    SYS              |SYSHDFSSTORES                 |                   
    SYS              |SYSKEYS                       |                   
    SYS              |SYSROLES                      |                   
    SYS              |SYSROUTINEPERMS               |                   
    SYS              |SYSSCHEMAS                    |                   
    SYS              |SYSSTATEMENTS                 |                   
    SYS              |SYSSTATISTICS                 |                   
    SYS              |SYSTABLEPERMS                 |                   
    SYS              |SYSTABLES                     |                   
    SYS              |SYSTRIGGERS                   |                   
    SYS              |SYSVIEWS                      |                   
    
    24 rows selected

    You will use information from many of these tables to view information and statistics about a working GemFire XD cluster.

  6. The sys.members table stores information about the GemFire XD members. Execute the following query to see the unique ID assigned to the two GemFire XD servers and the locator that you started:
    gfxd> select id from sys.members;
    ID                                                                             
    -------------------------------------------------------------------------------
    192.168.125.147(39598)<v2>:23162                                               
    192.168.125.147(39486)<v1>:40258                                               
    192.168.125.147(39381)<v0>:50344                                               
    
    3 rows selected
    The output displays the member process ID that is also logged when you start the members at the command line (42528, 41456, and 42051 in this tutorial example).
  7. You can also connect to the GemFire XD Pulse application, which runs in an embedded Web server on the locator member. Open a browser and access the URL http://localhost:7075/pulse. Enter "admin" for both the username and password and click Sign In:
  8. On the main Cluster View window, click the machine node to display the three GemFire XD members running on localhost:

    See GemFire XD Pulse for more information about the available pulse views.