Mac OSX安装启动 zookeeper

安装

zookeeper支持brew安装

?  ~ brew info zookeeper
zookeeper: stable 3.4.8 (bottled), HEAD
Centralized server for distributed coordination of services
https://zookeeper.apache.org/
Not installed
From: https://mirrors.tuna.tsinghua.edu.cn/git/homebrew-core.git/Formula/zookeeper.rb
==> Options
--with-perl
    Build Perl bindings
--with-python
    Build with python support
--HEAD
    Install HEAD version
==> Caveats
To have launchd start zookeeper now and restart at login:
  brew services start zookeeper
Or, if you don‘t want/need a background service you can just run:
  zkServer start

安装

?  ~ brew install zookeeper
==> Downloading https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles/bottles/zookeeper-3.4.8.el_capitan.bottle.tar.gz
######################################################################## 100.0%
==> Pouring zookeeper-3.4.8.el_capitan.bottle.tar.gz
==> Caveats
To have launchd start zookeeper now and restart at login:
  brew services start zookeeper
Or, if you don‘t want/need a background service you can just run:
  zkServer start
==> Summary
??  /usr/local/Cellar/zookeeper/3.4.8: 237 files, 17.6M

安装后,在/usr/local/etc/zookeeper/目录下,已经有了缺省的配置文件。

?  ~ ls /usr/local/etc/zookeeper
defaults         log4j.properties zoo.cfg          zoo_sample.cfg

缺省配置[/usr/local/etc/zookeeper/zoo.cfg] 内容如下

?  / cat /usr/local/etc/zookeeper/zoo.cfg
# The number of milliseconds of each tick
tickTime=2000
# The number of ticks that the initial
# synchronization phase can take
initLimit=10
# The number of ticks that can pass between
# sending a request and getting an acknowledgement
syncLimit=5
# the directory where the snapshot is stored.
# do not use /tmp for storage, /tmp here is just
# example sakes.
dataDir=/usr/local/var/run/zookeeper/data
# the port at which the clients will connect
clientPort=2181
# the maximum number of client connections.
# increase this if you need to handle more clients
#maxClientCnxns=60
#
# Be sure to read the maintenance section of the
# administrator guide before turning on autopurge.
#
# http://zookeeper.apache.org/doc/current/zookeeperAdmin.html#sc_maintenance
#
# The number of snapshots to retain in dataDir
#autopurge.snapRetainCount=3
# Purge task interval in hours
# Set to "0" to disable auto purge feature
#autopurge.purgeInterval=1

启动服务

执行zkServer命令

?  / zkServer
ZooKeeper JMX enabled by default
Using config: /usr/local/etc/zookeeper/zoo.cfg
Usage: ./zkServer.sh {start|start-foreground|stop|restart|status|upgrade|print-cmd}
?  / zkServer status
ZooKeeper JMX enabled by default
Using config: /usr/local/etc/zookeeper/zoo.cfg
Error contacting service. It is probably not running.
?  / zkServer start
ZooKeeper JMX enabled by default
Using config: /usr/local/etc/zookeeper/zoo.cfg
Starting zookeeper ... STARTED

查看zookeeper运行及状态

安装后,可以看到zookeeper提供了zkCli等工具进行.

?  / zkCli
Connecting to localhost:2181
Welcome to ZooKeeper!
JLine support is enabled
[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]

ps:

http://blog.csdn.net/whereismatrix/article/details/50420099

时间: 2025-01-09 09:03:29

Mac OSX安装启动 zookeeper的相关文章

HBase Mac OSX 安装笔记

HBase Mac OSX 安装笔记 本次测试安装的机器为Mac Book Pro, 系统为 OS X 10.9.4.hbase版本0.98.6.1. 使用Java版本为Oracle的JDK 1.6.0_65. 1. 下载安装 hbase-0.98.6.1 此处下载的是 0.98.6.1,下载后解压缩.解压缩后的目录为 hbase-0.98.6.1-hadoop2/ 注:hbase中已经包含hadoop,所以不用另外安装hadoop了. 2. 修改配置 (1) conf/hbase-env.sh

