VoltDb Setup : (3 nodes cluster )
===========================
Download the voltdb community edition, extract it and move to /opt as /opt/voltb
wget http://voltdb.com/downloads/technologies/server/LINUX-voltdb-3.0.tar.gz
Download and install the java jdk-6u41-linux-x64.bin
http://www.oracle.com/technetwork/java/javase/downloads/jdk6downloads-1902814.html
Copy to /var , give execute permission and run
# ./jdk-6u41-linux-x64.bin
Install php-5.3.X
yum install php
Set path variable for java and voltdb (Also put in ~/bashrc)
# export PATH="$PATH:/opt/voltdb/bin"
# export JAVA_HOME=/var/jdk1.6.0_41
Node-1 (Leader) -
1. Create a dir /opt/testvoltdb and create a helloworld.sql in it and edit below lines -
CREATE TABLE HELLOWORLD (
HELLO VARCHAR(15),
WORLD VARCHAR(15),
DIALECT VARCHAR(15) NOT NULL,
PRIMARY KEY (DIALECT)
);
[ It will create a table HELLOWORLD ]
2. compile the sql file to create the new catalog
# voltdb compile -o helloworld.jar helloworld.sql
3. Create the deployment.xml file containing the info about how many nodes and partition needs to be used -
# vi deployment.xml
<?xml version="1.0"?>
<deployment>
<cluster hostcount="3"
sitesperhost="4"
kfactor="2"
/>
<paths>
<voltdbroot path="/opt/testvoltdb" />
<snapshots path="/opt/testvoltdb/snapshot" />
</paths>
</deployment>
4. Create and start the database
# voltdb create host <node1-hostname> catalog helloworld.jar deployment deployment.xml &
# sqlcmd
SQL Command :: localhost:21212
1> INSERT INTO HELLOWORLD VALUES(
2> 'You','Are', 'Welcome!');
(1 row(s) affected)
3> SELECT * FROM HELLOWORLD ;
HELLO WORLD DIALECT
------ ------ --------
You Are Welcome!
(1 row(s) affected)
- Copy the runtime catalog (i.e helloworld.jar ) and deployment.xml to the other nodes on same path /opt/testvoltdb
Node 2 & 3
6. start the database and join the nodes to main cluster node (node-1)
# voltdb create host <node1-hostname> catalog helloworld.jar deployment deployment.xml &
# sqlcmd
1 > SELECT * FROM HELLOWORLD ;
HELLO WORLD DIALECT
------ ------ --------
You Are Welcome!
(1 row(s) affected)
Thanks....!
No comments:
Post a Comment