perl 安装Net::ZooKeeper
<pre name="code" class="python"><pre name="code" class="python"> use Net::ZooKeeper qw(:node_flags :acls); my $zkh = Net::ZooKeeper->new('localhost:7000'); zjzc01:/zookeeper/server1# cd src
zjzc01:/zookeeper/server1/src# cd c
zjzc01:/zookeeper/server1/src/c# ls
acinclude.m4 c-doc.Doxyfile config.guess configure.ac INSTALL Makefile.am README zookeeper.vcproj
aclocal.m4 ChangeLog config.h.in depcomp install-sh Makefile.in src
aminclude.am Cli.vcproj config.sub generated LICENSE missing tests
autom4te.cache compile configure include ltmain.sh NOTICE.txt zookeeper.sln
zjzc01:/zookeeper/server1/src/c# ./configure zjzc01:/zookeeper/server1/src/c# make zjzc01:/zookeeper/server1/src/c# make install zjzc01:/zookeeper/server1/src/c# ./cli_mt 192.168.32.34:2181
Watcher SESSION_EVENT state = CONNECTED_STATE
Got a new session id: 0x15436e4ca970005
ls /
time = 3 msec
/: rc = 0
dubbo
zookeeper
time = 3 msec [root@rocket c]# ./configure [root@rocket c]# make [root@rocket c]# make install 然后再安装模块:
zjzc01:/root# cpan Net::ZooKeeper 查看模块安装: zjzc01:/usr/local/perl/lib/site_perl/5.22.1/Test/TCP# perldoc -l Net::ZooKeeper
/usr/local/perl/lib/site_perl/5.22.1/x86_64-linux/Net/ZooKeeper.pm zjzc01:/root# cat zook.pl
use Net::ZooKeeper qw(:node_flags :acls); my $zkh = Net::ZooKeeper->new('192.168.32.34:2181'); $zkh->create('/foo', 'bar',
'flags' => ZOO_EPHEMERAL,
'acl' => ZOO_OPEN_ACL_UNSAFE) or
die("unable to create node /foo: " . $zkh->get_error() . "\n"); print "node /foo has value: " . $zkh->get('/foo') . "\n"
zjzc01:/root# perl zook.pl
node /foo has value: bar [zk: localhost:2181(CONNECTED) 16] create /zk "mydata"
Created /zk
[zk: localhost:2181(CONNECTED) 17] get /zk
mydata
cZxid = 0x1000000ef
ctime = Thu Apr 21 13:08:24 CST 2016
mZxid = 0x1000000ef
mtime = Thu Apr 21 13:08:24 CST 2016
pZxid = 0x1000000ef
cversion = 0
dataVersion = 0
aclVersion = 0
ephemeralOwner = 0x0
dataLength = 6
numChildren = 0 zjzc01:/root# cat zook.pl
use Net::ZooKeeper qw(:node_flags :acls); my $zkh = Net::ZooKeeper->new('192.168.32.34:2181'); $zkh->create('/foo', 'xxxxyyyy',
'flags' => ZOO_EPHEMERAL,
'acl' => ZOO_OPEN_ACL_UNSAFE) or
die("unable to create node /foo: " . $zkh->get_error() . "\n"); print "node /foo has value: " . $zkh->get('/foo') . "\n";
print "node /zk has value: " . $zkh->get('/zk') . "\n";
print "node /liu has value: " . $zkh->get('/liu') . "\n"
zjzc01:/root# perl zook.pl
node /foo has value: xxxxyyyy
node /zk has value: mydata
node /liu has value: testdata112233
perl 安装Net::ZooKeeper的更多相关文章
- 安装hadoop+zookeeper ha
安装hadoop+zookeeper ha 前期工作配置好网络和主机名和关闭防火墙 chkconfig iptables off //关闭防火墙 1.安装好java并配置好相关变量 (/etc/pro ...
- 配置perl-cgi的运行环境,由于Active Perl安装在d:\perl
Apache 1.3.22 for Win32+PHP 4.0.6+Active Perl 5.006001+Zend Optimizer v1.1.0+mod_gzip 1.3.19.1a+MySQ ...
- Ubuntu 16下单机安装配置zookeeper和kafka
网上其他的没有一个能直接照做完成的,我这个也是看了些帖子,整出来的怕以后忘记 建议连接工具:Bitvise SSH Client 一.安装配置zookeeper 下载zookeeper 3.4.13: ...
- ZooKeeper系列(1):安装搭建ZooKeeper环境
ZooKeeper系列文章:https://www.cnblogs.com/f-ck-need-u/p/7576137.html#zk ZooKeeper有三种安装模式:单机安装(standalone ...
- window安装配置 zookeeper 单机模式
1.zookeeper简单介绍 zookeeper是一个分布式的,开放源码的分布式应用程序协调服务,我所了解到的主要的使用场景有两个 (1).微服务注册中心(Dubbo较常用Zookeeper做注册中 ...
- 安装配置ZooKeeper及基本用法
要想学习分布式应用,ZooKeeper是一个绕不过去的基础系统.它为大型分布式计算提供开源的分布式配置服务.同步服务和命名注册. 今天先介绍系统的安装和基本使用,后续会推一些基本的Java使用代码. ...
- Hadoop集群搭建-02安装配置Zookeeper
Hadoop集群搭建-05安装配置YARN Hadoop集群搭建-04安装配置HDFS Hadoop集群搭建-03编译安装hadoop Hadoop集群搭建-02安装配置Zookeeper Hado ...
- mac下安装php zookeeper扩展
安装步骤 php-zookeeper依赖libzookeeper,所以需要先安装libzookeeper 安装libzookeeper cd /usr/local/src/ wget http://m ...
- perl 安装 ZooKeeper模块
1072 ./configure --libdir=/usr/lib 1073 make 1074 make install 1075 cpan ZooKeeper [root@wx03 c]# pe ...
随机推荐
- 【hadoop】14、hadoop2.5的mapreduce的 配置
配置mapreduce <?xml version="1.0"?> <?xml-stylesheet type="text/xsl" href ...
- Android TextView 实现文字大小不同和文字颜色不同
效果图如下: 关键代码如下: StringBuffer sb = new StringBuffer(); if(day > 0) { sb.append("<a href=\&q ...
- chrome 、 火狐等浏览器对空格符 解析不同,页面显示不一致
最近初学web,从头开始,菜鸟级别,遇到的小问题记录下来. 网上资料说 空格在ie.firefox.chrome浏览器上显示的效果不太一样,主要是前面的空格宽度不同,这可能是因为不同的浏览器会有不同的 ...
- js后缀判断
var extension=fileName.substring(fileName.lastIndexOf('.')+1);
- Java 网络编程(四) InetAddress类
链接地址:http://www.cnblogs.com/mengdd/archive/2013/03/09/2951895.html Java 网络编程(四) InetAddress类 InetAdd ...
- win7 64位 Xsheel
Xsheel5安装后,找不到.dll文件,系统支持不好,不用 Xshell4有时提示 1152:Error 就使用 链接:http://pan.baidu.com/s/1c1s42Y0 密码:098x ...
- CentOS5.4下安装codeblocks 12.11
centos6.3下安装codeblock简单多了,这些开源的软件也都在不断进步.原来装过codeblocks10.05,忘了,这次安装又花了我半天时间,最后总算搞定. 先是安装了wxGTK-2.8. ...
- 批量 GBK 转 UTF8 java
package encoding; import java.io.File; import java.io.IOException; import java.util.Collection; impo ...
- TCP/IP笔记 三.运输层(4)——TCP链接管理与TCP状态机
1. 建立连接 三次握手 (1)A 的 TCP 向 B 发出连接请求报文段,其首部中的同步比特 SYN 应置为 1,并选择序号 x,表明传送数据时的第一个数据字节的序号是 x. (2)B 的 TCP ...
- HDU 3415 Max Sum of Max-K-sub-sequence
题目大意:找长度不超过k的最大字段和. 题解:单调队列维护之前k的最小值,思想是对于每一个入队的新元素,如果队尾元素比其大则一直删减,然后插入新元素,对于队首的元素若与当前枚举两相差超过k则直接删去. ...