Results 1 to 7 of 7

Thread: Could not run voterexample when setup cclient and server on differet nodes (2 VMs, 1 for server and the other for client)

  1. #1
    New Member
    Join Date
    Jun 2015
    Posts
    8

    Could not run voterexample when setup cclient and server on differet nodes (2 VMs, 1 for server and the other for client)

    Hi,
    The voter example work well when both client and server are running in the same virtual machine.
    However, I could not run client and server on two different VMs using the community package.
    And help is much appreciated.
    Thanks,
    Duyen

    __________________________________________________ _______________________

    setup server on (VM: 169.245.1.9) and client on (VM:169.245.1.8)

    I got the following error when start client:
    ERROR: Failed to establish socket mesh-java.net.NoRouteToHostException: No route to host

    I did not modify the development.xml because, I use singe server and single client at the moment so, the hostcount is still 1.
    and the host name are the same for both "localhost"

    Below is detail:

    1.) use command run.sh: (the client is ok when start on the same VM as server 169.254.1.9)
    SERVER[169.254.1.9]> ./run.sh server
    CLIENT[169.254.1.8]> ./run.sh init //==> connaction refuse
    CLIENT[169.254.1.8]> ./run.sh client //==> Setup & Initialization
    --------------------------------------------------------------------------------

    Connecting to VoltDB...
    Connection failed - retrying in 1 second(s).



    2.) use the manual command to specify the internal/external interfaces:
    Start server on [server's localhost = 169.245.1.9] as:
    [root@localhost voter]# voltdb create -d deployment.xml -H 169.254.1.9 --client 21212 -l license.xml --externalinterface 169.254.1.9 --internalinterface 169.254.1.9 > volt-console.log

    ==> Initializing VoltDB...

    _ __ ____ ____ ____
    | | / /___ / / /_/ __ \/ __ )
    | | / / __ \/ / __/ / / / __ |
    | |/ / /_/ / / /_/ /_/ / /_/ /
    |___/\____/_/\__/_____/_____/

    --------------------------------

    Build: 5.4EA1 voltdb-5.4EA1-58-g6976a7c Community Edition
    Connecting to VoltDB cluster as the leader...
    Host id of this node is: 0
    Initializing the database. This may take a moment...
    WARN: Strict java memory checking is enabled, don't do release builds or performance runs with this enabled. Invoke "ant clean" and "ant -Djmemcheck=NO_MEMCHECK" to dis
    able.
    WARN: This is not a highly available cluster. K-Safety is set to 0.
    WARN: Durability is turned off. Command logging is off.
    Server completed initialization.


    Start client on [client's localhost = 169.245.1.8] as:
    [root@localhost voter]# voltdb create -d deployment.xml -H 169.254.1.9 --client 21212 -l license.xml --externalinterface 169.254.1.8 --internalinterface 169.254.1.8 > volt-console.log

    ==> GOT The following ERROR:

    VoltDB has encountered an unrecoverable error and is exiting.
    The log may contain additional information.
    [root@localhost voter]# more volt-console.log
    Initializing VoltDB...

    _ __ ____ ____ ____
    | | / /___ / / /_/ __ \/ __ )
    | | / / __ \/ / __/ / / / __ |
    | |/ / /_/ / / /_/ /_/ / /_/ /
    |___/\____/_/\__/_____/_____/

    --------------------------------

    Build: 5.4EA1 voltdb-5.4EA1-58-g6976a7c Community Edition
    Connecting to the VoltDB cluster leader /169.254.1.9:3021
    ERROR: Failed to establish socket mesh.
    java.net.NoRouteToHostException: No route to host
    at sun.nio.ch.Net.connect0(Native Method)
    at sun.nio.ch.Net.connect(Net.java:364)
    at sun.nio.ch.Net.connect(Net.java:356)
    at sun.nio.ch.SocketChannelImpl.connect(SocketChannel Impl.java:623)
    at java.nio.channels.SocketChannel.open(SocketChannel .java:184)
    at org.voltcore.messaging.SocketJoiner.connectToPrima ry(SocketJoiner.java:489)
    at org.voltcore.messaging.SocketJoiner.start(SocketJo iner.java:179)
    at org.voltcore.messaging.HostMessenger.start(HostMes senger.java:330)
    at org.voltdb.RealVoltDB.buildClusterMesh(RealVoltDB. java:1664)
    at org.voltdb.RealVoltDB.initialize(RealVoltDB.java:4 58)
    at org.voltdb.VoltDB.initialize(VoltDB.java:891)
    at org.voltdb.VoltDB.main(VoltDB.java:875)
    FATAL: java.net.NoRouteToHostException: No route to host
    FATAL: Fatal exception
    java.lang.RuntimeException: java.net.NoRouteToHostException: No route to host
    at org.voltcore.messaging.SocketJoiner.connectToPrima ry(SocketJoiner.java:693)
    at org.voltcore.messaging.SocketJoiner.start(SocketJo iner.java:179)
    at org.voltcore.messaging.HostMessenger.start(HostMes senger.java:330)
    at org.voltdb.RealVoltDB.buildClusterMesh(RealVoltDB. java:1664)
    at org.voltdb.RealVoltDB.initialize(RealVoltDB.java:4 58)
    at org.voltdb.VoltDB.initialize(VoltDB.java:891)
    at org.voltdb.VoltDB.main(VoltDB.java:875)
    Caused by: java.net.NoRouteToHostException: No route to host
    at sun.nio.ch.Net.connect0(Native Method)
    at sun.nio.ch.Net.connect(Net.java:364)
    at sun.nio.ch.Net.connect(Net.java:356)
    at sun.nio.ch.SocketChannelImpl.connect(SocketChannel Impl.java:623)
    at java.nio.channels.SocketChannel.open(SocketChannel .java:184)
    at org.voltcore.messaging.SocketJoiner.connectToPrima ry(SocketJoiner.java:489)
    ... 6 more
    [root@localhost voter]#

  2. #2
    Super Moderator
    Join Date
    Dec 2011
    Posts
    224
    Hi Duyen,

    Using the run.sh scripts, you can start the server normally using:
    ./run.sh server
    (wait until the database has started)
    ./run.sh init
    Then on the other server, you must first edit the run.sh script so that it will connect to a database other than localhost. In the following section, change "localhost" to the hostname or IP address of the database server:

    function async-benchmark() {
    jars-ifneeded
    #java -classpath $CLIENTCLASSPATH -Dlog4j.configuration=file://$LOG4J \
    java -classpath $CLIENTCLASSPATH \
    voter.AsyncBenchmark \
    --displayinterval=5 \
    --warmup=5 \
    --duration=120 \
    --servers=localhost:21212 \
    --contestants=6 \
    --maxvotes=2

    If you want to do all of this manually without the run.sh script, then it looks like you started the database ok, but did not load the schema. Then when you went to start the client, you used the wrong command. Rather than "voltdb create" which is to start a new database instance, you should run something like the java ... voter.AsyncBenchmark... command from the run.sh script snippet above.

    If you want to start a cluster, you might want to review the Administrator Guide: Starting and Stopping the database (http://docs.voltdb.com/AdminGuide/StartStopChap.php).

    Regards,
    Ben

  3. #3
    New Member
    Join Date
    Jun 2015
    Posts
    8
    Hi Ben,

    Thank you for repying Ben.

    I did modify the run.sh command by replacing the the HOST="localhost" by HOST="serverIpAddr" and --servers=localhost:21212 \ by --servers=$HOST:21212 \
    however, the issue is till persist...

    My issue the client start failed when try to "createConnetion" with the server..
    event though I just try command "sqlcmd --servers=serverIpAddress' also failed "no connection to host"

  4. #4
    Super Moderator
    Join Date
    Dec 2011
    Posts
    224
    Hi Duyen,

    Ok, it sounds like you have the commands correct, but you may have a networking issue. Can you connect to the database locally on the host where it is running using sqlcmd? Can you communicate from the client host to the database host using ping or SSH? Perhaps there is a firewall blocking the connections?

    -Ben

  5. #5
    New Member
    Join Date
    Jun 2015
    Posts
    8
    Hi Ben,
    The ping between 2 VMs are ok and the sqlcmd on different window with the same server's VM is also ok.)
    note that I use only single server is start form VM(169.245.1.9) and start the client from the other VM(169.245.1.8)

    I try adding debug from the client code it seem the connection failed when invoking the " return getAuthenticatedConnection(service, host, username, hashedPassword, port, subject, scheme);"
    below:



    ** Duyen dbg 1 - clientImp::createConnection user:, host:135.121.78.160 , port 21212
    Duyen dbg - createConnectionWithHashedCredentials - ENTERING ...
    Duyen dbg - createConnectionWithHashedCredentials - verifyCredentialsAreAlwaysTheSame is OK ...
    Duyen Dbg 1 - Distributed:createConnectionWithHashedCredentials host:135.121.78.160, port:21212... ENTERING
    Duyen Dbg 1 - ConnectionUtil::getAuthenticatedConnection 6 service:Connection failed - retrying in 1 second(s).

    ==>

    public static Object[] getAuthenticatedConnection(String host, String username,
    byte[] hashedPassword, int port,
    final Subject subject, ClientAuthHashScheme scheme) throws IOException {
    String service = subject == null ? "database" : Constants.KERBEROS;
    System.out.printf("Duyen Dbg 1 - ConnectionUtil::getAuthenticatedConnection 6 service:%d ENTERING ...\n", service);
    return getAuthenticatedConnection(service, host, username, hashedPassword, port, subject, scheme);
    }

  6. #6
    Super Moderator
    Join Date
    Dec 2011
    Posts
    224
    Hi Duyen,

    The only places I found "Connection failed - retrying in ... seconds" are in the YCSB benchmark, or if you are using the "exampleutils" ClientConnectionPool. Are you using either of those?

    This may be obscuring the root cause of the exception.

    The ConnectionUtil.getAuthenticatedConnection (https://github.com/VoltDB/voltdb/blo...Util.java#L156) method has various possible exceptions that could be thrown. I think we need to see what the exception is to know what is blocking this from working.

    If it would be preferable, you might try using Docker to set up the instances. We have some resources that show how to do this:
    http://voltdb.com/blog/how-docker-si...lopment-voltdb
    https://github.com/VoltDB/voltdb/wik...ustering-Intro

  7. #7
    New Member
    Join Date
    Jun 2015
    Posts
    8
    Thanks Ben,
    you are right the issue is related to the firewall.
    Duyen

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •