Forum: Managing VoltDB

Post: Telling volt to listen on a different port for json calls

Telling volt to listen on a different port for json calls
jeff_i
Jul 15, 2010
Here is the typical server console output when I startup VoltDB (shell example)

java -Djava.library.path=${VOLT_PATH} -server -Xmx512m -XX:-ReduceInitialCardMarks -cp ".:${THE_CLASSPATH}" org.voltdb.VoltDB catalog ${CATALOG_JAR}
50 [main] INFO HOST - Build: 1.1.01 ?revision=
72 [main] INFO HOST - HTTP admin console unable to bind to port 8080
72 [main] INFO HOST - HTTP admin console listening on port 8081
73 [main] INFO HOST - Loading application catalog jarfile from /home/user/workspace/generosity/trunk/generosity/tools/voltdb/bin/../lib/catalog.jar
279 [main] INFO HOST - Creating host manager for 1 hosts using leader localhost/127.0.0.1
287 [Thread-3] INFO HOST - Connecting to VoltDB cluster as the leader...
287 [Thread-3] INFO HOST - Maximum clock/network skew is 0 milliseconds (according to leader)
311 [main] INFO HOST - Attempting to load native VoltDB library voltdb-1.1.01. Expect to see a confirmation following this upon success. If none appears then you may need to compile VoltDB for your platform or you may be running a 32-bit JVM.
315 [main] INFO HOST - Successfully loaded native VoltDB library voltdb-1.1.01.
Creating Execution Engine on clusterIndex=1, site_id = 2...
Creating Execution Engine on clusterIndex=1, site_id = 1...
1209 [main] INFO HOST - Internal profiling is disabled on multi-partition hosts.
INITIALIZING INITIATOR ID: 1, SITEID: 0
1239 [main] INFO HOST - Starting the network
1241 [main] INFO HOST - --------------------------------
Server completed initialization.

It realizes that port 8080 is taken, so it smartly listens on 8081. However, the documentation says the argument httpadminport can be passed to instruct the json server to listen on a specific port. When I try (shell script example):
java -Djava.library.path=${VOLT_PATH} -server -Xmx512m -XX:-ReduceInitialCardMarks -cp ".:${THE_CLASSPATH}" org.voltdb.VoltDB catalog ${CATALOG_JAR} httpadminport 8081
I see that it still tries to listen on port 8080 (which fails as the port is not available) and then tries to listen on 8081 and complains:
39 [main] INFO HOST - Build: 1.1.01 ?revision=
72 [main] INFO HOST - HTTP admin console unable to bind to port 8080
72 [main] INFO HOST - HTTP admin console listening on port 8081
72 [main] INFO HOST - Loading application catalog jarfile from /home/user/workspace/generosity/trunk/generosity/tools/voltdb/bin/../lib/catalog.jar
258 [main] INFO HOST - Creating host manager for 1 hosts using leader localhost/127.0.0.1
266 [Thread-3] INFO HOST - Connecting to VoltDB cluster as the leader...
267 [Thread-3] INFO HOST - Maximum clock/network skew is 0 milliseconds (according to leader)
289 [Site 2] INFO HOST - Attempting to load native VoltDB library voltdb-1.1.01. Expect to see a confirmation following this upon success. If none appears then you may need to compile VoltDB for your platform or you may be running a 32-bit JVM.
302 [Site 2] INFO HOST - Successfully loaded native VoltDB library voltdb-1.1.01.
Creating Execution Engine on clusterIndex=1, site_id = 1...
Creating Execution Engine on clusterIndex=1, site_id = 2...
1056 [main] INFO HOST - Internal profiling is disabled on multi-partition hosts.
INITIALIZING INITIATOR ID: 1, SITEID: 0
1089 [main] FATAL HOST - There was an error trying to start a ClientInterface connecting acceptions
java.net.BindException: Address already in use
at sun.nio.ch.Net.bind(Native Method)
at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:137)
at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:77)
at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:70)
at org.voltdb.ClientInterface$ClientAcceptor.start(ClientInterface.java:215)
at org.voltdb.ClientInterface.startAcceptingConnections(ClientInterface.java:1065)
at org.voltdb.RealVoltDB.initialize(RealVoltDB.java:400)
at org.voltdb.VoltDB.initialize(VoltDB.java:287)
at org.voltdb.VoltDB.main(VoltDB.java:275)
java.lang.Thread.dumpThreads(Native Method)
java.lang.Thread.getAllStackTraces(Thread.java:1503)
org.voltdb.VoltDB.crashVoltDB(VoltDB.java:256)
org.voltdb.RealVoltDB.initialize(RealVoltDB.java:403)
org.voltdb.VoltDB.initialize(VoltDB.java:287)
org.voltdb.VoltDB.main(VoltDB.java:275)
VoltDB has encountered an unrecoverable error and is exiting.
The log may contain additional information.
Will look into it.
jhugg
Jul 15, 2010
> I see that it still tries to listen on port 8080 (which fails as the port is not available) and then tries to listen on 8081 and complains:

I'll look into this. I've created a ticket in JIRA: https://issues.voltdb.com/browse/ENG-640

As for the issue where VoltDB says the address is already in use, are you sure you're not already running VoltDB? That is a common cause of that error. We should also make sure the error message is more clear. Thanks for the feedback.
Found a typo.
jhugg
Jul 15, 2010
> I see that it still tries to listen on port 8080 (which fails as the port is not available) and then tries to listen on 8081 and complains:

I'll look into this. I've created a ticket in JIRA: https://issues.voltdb.com/browse/ENG-640




I found a typo in our command line arg parsing that wouldn't affect ANT invocations of VoltDB (which is what we do a lot), but would affect raw command line invocations (like you did here). Should be fixed in r788. Try it out and let me know if you're still having problems.
got the latest from svn and vold cannot start
jeff_i
Jul 16, 2010
I found a typo in our command line arg parsing that wouldn't affect ANT invocations of VoltDB (which is what we do a lot), but would affect raw command line invocations (like you did here). Should be fixed in r788. Try it out and let me know if you're still having problems.


ran ant compile, ant jars and ant dist. replace my jar and so file rebuild my catalog, started volt and am now getting this:

| | / /___ / / /_/ __ \/ __ )
| | / / __ \/ / __/ / / / __ |
| |/ / /_/ / / /_/ /_/ / /_/ /
|___/\____/_/\__/_____/_____/
Initialization Log Output:
--------------------------------

42 [main] INFO HOST - Build: 1.1.01 http://svnmirror.voltdb.com/eng/trunk?revision=790
74 [main] INFO HOST - HTTP admin console unable to bind to port 8080
74 [main] INFO HOST - HTTP admin console listening on port 8081
75 [main] INFO HOST - Loading application catalog jarfile from /home/user/workspace/generosity/trunk/generosity/tools/voltdb/bin/../lib/catalog.jar
296 [main] INFO HOST - Creating host manager for 1 hosts using leader localhost/127.0.0.1
310 [Thread-3] INFO HOST - Connecting to VoltDB cluster as the leader...
310 [Thread-3] INFO HOST - Maximum clock/network skew is 0 milliseconds (according to leader)
341 [main] INFO HOST - Attempting to load native VoltDB library voltdb-1.1.01. Expect to see a confirmation following this upon success. If none appears then you may need to compile VoltDB for your platform or you may be running a 32-bit JVM.
385 [main] INFO HOST - Successfully loaded native VoltDB library voltdb-1.1.01.
Creating Execution Engine on clusterIndex=1, site_id = 2...
Creating Execution Engine on clusterIndex=1, site_id = 1...
[ERROR] [../../src/ee//voltdbjni.cpp:409:Java_org_voltdb_jni_ExecutionEngine_nativeLoadCatalog()] 2010-07-16 08:51:00 - loadCatalog failed
703 [Site 2] FATAL HOST - Failed to construct execution siteId 2 siteIndex 1
AbstractPlanNode::loadFromJSONObject: Can't find OUTPUT_SCHEMA value
java.lang.Thread.dumpThreads(Native Method)
java.lang.Thread.getAllStackTraces(Thread.java:1503)
org.voltdb.VoltDB.crashVoltDB(VoltDB.java:262)
org.voltdb.ExecutionSite.initializeEE(ExecutionSite.java:569)
org.voltdb.ExecutionSite.(ExecutionSite.java:456)
org.voltdb.RealVoltDB$ExecutionSiteRunner.run(RealVoltDB.java:124)
java.lang.Thread.run(Thread.java:636)
VoltDB has encountered an unrecoverable error and is exiting.
The log may contain additional information.
[ERROR] [../../src/ee//voltdbjni.cpp:409:Java_org_voltdb_jni_ExecutionEngine_nativeLoadCatalog()] 2010-07-16 08:51:00 - loadCatalog failed
log4j:WARN No appenders could be found for logger (HOST).
log4j:WARN Please initialize the log4j system properly.
java.lang.Thread.dumpThreads(Native Method)
java.lang.Thread.getAllStackTraces(Thread.java:1503)
org.voltdb.VoltDB.crashVoltDB(VoltDB.java:262)
org.voltdb.ExecutionSite.initializeEE(ExecutionSite.java:569)
org.voltdb.ExecutionSite.(ExecutionSite.java:456)
org.voltdb.RealVoltDB.initialize(RealVoltDB.java:340)
org.voltdb.VoltDB.initialize(VoltDB.java:293)
working now
jeff_i
Jul 16, 2010
I missed an ant target on the build. Working now and the json issues have been addressed
Good to hear.
jhugg
Jul 16, 2010
I missed an ant target on the build. Working now and the json issues have been addressed



Good to hear. Keep us posted if you run into more issues.