Forum: Building VoltDB Applications

Post: Can not run application with replication

Can not run application with replication
weiwei
Feb 21, 2012
Hi,

I was trying to run hello world example with 2 copies of hosts in the cluster (hostcount=2, sitesperhost=1, kfactor=1)

however, the system freezes up after this line is printed:

131256 [Thread-6] INFO HOST - Connecting to VoltDB cluster as the leader...

I am running voltdb-2.1.3 on Mac, and the system info is as following:

CPU INFO: 2 Cores, 1 Sockets, 2 Hardware Threads
CPU DESC: Intel Core 2 Duo 2.4 GHz
MEMORY (MB): 4096
OS PROFILE: Mac OS X 10.7.2 x86_64 en_US
JAVA VERSION: 1.6.0_29
JAVA RUNTIME: Java(TM) SE Runtime Environment (1.6.0_29-b11-402-11M3527)
JAVA VM: Java HotSpot(TM) 64-Bit Server VM (20.4-b02-402, mixed mode)

Could you let me know is there anything special I need to configure to run replicated app? Or I did something wrong which causes this problem?
Thanks a lot!
Need to set leader address in run.sh
nshi
Feb 21, 2012
Hello Weiwei,

In order to run a cluster with more than one machines, you need to pick one of the machines as leader and tell the other machines to connect to it. To do that in the hello world example, you can modify line 37 in run.sh, where it says "leader localhost" at the end, to "leader HOSTNAME" with HOSTNAME replaced with the actual hostname of the machine you picked as the leader.

Ning
Hi Ning, Thanks for your
weiwei
Feb 23, 2012
Hello Weiwei,

In order to run a cluster with more than one machines, you need to pick one of the machines as leader and tell the other machines to connect to it. To do that in the hello world example, you can modify line 37 in run.sh, where it says "leader localhost" at the end, to "leader HOSTNAME" with HOSTNAME replaced with the actual hostname of the machine you picked as the leader.

Ning


Hi Ning,

Thanks for your reply. Actually, I was just trying to run test with replication on one machine. That is HELLOWROLD table gets partitioned on 2 sites and also gets replicated since kfactor=1. Any hints for this? Thanks a lot!
You have to use a different sets of ports
nshi
Feb 23, 2012
Hi Ning,

Thanks for your reply. Actually, I was just trying to run test with replication on one machine. That is HELLOWROLD table gets partitioned on 2 sites and also gets replicated since kfactor=1. Any hints for this? Thanks a lot!


Yes, it is possible to run a multi-node cluster on a single machine. We actually do this in our tests. In your case, you need to set the leader as "localhost" for both processes. Then you have to pick different sets of ports for each process. If you have HTTPD enabled in your deployment file, you need to disable it since a cluster requires the deployment file to be the same on all servers. Then you have to specify the following ports on command-line, zkport, port, and adminport. Remember to use different values for each server process. You should be able to get a two node cluster running on a single machine this way.

Although you can do it this way, it is not recommended if you are testing for performance. The two processes will be competing for resources on a single machine. It is better off to run them on separate physical machines to get optimal performance.
Hi Ning, Thanks for the
weiwei
Feb 26, 2012
Yes, it is possible to run a multi-node cluster on a single machine. We actually do this in our tests. In your case, you need to set the leader as "localhost" for both processes. Then you have to pick different sets of ports for each process. If you have HTTPD enabled in your deployment file, you need to disable it since a cluster requires the deployment file to be the same on all servers. ...


Hi Ning,

Thanks for the explanation, I think my problem might be that I did not set different ports for each process. Would you mind sharing steps/instructions to run a test like this (single or multiple machines)? Thank you very much!
How to run examples in a cluster
rmorgenstein
Feb 27, 2012
Hi Ning,

Thanks for the explanation, I think my problem might be that I did not set different ports for each process. Would you mind sharing steps/instructions to run a test like this (single or multiple machines)? Thank you very much!


WeiWei,

We recommend you use multiple machines instead of multiple processes. Take a look at the run.sh files in the provided examples. Documentation on how to modify the scripts for a cluster are in the docs at SampleAppCluster