In this section, you can run neptune on a single machine(Windows). And can create table, insert data, select data.

System Requirements

In order to run or compile neptune you need to have following software already installed on your system

  • Java Virtual Machine: JDK6
  • Hadoop: 0.17 or higher. If you want to use other Distributed File System, implements NeptuneFileSystem.
  • Zookeeper: http://hadoop.apache.org/zookeeper/

Download

You should have download a neptune distribution and unzipped it. You can find following directories.

  • bin: contains neptune shell scripts
  • conf: contains neptune configuration files
  • docs: contains neptune API docs
  • lib: contains related external libraries.
  • src: contains source files
  • build.properites
  • build.xml

Configure

1. Configure neptune: change "conf/neptune-site.xml"

<?xml version="1.0"?>
<configuration>
    <property>
        <name>neptune.filesystem</name>
        <value>local</value>
        <description>local, hadoop</description>
    </property>

    <property>
        <name>neptune.root</name>
        <value>C:/temp/neptune_local</value>
        <description>root path for data file in DFS(Hadoop)</description>
    </property>

    <property>
        <name>neptune.local.temp</name>
        <value>C:/temp/neptune_local/temp</value>
        <description>A base for other temporary directories.</description>
    </property>

    <property>
        <name>changelog.data.dir</name>
        <value>C:/temp/neptune_local/changelog</value>
        <description>path where change logs are stored.</description>
    </property>            
    
    <property>
        <name>changelog.image.dir</name>
        <value>C:/temp/neptune_local/changelog/image</value>
        <description></description>
    </property>       
</configuration>
2. Configure zookeeper: change "conf/zoo.cfg"
      	dataDir=C:/temp/neptune/zookeeper/data
			
3. change "bin/neptune.bat"
@echo off 
set JAVA_HOME="C:\Program Files\Java\jdk1.6"
set HADOOP_HOME="C:/download/hadoop-0.18.1"
...
      

Run Zookeeper

run window "command prompt"
cd ZOOKEEPER_HOME
java -cp .\zookeeper-3.1.1.jar;.\lib\log4j-1.2.15.jar;.\conf org.apache.zookeeper.server.quorum.QuorumPeerMain NEPTUNE_HOME\conf\zoo.cfg

Run LocalCluster

run window "command prompt"
C:\>cd C:\download\neptune\bin
C:\download\neptune\bin>neptune com.nhncorp.neptune.LocalCluster

Run Shell

1. Run shell
run window "command prompt"
C:\>cd C:\download\neptune\bin
C:\download\neptune\bin>neptune com.nhncorp.neptune.client.Shell
2. Create table
create table T_TEST (col1, col2);
3. Show tables
show tables;
4. Insert data
insert into T_TEST (col1, col2) values ( ( 'col1_ck1', 'col1_val1' ) , ( 'col2_ck1', 'col2_val1' ) ) where rowkey = 'rk1';
insert into T_TEST (col1, col2) values ( ( 'col1_ck2', 'col1_val2' ) , ( 'col2_ck1', 'col2_val2' ) ) where rowkey = 'rk1';
insert into T_TEST (col1, col2) values ( ( 'col1_ck2', 'col1_val2' ) , ( 'col2_ck1', 'col2_val2' ) ) where rowkey = 'rk3';
5. Select data
select * from T_TEST;
neptune shell

Run First App

Run FirstApp class in neptune-examples.jar(You can see source in "src/examples/first_apps/com/nhncorp/neptune/examples/first/FirstApp.java")
neptune com.nhncorp.neptune.examples.first.FirstApp