install and use zookeeper C client API
2013-04-17 19:33
232 查看
1. install zookeeper in cluster
参考前面的STORM安装 /article/7172887.html
2. install zookeerper C client API
cd zookeeper-3.3.5/src/c
autoreconf -if
If this happens, we need install cppunit1.10.2 .
2.1 install cppuint1.10.2
download cppunit-cvs-1.10.2.tar.gz
tar xzvf cppunit-cvs-1.10.2.tar.gz
cd cppunit-cvs-1.10.2
sh autogen.sh
./configure
make && make install
So cppuint1.10.2 has been installed in /usr/local/share/aclocal.
We continue to install zookeeper C client API. See https://issues.apache.org/jira/browse/ZOOKEEPER-1454
ACLOCAL="aclocal -I /usr/local/share/aclocal" autoreconf -if
./configure
make && make install
3. use zookeeper C client API
cd zookeeper-3.3.5/src/c/src/
there is a file cli.c, we can compile it into a binary, cli, with the following Makefile.
[Torstan]# more Makefile
all:
g++ -c -I/usr/local/include/c-client-src -I/usr/local/zookeeper-3.3.5/src/c/include cli.c
g++ -o cli cli.o /usr/local/lib/libzookeeper_st.a
clean:
rm cli cli.o
make clean; make
[Torstan]# ./cli 127.0.0.1:2181
Watcher -1 state = CONNECTED_STATE
Got a new session id: 0x3d3564f27e0021
ls /
time = 0 msec
/: rc = 0
hello
storm
zookeeper
zk_test ginobili
time = 0 msec
For more information, please refer to http://zookeeper.apache.org/doc/r3.2.2/zookeeperOver.html
参考前面的STORM安装 /article/7172887.html
2. install zookeerper C client API
cd zookeeper-3.3.5/src/c
autoreconf -if
If this happens, we need install cppunit1.10.2 .
$ autoreconf -if >> aclocal:configure.ac:33: warning: macro `AM_PATH_CPPUNIT' not found in >> library >> aclocal:configure.ac:33: warning: macro `AM_PATH_CPPUNIT' not found in >> library >> configure.ac:33: error: possibly undefined macro: AM_PATH_CPPUNIT >> If this token and others are legitimate, please use m4_pattern_allow. >> See the Autoconf documentation. >> autoreconf: /usr/bin/autoconf failed with exit status: 1 We can see there is no directory named with /usr/local/share/aclocal.
2.1 install cppuint1.10.2
download cppunit-cvs-1.10.2.tar.gz
tar xzvf cppunit-cvs-1.10.2.tar.gz
cd cppunit-cvs-1.10.2
sh autogen.sh
./configure
make && make install
So cppuint1.10.2 has been installed in /usr/local/share/aclocal.
We continue to install zookeeper C client API. See https://issues.apache.org/jira/browse/ZOOKEEPER-1454
ACLOCAL="aclocal -I /usr/local/share/aclocal" autoreconf -if
./configure
make && make install
3. use zookeeper C client API
cd zookeeper-3.3.5/src/c/src/
there is a file cli.c, we can compile it into a binary, cli, with the following Makefile.
[Torstan]# more Makefile
all:
g++ -c -I/usr/local/include/c-client-src -I/usr/local/zookeeper-3.3.5/src/c/include cli.c
g++ -o cli cli.o /usr/local/lib/libzookeeper_st.a
clean:
rm cli cli.o
make clean; make
[Torstan]# ./cli 127.0.0.1:2181
Watcher -1 state = CONNECTED_STATE
Got a new session id: 0x3d3564f27e0021
ls /
time = 0 msec
/: rc = 0
hello
storm
zookeeper
zk_test ginobili
time = 0 msec
For more information, please refer to http://zookeeper.apache.org/doc/r3.2.2/zookeeperOver.html
相关文章推荐
- Jersey(1.19.1) - Client API, Ease of use and reusing JAX-RS artifacts
- elasticsearch install and how to use javaapi
- linux c mysql client install and usage
- Kafka 0.9+Zookeeper3.4.6集群搭建、配置,新Client API的使用要点,高可用性测试,以及各种坑
- How to use a 32bit Oracle11_g client in 64 win system and not conflict with sqldeveloper 64 bit tool
- How To Install and Use Memcache on Ubuntu 14.04
- Unable to require openssl, install OpenSSL and rebuild ruby (preferred) or use non-HTTPS sources
- Kafka 0.9+Zookeeper3.4.6集群搭建、配置,新Client API的使用要点,高可用性测试,以及各种坑
- How To Install and Use Redis
- Hadoop2.4.1 64-Bit QJM HA and YARN HA + Zookeeper-3.4.6 + Hbase-0.98.8-hadoop2-bin HA Install
- How to install and use doxygen
- install OpenSSL and rebuild ruby (preferred) or use non-HTTPS sources 和uninitialized constant Gem:
- Kafka 0.9+Zookeeper3.4.6集群搭建、配置,新Client API的使用要点,高可用性测试,以及各种坑 (转载)
- How To Install and Use the Web Application Stress (WAS) Tool
- How to build & install GLFW 3 and use it in a Linux project
- How To Install and Use Redis
- VueJs Install and useg
- install glm library in ubuntu and use it in qt
- A Guide to Blocks & Grand Central Dispatch (and the Cocoa API's making use of them)