Skip to content
araobp edited this page Sep 16, 2015 · 10 revisions

#ODENOS management with ZooKeeper

znode tree for ODENOS management

/ ----+---- system_manager / [systemmanager]
      |
      +---- component_managers / [romgr1, romgr2, ...]
      |
      +---- components / [romgr1:network0, romgr1:lsw, ...]

When starting ODENOS, component managers (i.e., romgr1 and romgr2 in the example above) wait until the system manager has been started.

Why ZooKeeper?

ZooKeeper is used for distributed objects coordination.

For example:

  • component managers need to wait for the system manager to be up at start up -- global locking.
  • The system manager needs to monitor component managers for alive monitoring -- pubsub.
  • The system manager should not accept REST request for a component manager (or an instance of RemoteObject) if it is not alive.
  • While a component manager is restarting and resuming its in-memory state, the system manager and the other component managers need to wait for the restart process to complete -- global locking.

ZooKeeper server is embedded in a ODENOS's core process (systemmanager and resttranslater).

If you decide to run Zookeeper as standalone (not embedded in ODENOS), comment out "zookeeper.embed" in etc/odenos.conf. Running it as standalone is a better choice for high-availability.

For a debugging purpose, zkCli is useful.

$ apt-get install zookeeper

You will find zkCli in /usr/share/zookeeper/bin.

$ ./zkCli.sh
Connecting to localhost:2181
Welcome to ZooKeeper!
JLine support is enabled

WATCHER::

WatchedEvent state:SyncConnected type:None path:null
[zk: localhost:2181(CONNECTED) 0] ls /
[component_managers, system_manager, zookeeper]
[zk: localhost:2181(CONNECTED) 1] get /system_manager/systemmanager

cZxid = 0xd5
ctime = Tue Jun 02 21:03:35 JST 2015
mZxid = 0xd5
mtime = Tue Jun 02 21:03:35 JST 2015
pZxid = 0xd5
cversion = 0
dataVersion = 0
aclVersion = 0
ephemeralOwner = 0x14db427b8fd0003
dataLength = 0
numChildren = 0

For more info about ZooKeeper, refer to

Clone this wiki locally