Table A.1, "Voltdb Port Usage" Section A.5.8, "TLS/SSL Encryption (Including
Table A.1, "Voltdb Port Usage" Section A.5.8, "TLS/SSL Encryption (Including
Network Ports
A VoltDB cluster opens network ports to manage its own operation and to
provide services to client applications. When using the command line, the
network ports are configurable as part of the command that starts the VoltDB
database process or through the configuration file. When specifying a port on
the command line, you can specify just a port number or the network interface
and the port number, separated by a colon.
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. Section A.5.8, “TLS/SSL Encryption (Including
HTTPS)” explains how to enable TLS encryption for the web port and the
programming interface ports, client and admin.
Table A.1. VoltDB Port Usage
Default
Port How to Set
Value
Client Port 21212 VoltDB start command
VoltDB start command line or
Admin Port 21211
configuration file
VoltDB start command line or
Web Interface Port (httpd) 8080
configuration file
Web Interface Port VoltDB start command line or
8443
(withTSL/SSLenabled) configuration file
Internal Server Port 3021 VoltDB start command line
Replication Port 5555 VoltDB start command line
Zookeeper port 7181 VoltDB start 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 --client flag
when starting the VoltDB database. For example, the following command
starts the database using port 12345 as the client port:
$ voltdb start -l ~/license.xml \
--dir=~/mydb -H serverA \
--client=12345
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 write requests when the database enters admin, or read-
only, mode.
By default, VoltDB uses port 21211 on the default external network interface
as the admin port. You can change the port assignment in the configuration
file using the <admin-mode> tag or on the command line using the --
admin flag. For example, the following configuration file sets the admin port to
2222:
<deployment>
...
</deployment>
The same effect can be achieved using the --admin flag on the command
line:
$ voltdb start -l ~/license.xml \
--dir=~/mydb -H serverA \
--admin=2222
When the admin port is set in both the configuration file and on the command
line, the command line setting supersedes the configuration file.
A.5.4.JSON Interface
In addition to the overall availability and port for the web interface, you can
also specify separately whether the JSON interface is available. 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. 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, see the section on "How the
JSON Interface Works" in the Using VoltDB manual.
--internal=4000
A.5.6.Replication Port
During database replication, producer databases (that is, the master
database in passive DR and all clusters in XDCR) use a dedicated port to
share data to their consumers. By default, the replication port is port 5555.
You can use a different port by specifying a different port number either on
the voltdb command line or in the configuration file when starting the cluster.
On the command line, use the –replication flag to specify a
different port (and, optionally, a different network interface):
$ voltdb start -l ~/license.xml \
--dir=~/mydb -H serverA \
--replication=6666
</dr>
A.5.7.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, 7181 is assigned as the Zookeeper port for
VoltDB. You can specify a different port number using the --zookeeper lag
when starting the VoltDB process. It is also possible to specify a different
network interface, like with other ports. However, accepting the default for the
zookeeper network interface is recommended where possible. For example:
$ voltdb start -l ~/license.xml \
--dir=~/mydb -H serverA \
--zookeeper=2288
Note that you cannotdisable TLS encryption for the web port separately. TLS
is always enabled for the web port if you enable encryption for any ports.