mac osx安装mysql

0.下载地址 http://soft.macx.cn/2068.htm 1.安装 mysql-5.6......pkg 2.安装mysqlstartup....pkg 3.安装偏好mysql.prefpane 安装后密码为 root '空' 修改mysql密码 /usr/local/mysql/bin/mysqladmin -u root password newPassWord mysql manage client我选择:Navicat Premium mac osx安装mysql

mac下安装启动Mongodb

本人最近才上手mac,在使用mac上面有很多不熟悉的地方,慢慢摸索,记录下来,以供后续翻阅与参考: 在Mac下安装MongoDB方式 第一种.用浏览器或者第三方工具下载当前版本的下载地址: http://downloads.mongodb.org/osx/mongodb-osx-x86_64-2.4.6.tgz 第二种.通过homebrew安装mongodb,terminal下运行以下指令就可以了 这里,我只讲通过homebrew来安装. 在Mac下安装MongoDB,通过homebrew 1.

MAC OSX安装多个版本的JAVA

MAC自带的jdk1.6是苹果公司自己修改的版本,被广泛应用于各种mac软件,具有不可替代性:同时,oracel发布的jdk1.7和jdk1.8有时也需要用到.因此,在mac上安装.使用多个版本的jdk具有重要意义.以下以jdk1.6和jdk1.8为例介绍安装.使用方法. 1.从JAVA官网下载jdk1.8的安装包,点击安装.这一步过后,在命令行输入java -version仍然显示为1.6,因为jdk1.8虽然被安装了,但是并没有配置. 2.现在开始配置:把jdk1.8的home文件夹软连接至

MAMP环境下为Mac OSX安装设置PHP开发环境

一.简单介绍: PHP 页需要通过 Web 服务器处理.因此,要在 PHP 进行开发,您需要访问支持 PHP 的 Web 服务器和 MySQL 数据库.phpMyAdmin 也很实用,它是 MySQL 的图形接口.这三个组件是可用于开发.测试和部署 Web 应用程序的开放源代码软件.并且都是免费的.Apache Web 服务器和 PHP 都是 Mac OS X 中预装的.但它们在默认情况下并未启用.并且,预装版的 PHP 缺少许多实用功能,并且您需要单独安装和配置 MySQL.除非您能在 Ter

【mac osx安装opencv,python总结】

在macosx下安装opencv,最大的困难在于协调python版本.由于在opencv官网上,强烈建议安装完整版的python(不建议使用mac 内置的python),所以会碰到这个多个python版本,导致opencv安装失败 1. 安装brew 2. 安装python(直接在官网下载安装包)点击.dmg文件,安装python. 在应用程序列表中会添加IDEL.pythonLauncher.buildapplet三个应用. 同时,系统默认的python被替换为新版本,新版本安装路径 /Lib

Hadoop Mac OSX 安装笔记

本次测试安装的机器为Mac Book Pro, 系统为 OS X 10.9.4.Hadoop版本2.4.1. 使用Java版本为Oracle的JDK 1.6.0_65. 1. 下载安装 Hadoop2.x 此处下载的是 2.4.1,下载后解压缩.解压缩后的目录为 hadoop-2.4.1/ 2. 修改配置 (1) hadoop-2.4.1/etc/hadoop/core-site.xml <configuration> <property> <name>fs.defau

osx安装启动mysql

安装mysql 最新版 56 brew install mysql 1 启动报错 ben:~ soul$ which mysql /usr/local/bin/mysql ben:~ soul$ mysql ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2 解决办法 运行 ben:~ soul$ mysql.server start Starting MySQL

MAC OSX 安装Git

先下载https://code.google.com/p/git-osx-installer/ 安装 控制台输入git --version查看是否安装 生成SSH key ssh-keygen -t rsa -C "your_email" 回车会出现 Generating public/private rsa key pair. Enter file in which to save the key (/Users/qifeng/.ssh/id_rsa): shinit_test En