在mac OSX中安装启动zookeeper
来源:互联网 发布:淘宝助理怎么导入csv 编辑:程序博客网 时间:2024/05/21 07:07
安装
zookeeper支持brew安装。
$brew info zookeeperzookeeper: stable 3.4.6 (bottled), HEADCentralized server for distributed coordination of serviceshttps://zookeeper.apache.org//usr/local/Cellar/zookeeper/3.4.6_1 (208 files, 13M) * Poured from bottleFrom: https://github.com/Homebrew/homebrew/blob/master/Library/Formula/zookeeper.rb==> Options--with-perl Build Perl bindings--with-python Build with python support--HEAD Install HEAD version==> CaveatsTo have launchd start zookeeper at login: ln -sfv /usr/local/opt/zookeeper/*.plist ~/Library/LaunchAgentsThen to load zookeeper now: launchctl load ~/Library/LaunchAgents/homebrew.mxcl.zookeeper.plistOr, if you don't want/need launchctl, you can just run: zkServer start
安装
$brew install zookeeper==> Downloading https://homebrew.bintray.com/bottles/zookeeper-3.4.6_1.mavericks.bottle.2.tar.gz######################################################################## 100.0%==> Pouring zookeeper-3.4.6_1.mavericks.bottle.2.tar.gz==> CaveatsTo have launchd start zookeeper at login: ln -sfv /usr/local/opt/zookeeper/*.plist ~/Library/LaunchAgentsThen to load zookeeper now: launchctl load ~/Library/LaunchAgents/homebrew.mxcl.zookeeper.plistOr, if you don't want/need launchctl, you can just run: zkServer start==> Summary�� /usr/local/Cellar/zookeeper/3.4.6_1: 207 files, 13M
安装后,在/usr/local/etc/zookeeper/
目录下,已经有了缺省的配置文件。
ls /usr/local/etc/zookeeperdefaults log4j.properties zoo.cfg zoo_sample.cfg
缺省配置[/usr/local/etc/zookeeper/zoo.cfg] 内容如下
$less -N /usr/local/etc/zookeeper/zoo.cfg 1 # The number of milliseconds of each tick 2 tickTime=2000 3 # The number of ticks that the initial 4 # synchronization phase can take 5 initLimit=10 6 # The number of ticks that can pass between 7 # sending a request and getting an acknowledgement 8 syncLimit=5 9 # the directory where the snapshot is stored. 10 # do not use /tmp for storage, /tmp here is just 11 # example sakes. 12 dataDir=/usr/local/var/run/zookeeper/data 13 # the port at which the clients will connect 14 clientPort=2181 15 # the maximum number of client connections. 16 # increase this if you need to handle more clients 17 #maxClientCnxns=60 18 # 19 # Be sure to read the maintenance section of the 20 # administrator guide before turning on autopurge. 21 # 22 # http://zookeeper.apache.org/doc/current/zookeeperAdmin.html#sc_maintenance 23 # 24 # The number of snapshots to retain in dataDir 25 #autopurge.snapRetainCount=3 26 # Purge task interval in hours 27 # Set to "0" to disable auto purge feature 28 #autopurge.purgeInterval=1
启动服务
执行命令zkServer
$zkServer JMX enabled by defaultUsing config: /usr/local/etc/zookeeper/zoo.cfgUsage: ./zkServer.sh {start|start-foreground|stop|restart|status|upgrade|print-cmd}$ zkServer statusJMX enabled by defaultUsing config: /usr/local/etc/zookeeper/zoo.cfgError contacting service. It is probably not running.$ zkServer startJMX enabled by defaultUsing config: /usr/local/etc/zookeeper/zoo.cfgStarting zookeeper ... STARTED
查看zookeeper运行及状态
安装后,可以看到zookeeper提供了zkCli等工具进行.
$zkCliConnecting to localhost:2181Welcome to ZooKeeper!JLine support is enabled[zk: localhost:2181(CONNECTING) 0] [zk: localhost:2181(CONNECTING) 0] WATCHER::WatchedEvent state:SyncConnected type:None path:null[zk: localhost:2181(CONNECTED) 0] ls[zk: localhost:2181(CONNECTED) 1] ls /[zookeeper][zk: localhost:2181(CONNECTED) 2] ls /zookeeper[quota][zk: localhost:2181(CONNECTED) 3] ls /zookeeper/quota[][zk: localhost:2181(CONNECTED) 4]
2 0
- 在mac OSX中安装启动zookeeper
- Mac OSX安装启动 zookeeper
- Mac OSX安装启动 zookeeper
- 在PC上安装Mac OSX x86
- 在PC上安装Mac OSX全记录
- 在Mac OSX系统下安装Tomcat
- 在Mac OSX 10.10 上安装opencv
- 在Mac OSX中配置CTags插件
- Mac OSX中memcached安装测试
- Mac OSX中memcached安装测试
- 在Mac OSX启动时运行程序的方法
- Mac OSX安装Git
- Mac OSX 安装 Faq
- Mac OSX安装brew
- Mac OSX安装Git
- mac osx安装groovy
- Mac OSX 安装Docker
- Mac OSX安装MySQL
- AIDL
- 自定义View时,用到Paint Canvas的一些温故,讲讲平时一些效果是怎么画的(基础篇 一)
- Spring AOP初级入门-代码篇之XML
- Boost.Bind用法详解
- 关于String的两种赋值方式
- 在mac OSX中安装启动zookeeper
- 可点击的ImageSpan
- Maven多环境配置实战 filter
- hadoop-(2)wordcount运行
- 使用Maven创建Java项目
- goal
- Android截屏浅析
- QQ提示信息的拖动效果
- 【spring-security】j_spring_security_check 404