Hi Brendan

Now that we bundle the coordinators (a.k.a ZooKeeper) with the installation,
setting up an HA cluster is a little simpler than before (not much, but a
bit).

Here are the steps I use for setting up an HA cluster *on a single machine*.
I'm using an Apple MacBook and Neo4j Enterprise 1.4.1. If you're setting up
a cluster on separate machines, not a single machine, let me know, and I'll
write up some instructions for doing that.

We're going to configure a cluster with 3 ZooKeeper instances and 3 Neo4j
instances. Each ZooKeeper instance will have different quorum and leader
election ports, and a different client port, and each Neo4j instance will
host its Webadmin on a different port.

We're going to run the ZooKeeper instances with the following quorum and
leader election ports, and client ports

   - localhost:2888:3888, client port 2181
   - localhost:2889:3889, client port 2181
   - localhost:2890:3890, client port 2181

We're going to host the Webadmin for the Neo4j instances at:

   - localhost:7474
   - localhost:7475
   - localhost:7476

*Step 1 - Download*

Download the current milestone version of the Enterprise edition for your
platform from http://neo4j.org/download/
Uncompress, and copy to your install location.

*Step 2 - One copy per instance*

Copy the entire neo4j directory two more times into the same install
directory. I've renamed the neo4j directories in my setup as follows:

   - neo4j-enterprise-1.4.1-1
   - neo4j-enterprise-1.4.1-2
   - neo4j-enterprise-1.4.1-3

*Step 3 - Configure the 1st ZooKeeper and Neo4j instances
*
Update the *conf/coord.cfg* file (leave all other values the same):

server.1=localhost:2888:3888
server.2=localhost:2889:3889
server.3=localhost:2890:3890

Update the conf/neo4j-server.properties file. Uncomment the line beginning
org.neo4j.server.database.mode
:

org.neo4j.server.database.mode=HA

Update the *conf/neo4j.properties* file: set the machine ID, configure the
ZooKeeper instances (note, there are no spaces between the ZooKeeper
addresses), and add a line for the pull interval:

ha.machine_id=1
ha.zoo_keeper_servers=localhost:2181,localhost:2182,localhost:2183
 ha.pull_interval=10

*Step 4 - Configure the 2nd ZooKeeper and Neo4j instances*

Update the *conf/coord.cfg* file (note the change to the client port):

server.1=localhost:2888:3888
server.2=localhost:2889:3889
server.3=localhost:2890:3890
clientPort=2182

Update the conf/neo4j-server.properties file. Uncomment the line beginning
org.neo4j.server.database.mode, and change the webadmin port:

org.neo4j.server.database.mode=HA
org.neo4j.server.webserver.port=7475

conf/neo4j.properties

Update the *conf/neo4j.properties* file: set the machine ID, configure the
ZooKeeper instances (note, there are no spaces between the ZooKeeper
addresses), and add a line for the pull interval:

ha.machine_id=2
ha.zoo_keeper_servers=localhost:2181,localhost:2182,localhost:2183
ha.pull_interval=10

Finally, set the ZooKeeper ID:

Open *data/coordinator/myid* and change the value to 2

*Step 5 - Configure the 3rd ZooKeeper and Neo4j instances*

Update the *conf/coord.cfg* file (note the change to the client port):

server.1=localhost:2888:3888
 server.2=localhost:2889:3889
server.3=localhost:2890:3890
clientPort=2183

Update the conf/neo4j-server.properties file. Uncomment the line beginning
org.neo4j.server.database.mode, and change the webadmin port:

org.neo4j.server.database.mode=HA
org.neo4j.server.webserver.port=7476

conf/neo4j.properties

Update the *conf/neo4j.properties* file: set the machine ID, configure the
ZooKeeper instances (note, there are no spaces between the ZooKeeper
addresses), and add a line for the pull interval:

ha.machine_id=3
ha.zoo_keeper_servers=localhost:2181,localhost:2182,localhost:2183
ha.pull_interval=10

Finally, set the ZooKeeper ID:

Open *data/coordinator/myid* and change the value to 3

*Step 6 - Start the coordinators (the ZooKeeper cluster)*

cd into each the root of each neo4j installation directory in turn, and run:

bin/neo4j-coordinator start

*Step 7 - Start the Neo4j instances*

cd into each the root of each neo4j installation directory in turn, and run:

bin/neo4j start

*Step 8 - Verify installation*

The cluster should now be up and running. Open a browser to
http://localhost:7474/webadmin/ Click on the 'Server info' tab, and then
select the 'High Availability' menu option from the left-hand menu. You
should see details of all three machines in the cluster (though the address
and instanceId values for each machine will be empty)

In the 'Data browser' tab, create a new node and add a property. Wait 10+
secs (the polling interval configured above), then open
http://localhost:7475/webadmin/ and http://localhost:7476/webadmin/ and
confirm that the node and its property have been replicated to the other two
instances.


2011/8/17 Brendan cheng <ccp...@hotmail.com>

>
> Hi,
> I have tried to follow your instructions on HA startup but failed.  I have
> the a screenshot attached.
> as you can see, first issue is Zookeeper started with a warn about the
> log4j has no appenders.  Did you experience this?
> second, I create a empty through "bin/neo4j start" as a server and then
> shut it down.  is this ok?
> thirdly, the screen I sent is the second time I ran the command and the for
> the first time, there was no database recovery but it seems the process just
> hang in there, never finish and I press ctrl+c to kill.
> is anything you can recommend?
> Regards,
> Brendan
> _______________________________________________
> Neo4j mailing list
> User@lists.neo4j.org
> https://lists.neo4j.org/mailman/listinfo/user
>
>


-- 
Director of Customer Success, Neo Technology
http://neotechnology.com
UK: +44 7974 144424
Skype: iansrobinson
_______________________________________________
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user

Reply via email to