[PATCH osv-apps] Add Oracle NoSQL DB

106 views
Skip to first unread message

Asias He

unread,
Apr 17, 2014, 4:39:55 AM4/17/14
to osv...@googlegroups.com
Check README for more info.

Signed-off-by: Asias He <as...@cloudius-systems.com>
---
modules.json | 4 ++++
oracle-nosql-db/GET | 9 +++++++++
oracle-nosql-db/Makefile | 8 ++++++++
oracle-nosql-db/README | 15 +++++++++++++++
oracle-nosql-db/module.py | 5 +++++
oracle-nosql-db/usr.manifest | 1 +
6 files changed, 42 insertions(+)
create mode 100755 oracle-nosql-db/GET
create mode 100644 oracle-nosql-db/Makefile
create mode 100644 oracle-nosql-db/README
create mode 100644 oracle-nosql-db/module.py
create mode 100644 oracle-nosql-db/usr.manifest

diff --git a/modules.json b/modules.json
index f07b56c..935c97b 100644
--- a/modules.json
+++ b/modules.json
@@ -70,5 +70,9 @@
"leveldb" : {
"type": "direct-dir",
"path": "${OSV_BASE}/apps/leveldb/"
+},
+"oracle-nosql-db" : {
+ "type": "direct-dir",
+ "path": "${OSV_BASE}/apps/oracle-nosql-db/"
}
}
diff --git a/oracle-nosql-db/GET b/oracle-nosql-db/GET
new file mode 100755
index 0000000..f3b3704
--- /dev/null
+++ b/oracle-nosql-db/GET
@@ -0,0 +1,9 @@
+set -e
+VERSION=3.0.5
+SRC_DIR=kv-ce-$VERSION
+TARBALL=$SRC_DIR.tar.gz
+if [ ! -e $TARBALL ];then
+ wget http://download.oracle.com/otn-pub/otn_software/nosql-database/$TARBALL
+fi
+rm -rf $SRC_DIR
+tar zxf $TARBALL
diff --git a/oracle-nosql-db/Makefile b/oracle-nosql-db/Makefile
new file mode 100644
index 0000000..a43d563
--- /dev/null
+++ b/oracle-nosql-db/Makefile
@@ -0,0 +1,8 @@
+.PHONY: module
+module: src
+
+.PHONY: src
+src:
+ ./GET
+clean:
+ rm -rf kv-* kv-ce-*.tar.gz
diff --git a/oracle-nosql-db/README b/oracle-nosql-db/README
new file mode 100644
index 0000000..6c19b9f
--- /dev/null
+++ b/oracle-nosql-db/README
@@ -0,0 +1,15 @@
+*) Start the database instace
+$ make image=oracle-nosql-db
+$ sudo sudo scripts/run.py -nv
+
+*) Test it on host
+$ cd kv-3.0.5
+$ javac -cp examples:lib/kvclient.jar examples/hello/HelloBigDataWorld.java
+$ java -cp examples:lib/kvclient.jar hello.HelloBigDataWorld -host 192.168.122.89
+Hello Big Data World!
+
+*) Note
+The -host ip addres can be changed in module.py.
+
+*) For more info
+http://www.oracle.com/technetwork/database/database-technologies/nosqldb/overview/index.html
diff --git a/oracle-nosql-db/module.py b/oracle-nosql-db/module.py
new file mode 100644
index 0000000..8e611c5
--- /dev/null
+++ b/oracle-nosql-db/module.py
@@ -0,0 +1,5 @@
+from osv.modules import api
+
+api.require('java')
+
+default = api.run_java(args=['-jar', '/usr/oracle/kv-3.0.5/lib/kvstore.jar', 'kvlite', '-host', '192.168.122.89'])
diff --git a/oracle-nosql-db/usr.manifest b/oracle-nosql-db/usr.manifest
new file mode 100644
index 0000000..a1447e6
--- /dev/null
+++ b/oracle-nosql-db/usr.manifest
@@ -0,0 +1 @@
+/usr/oracle/kv-3.0.5/**: ${MODULE_DIR}/kv-3.0.5/**
--
1.8.5.3

Nadav Har'El

unread,
Apr 17, 2014, 4:47:29 AM4/17/14
to Asias He, Osv Dev
On Thu, Apr 17, 2014 at 11:39 AM, Asias He <as...@cloudius-systems.com> wrote:

+++ b/oracle-nosql-db/module.py
@@ -0,0 +1,5 @@
+from osv.modules import api
+
+api.require('java')
+
+default = api.run_java(args=['-jar', '/usr/oracle/kv-3.0.5/lib/kvstore.jar', 'kvlite', '-host', '192.168.122.89'])

What is this IP address, the guest's IP address? Must we have it hard-coded (this obviously depends on how you run this guest)? Without this "-host" parameter, doesn't it work?

Asias He

unread,
Apr 17, 2014, 5:04:04 AM4/17/14
to Nadav Har'El, Osv Dev
It is the guest's IP address. I tried '-host 0.0.0.0' but it does not
work. Without the -host parameter, it will only listen on localhost.
I hate to hardcode it but....

--
Asias

Avi Kivity

unread,
Apr 17, 2014, 6:04:09 AM4/17/14
to Asias He, Nadav Har'El, Osv Dev
I guess we have to implement environment variables, and substitution,
and expose the guest IP as OSV_IPV4_ADDRESS or something.

Pekka Enberg

unread,
Apr 17, 2014, 8:39:55 AM4/17/14
to Avi Kivity, Asias He, Nadav Har'El, Osv Dev
On Thu, Apr 17, 2014 at 1:04 PM, Avi Kivity <a...@cloudius-systems.com> wrote:
>> It is the guest's IP address. I tried '-host 0.0.0.0' but it does not
>> work. Without the -host parameter, it will only listen on localhost.
>> I hate to hardcode it but....
>
> I guess we have to implement environment variables, and substitution, and
> expose the guest IP as OSV_IPV4_ADDRESS or something.

We can do that but I'd first like to know why "0.0.0.0" does not work?
We're using it for Cassandra without any problems.

Avi Kivity

unread,
Apr 17, 2014, 10:17:25 AM4/17/14
to Pekka Enberg, Asias He, Nadav Har'El, Osv Dev
You can only listen on 0.0.0.0, not connect to it. If the startup
sequence includes a connection, it will fail.

Avi Kivity

unread,
Apr 17, 2014, 10:24:36 AM4/17/14
to Pekka Enberg, Asias He, Nadav Har'El, Osv Dev
Actually, it worked for me on the host, so something is fishy.

Asias He

unread,
Apr 17, 2014, 10:26:34 AM4/17/14
to Avi Kivity, Pekka Enberg, Nadav Har'El, Osv Dev
Yes, -host 0.0.0.0 works for me on host too but not on osv.

--
Asias

Avi Kivity

unread,
Apr 17, 2014, 10:30:04 AM4/17/14
to Asias He, Pekka Enberg, Nadav Har'El, Osv Dev
I saw in the source it does gethostbyaddr(0.0.0.0), maybe that bit
doesn't fail correctly.

Asias He

unread,
Apr 17, 2014, 8:10:46 PM4/17/14
to Avi Kivity, Pekka Enberg, Nadav Har'El, Osv Dev
-------> on guest
[asias@hjpc osv]$ sudo scripts/run.py -nV
4 CPUs detected
OSv v0.07-20-g4a1a240
VFS: mounting ramfs at /
VFS: mounting devfs at /dev
RAM disk at 0x0xffffc0003eeb4000 (4096K bytes)
net: initializing - done
eth0: ethernet address: 52:54:0:12:34:56
virtio-blk: Add blk device instances 0 as vblk0, devsize=10842275840
VFS: mounting zfs at /zfs
zfs: mounting osv/zfs from device /dev/vblk0.1
VFS: mounting devfs at /dev
VFS: mounting procfs at /proc
BSD shrinker: event handler list found: 0xffffc0003fbf3e80
BSD shrinker found: 1
BSD shrinker: unlocked, running
[I/35 dhcp]: Waiting for IP...
[I/35 dhcp]: Waiting for IP...
[I/35 dhcp]: Waiting for IP...
[I/206 dhcp]: Server acknowledged IP for interface eth0
[I/206 dhcp]: Configuring eth0: ip 192.168.122.89 subnet mask
255.255.255.0 gateway 192.168.122.1 MTU 0
WARNING: fcntl(F_SETLK) stubbed
vfork stubbed
vfork stubbed
vfork stubbed
Opened existing kvlite store with config:
-root ./kvroot -store kvstore -host 0.0.0.0 -port 5000 -admin 5001
pthread_setcancelstate() stubbed

-------> on host


[asias@hjpc kv-3.0.5]$ java -cp examples:lib/kvclient.jar
hello.HelloBigDataWorld -host 192.168.122.89
oracle.kv.FaultException: Could not contact any RepNode at:
[192.168.122.89:5000] (12.1.3.0.5)
Fault class name: oracle.kv.KVStoreException
at oracle.kv.KVStoreFactory.getStoreInternal(KVStoreFactory.java:236)
at oracle.kv.KVStoreFactory.getStore(KVStoreFactory.java:143)
at oracle.kv.KVStoreFactory.getStore(KVStoreFactory.java:85)
at hello.HelloBigDataWorld.<init>(HelloBigDataWorld.java:127)
at hello.HelloBigDataWorld.main(HelloBigDataWorld.java:82)
Caused by: oracle.kv.KVStoreException: Could not contact any RepNode
at: [192.168.122.89:5000]
at oracle.kv.impl.util.TopologyLocator.getInitialTopology(TopologyLocator.java:237)
at oracle.kv.impl.util.TopologyLocator.get(TopologyLocator.java:103)
at oracle.kv.impl.api.RequestDispatcherImpl.<init>(RequestDispatcherImpl.java:360)
at oracle.kv.KVStoreFactory.getStoreInternal(KVStoreFactory.java:228)
... 4 more
Caused by: java.rmi.ConnectException: Connection refused to host:
0.0.0.0; nested exception is:
java.net.ConnectException: Connection refused
at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:619)
at sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:216)
at sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:202)
at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:129)
at java.rmi.server.RemoteObjectInvocationHandler.invokeRemoteMethod(RemoteObjectInvocationHandler.java:194)
at java.rmi.server.RemoteObjectInvocationHandler.invoke(RemoteObjectInvocationHandler.java:148)
at com.sun.proxy.$Proxy0.getSerialVersion(Unknown Source)
at oracle.kv.impl.util.registry.RemoteAPI.<init>(RemoteAPI.java:69)
at oracle.kv.impl.rep.admin.RepNodeAdminAPI.<init>(RepNodeAdminAPI.java:82)
at oracle.kv.impl.rep.admin.RepNodeAdminAPI.wrap(RepNodeAdminAPI.java:91)
at oracle.kv.impl.util.TopologyLocator.getInitialTopology(TopologyLocator.java:200)
... 7 more
Caused by: java.net.ConnectException: Connection refused
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:339)
at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:198)
at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:182)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
at java.net.Socket.connect(Socket.java:579)
at oracle.kv.impl.util.registry.ClientSocketFactory.createTimeoutSocket(ClientSocketFactory.java:374)
at oracle.kv.impl.util.registry.ClientSocketFactory.createSocket(ClientSocketFactory.java:354)
at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:613)
... 17 more


[asias@hjpc kv-3.0.5]$ java -jar lib/kvstore.jar ping -host
192.168.122.89 -port 5000
SNA at hostname: 192.168.122.89 registry port: 5000 has no available
Admins or RNs registered.


--
Asias

Asias He

unread,
Apr 17, 2014, 8:16:48 PM4/17/14
to Pekka Enberg, Avi Kivity, Nadav Har'El, Osv Dev
Some of the cluster applications do need to specify the ip address of
a particular node. So providing a way to tell the application its ip
address sounds useful.

--
Asias

Avi Kivity

unread,
Apr 20, 2014, 3:14:37 AM4/20/14
to Asias He, Pekka Enberg, Nadav Har'El, Osv Dev
If we had strace on the guest we'd know in an instant.

The closest thing we have is tracepoints, you can add (and commit)
tracepoints to the libc socket API and see if it's binding correctly.

Reply all
Reply to author
Forward
0 new messages