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


Charles Lamb said...

Hi Johan,

Creating your own config.xml is not recommended. As you discovered, using the makebootconfig command is much easier and less error prone.

Charles Lamb

Johan Louwers said...

True, the best way is to do it via the CLI and not by building your own config.xml file. However,.... it is an option and can be part of your deployment strategy when you have to deploy large numbers of servers and want to have pre-defined config.xml files. One could state that you can also run the CLI option during mass deployments however, it is good to know that you have both options.

However, the CLI way is the best and most secure way :-)

Unknown said...

Could you demonstrate how to add/deploy a new node in the store? I have a virtualbox setup where I can communicate between two virtual images of linux servers. I am deploying a KVstore with both my images as storage nodes. I can do it on the first since it acts as a host for me. Second node is a problem. It just shows "Problem during plan execution: snaService" error when I am trying to deploy the SN. Please help.