摘要: zookeeper C API 的安装和使用指南 "zookeeper C API 的安装和使用指南": 关键词:zookeeper c api 安装 使用指南 1 下载 zookeeper
来源:互联网 发布:农业 生长 大数据 编辑:程序博客网 时间:2024/06/06 01:02
1
下载 zookeeper-3.3.6.zip
编译 /zookeeper-3.3.6/src/c
./configure --prefix=/hfx/zookeeper
make
make install
--prefix 类似这种参数有多中,./configure --help
编译好后可以看到如下路径:
[hfx@74 ~]$ cd zookeeper/
[hfx@74 zookeeper]$ ll
total 24
drwxrwxr-x 2 hfx hfx 4096 mar 11 16:43 bin
drwxrwxr-x 3 hfx hfx 4096 mar 11 16:43 include
drwxrwxr-x 2 hfx hfx 4096 mar 11 16:43 lib
说明编译成功
2
使用:在cmake文件里加上编译好的lib文件路径,如果你需要编译多线程版本客户端程序,请添加编译选项 -dthreaded,同时链接时应链接 zookeeper_mt 库;如果你需要编译单线程客户端程序,请不要添加编译选项 -dthreaded,同时链接时应链接 zookeeper_st 库。
include_directories(
./
/usr/local/include
/home/hfx/zookeeper/include/c-client-src
)
link_directories(
/usr/local/lib
/home/hfx/zookeeper/lib
)
add_executable(test ${src_list})
#add_library(zoo_queue shared ${src_list})
target_link_libraries(test zookeeper_mt pthread dl)
这样便保护了编译好的lib文件
至于如何使用zookeeper 的api
具体的api可以参考官网,也可以参考其他博客,推荐这个:
http://www.makaidong.com/haippy/archive/2013/02/21/2920280.html
- 摘要: zookeeper C API 的安装和使用指南 "zookeeper C API 的安装和使用指南": 关键词:zookeeper c api 安装 使用指南 1 下载 zookeeper
- zookeeper C API 的安装和使用指南
- zookeeper使用(二) C API 安装
- zookeeper使用(三):项目中zookeeper的配置 和 zookeeper C API的使用
- zookeeper C API实例
- zookeeper C API
- Zookeeper C API 指南
- zookeeper C API
- zookeeper C API 编译
- Zookeeper C API学习总结
- ZooKeeper 下载和安装
- Zookeeper API 和 Zkclient
- ZooKeeper API 的使用
- Zookeeper提供的API
- ZooKeeper的API简介
- ZooKeeper的原生API
- ZooKeeper的安装和配置
- Zookeeper的安装和配置
- java.lang.OutOfMemoryError:GC overhead limit exceeded
- 【转载】CSDN如何转载别人的文章
- 数据库工程
- 人民币暴力拉升背后的真相
- 已解决:maven项目运行clean package 报错:3 字节的 UTF-8 序列的字节 3 无效。。。
- 摘要: zookeeper C API 的安装和使用指南 "zookeeper C API 的安装和使用指南": 关键词:zookeeper c api 安装 使用指南 1 下载 zookeeper
- Jenkins配置自动构建项目并提交到转测的svn服务器
- Windows 下统计行数的命令
- coursera机器学习课程——Programming Exercise 1:Linear Regression(选做部分)
- JavaScript判断object/json 是否为空
- Android 使用LitePal操作数据库
- Java实现Excel导入导出的工具类
- CJE log likelihood
- puppet的文件应用