Friday, May 18, 2012

Oracle NoSQL configuration

The Oracle NoSQL database is a very simple to deploy NoSQL key-value store which requires almost no setup. However keep in mind the almost part. There are some things that you have to configure. You can configure this via the commandline or by deploying it with a correct config.xml file. If you have not configured the NoSQL database and/or did not deploy a correct config.xml file you will end up with an error message like the one below. What you can see in this error message is that we are trying to start the NoSQL KVstore and that it is looking for the config.xml file however is unable to locate it.

05-05-12 12:20:16:09 CEST INFO [snaService] Starting, configuration file: /home/nosql/kv-1.2.123/config.xml
05-05-12 12:20:16:42 CEST SEVERE [snaService] Failed to start SNA: IOException parsing file: /home/nosql/kv-1.2.123/config.xml: /home/nosql/kv-1.2.123/config.xml (No such file or directory)
java.lang.IllegalStateException: IOException parsing file: /home/nosql/kv-1.2.123/config.xml: /home/nosql/kv-1.2.123/config.xml (No such file or directory)
    at oracle.kv.impl.param.LoadParameters.load(
    at oracle.kv.impl.param.LoadParameters.getParameters(
    at oracle.kv.impl.util.ConfigUtils.getBootstrapParams(
    at oracle.kv.impl.sna.StorageNodeAgent.start(
    at oracle.kv.impl.sna.StorageNodeAgentImpl.main(
    at oracle.kv.impl.util.KVStoreMain$
    at oracle.kv.impl.util.KVStoreMain.main(

This means that the issue can be resolved quite easy by deploying a config.xml file. You can create one and deploy it by using something like VI. The file should look like the one below:

<config version="1">
<component name="bootstrapParams" type="bootstrapParams">
<property name="hostingAdmin" value="false" type="BOOLEAN"/>
<property name="adminHttpPort" value="5001" type="INT"/>
<property name="storageNodeId" value="0" type="INT"/>
<property name="hostname" value="" type="STRING"/>
<property name="registryPort" value="5000" type="INT"/>
<property name="haPortRange" value="5010,5020" type="STRING"/>

if you are not that comfortable with building your own config.xml you can use the makebootconfig command to build the xml file for you as shown in the example below:

java -jar ./lib/kvstore-1.2.123.jar makebootconfig -root /home/nosql/kv-1.2.123/ -port 5000 -admin 5001 -host -harange 5010,5020
Post a Comment