A.5. Network Ports

A VoltDB cluster opens network ports to manage its own operation and to provide services to client applications. When using the Enterprise Manager, most ports are configurable as part of the database definition. Many of the network ports are configurable as part of the command line that starts the VoltDB database process or through the deployment file. Table A.1, “VoltDB Port Usage” summarizes the ports that VoltDB uses, their default value, and how to change the default. The following sections describe each port in more detail.

Table A.1. VoltDB Port Usage

PortDefault ValueWhere to Set (Community Edition)
Client Port21212VoltDB command line
Admin Port21211Deployment file
Web Interface Port (httpd)8080Deployment file
Internal Server Port3021VoltDB command line
Log Port4560(Enterprise Edition feature)
JMX Port9090(Enterprise Edition feature)
Replication Port5555(Enterprise Edition feature)
Zookeeper port2181VoltDB command line

A.5.1. Client Port

The client port is the port VoltDB client applications use to communicate with the database cluster nodes. By default, VoltDB uses port 21212 as the client port. You can change the client port. However, all client applications must then use the specified port when creating connections to the cluster nodes.

To specify a different client port on the command line, use the port parameter when starting the VoltDB database. For example, the following command starts the database using port 12345 as the client port:

$ voltdb create host localhost \
         catalog mycatalog.jar deployment deployment.xml \
         port 12345

When using the Enterprise Manager, use the Edit Configuration dialog box to specify the port to use.

If you change the default client port, all client applications must also connect to the new port. The client interfaces for Java and C++ accept an additional, optional argument to the createConnection method for this purpose. The following examples demonstrate how to connect to an alternate port using the Java and C++ client interfaces.

Java

org.voltdb.client.Client voltclient;
voltclient = ClientFactory.createClient();
voltclient.createConnection("myserver",12345);  

C++

boost::shared_ptr<voltdb::Client> client = voltdb::Client::create();
client->createConnection("myserver", 12345);

A.5.2. Admin Port

The admin port is similar to the client port, it accepts and processes requests from applications. However, the admin port has the special feature that it continues to accept requests when the database enters admin mode.

By default, VoltDB uses port 21211 as the admin port. You can change the port assignment in the deployment file using the <admin-mode> tag. For example, the following deployment file sets the admin port to 2222:

<deployment>
   ...
   <admin-mode port="2222" />
</deployment>

When using the Enterprise Manager, use the Edit Configuration dialog box to specify a different admin port.

A.5.3. Web Interface Port (httpd)

The web interface port is the port that VoltDB listens to for web-based connections from the JSON interface. There are two related settings associated with the JSON interface. The first setting is whether the port is enabled; the second is which port to use, if the interface is enabled.

When starting a VoltDB database manually, the web interface port (and the JSON interface) or disabled by default. When using the Enterprise Manager, both the web interface port and the JSON interface are enabled by default. The default httpd port is 8080.

If you plan on using the JSON interface from the community edition, be sure to include the <httpd> tag in the deployment file.

  • To enable the httpd port but disable the JSON interface, specify the attribute enabled="false" in the <jsonapi> tag in the deployment file when starting VoltDB. If you are using the Enterprise Manager, there is a check box for enabling and disabling the JSON interface in the Edit Configuration dialog box.

  • To change the web interface port, specify the alternate port using the port attribute to the <httpd> tag in the deployment file. Or, if you are using the Enterprise Manager use the httpd port field in the Edit Configuration dialog.

For example, the following deployment file fragment enables the web interface and the JSON interface, specifying the alternate port 8083.

<httpd port='8083'>
        <jsonapi enabled='true'/>
</httpd>

If you change the port number, be sure to use the new port number when connecting to the cluster using the JSON interface. For example, the following URL connects to the port 8083, instead of 8080:

http://athena.mycompany.com:8083/api/1.0/?Procedure=@SystemInformation

For more information about the JSON interface and specifying the appropriate port when connecting to the VoltDB cluster, see the section on "How the JSON Interface Works" in the Using VoltDB manual.

A.5.4. Internal Server Port

A VoltDB cluster uses ports to communicate among the cluster nodes. This port is internal to VoltDB and should not be used by other applications.

By default, the internal server port is port 3021 for all nodes in the cluster[2]. You can specify an alternate port using the internalport parameter when starting the VoltDB process. For example, the following command starts the VoltDB process using an internal port of 4000:

$ voltdb create host localhost \
         catalog mycatalog.jar deployment deployment.xml \
         internalport 4000

When using the Enterprise Manager, you can change the starting internal port number by using the Edit Database dialog, as described in Section 4.2, “Changing the Database Configuration”.

A.5.5. Log Port (Enterprise Edition Feature)

When using the Enterprise Manager to configure and run VoltDB, the resulting VoltDB cluster nodes open a port as an output stream for log4J messages. The Enterprise Manager uses the port to fetch log4J messages from the cluster nodes and display them in the management console.

By default, port 4560 is assigned as the log port. You can change this port using the Edit Database dialog (described in Section 4.2, “Changing the Database Configuration”).

A.5.6. JMX Port (Enterprise Edition Feature)

The VoltDB Enterprise Manager uses JMX to collect statistics from the cluster nodes at runtime. It does this using JMX. The default JMX port is 9090. However, you can change this port in the Edit Database dialog box as described in Section 4.2, “Changing the Database Configuration”.

There is no JMX port when using the VoltDB Community Edition.

A.5.7. Replication Port (Enterprise Edition Feature)

During database replication, the DR agent uses three ports to connect to the master database. By default, these ports are three sequential ports starting at port 5555; in other words, ports 5555, 5556, and 5557. You can use three different ports by specifying a different starting port either on the voltdb command line or in the deployment file.

  • On the command line, use the replicationport argument to specify a different starting port:

    voltdb create catalog catalog.jar deployment deployment.xml \
       leader ServerA license ../../voltdb/license.xml \
       replicationport 6666
  • In the deployment file, specify the starting port number using the <replication> tag:

    <replication port="6666" />

Adding the replication port to the deployment file is useful when setting the port for all nodes in the cluster. Using the command line option is useful for changing the default port for only one node in the cluster. If you specify the replication port in both the deployment file and on the command line, the command line argument takes precedence.

A.5.8. Zookeeper Port

VoltDB uses a version of Apache Zookeeper to communicate among supplementary functions that require coordination but are not directly tied to database transactions. Zookeeper provides reliable synchronization for functions such as command logging without interfering with the database's own internal communications.

VoltDB uses a network port bound to the local interface (127.0.0.1) to interact with Zookeeper. By default, 2181 is assigned as the Zookeeper port. You can specify a different port number using the zkport parameter when starting the VoltDB process. For example:

$ voltdb create host localhost \
         catalog mycatalog.jar deployment deployment.xml \
         zkport 2288

When using the Enterprise Manager, you can change the Zookeeper port by using the Edit Database dialog, as described in Section 4.2, “Changing the Database Configuration”.



[2] In the special circumstance where multiple VoltDB processes are started for one database, all on the same server, the internal server port is incremented from the initial value for each process.