README.md

zkcmd : Tools to Administer 'Zookeeper' Instances with Four-letter Commands

'Zookeeper' enables super-easy multi-node configuration management for distributed computing. The 'Zookeeper' instances themselves can be managed by issuing "four-letter words" over a TCP socket connection.. Methods are provided to interface with this administrative API.

The following functions are implemented inside the zmckd reference class:

Installation

devtools::install_git("https://gitlab.com/hrbrmstr/zkcmd.git")
options(width=120)

Usage

library(zkcmd)

# current verison
packageVersion("zkcmd")
## [1] '0.1.0'
zk <- zkcmd$new()

zk$ruok()
## [1] TRUE
str(zk$srvr())
## List of 9
##  $ Zookeeper version  : chr "3.4.9-1757313, built on 08/23/2016 06:50 GMT"
##  $ Latency min/avg/max: chr "0/0/1006"
##  $ Received           : chr "399330"
##  $ Sent               : chr "402434"
##  $ Connections        : chr "3"
##  $ Outstanding        : chr "0"
##  $ Zxid               : chr "0x2904"
##  $ Mode               : chr "standalone"
##  $ Node count         : chr "28"
str(zk$conf())
## List of 8
##  $ clientPort       : chr "2181"
##  $ dataDir          : chr "/usr/local/var/run/zookeeper/data/version-2"
##  $ dataLogDir       : chr "/usr/local/var/run/zookeeper/data/version-2"
##  $ tickTime         : chr "2000"
##  $ maxClientCnxns   : chr "60"
##  $ minSessionTimeout: chr "4000"
##  $ maxSessionTimeout: chr "40000"
##  $ serverId         : chr "0"
zk$isro()
## [1] "rw"
zk$cons()
## $clients
## [1] "/10.1.10.163:54152[1](queued=0,recved=71404,sent=73121,sid=0x1591fe694e80102,lop=PING,est=1482445512294,to=40000,lcxid=0x1b6e,lzxid=0x2904,lresp=1483305120149,llat=0,minlat=0,avglat=0,maxlat=1006)"
## [2] "/10.1.10.129:50063[1](queued=0,recved=0,sent=0)"                                                                                                                                                     
## [3] "/127.0.0.1:59183[0](queued=0,recved=1,sent=0)"
zk$srst()

Test Results

library(zkcmd)
library(testthat)

date()
## [1] "Sun Jan  1 16:12:05 2017"
test_dir("tests/")
## testthat results ========================================================================================================
## OK: 0 SKIPPED: 0 FAILED: 0
## 
## DONE ===================================================================================================================


hrbrmstr/zkcmd documentation built on May 17, 2019, 5:54 p.m.