文档章节

在mac OSX中安装启动zookeeper

徐学良
 徐学良
发布于 2017/04/08 22:37
字数 556
阅读 31
收藏 0

安装

zookeeper支持brew安装。

$brew info zookeeper
zookeeper: stable 3.4.6 (bottled), HEAD
Centralized server for distributed coordination of services
https://zookeeper.apache.org/
/usr/local/Cellar/zookeeper/3.4.6_1 (208 files, 13M) *
  Poured from bottle
From: 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
==> Caveats
To have launchd start zookeeper at login:
  ln -sfv /usr/local/opt/zookeeper/*.plist ~/Library/LaunchAgents
Then to load zookeeper now:
  launchctl load ~/Library/LaunchAgents/homebrew.mxcl.zookeeper.plist
Or, 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
==> Caveats
To have launchd start zookeeper at login:
  ln -sfv /usr/local/opt/zookeeper/*.plist ~/Library/LaunchAgents
Then to load zookeeper now:
  launchctl load ~/Library/LaunchAgents/homebrew.mxcl.zookeeper.plist
Or, 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/zookeeper
defaults        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 default
Using config: /usr/local/etc/zookeeper/zoo.cfg
Usage: ./zkServer.sh {start|start-foreground|stop|restart|status|upgrade|print-cmd}

$ zkServer  status
JMX enabled by default
Using config: /usr/local/etc/zookeeper/zoo.cfg
Error contacting service. It is probably not running.

$ zkServer  start
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] 
[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] 
  •  

本文转载自:http://blog.csdn.net/whereismatrix/article/details/50420099

共有 人打赏支持
徐学良
粉丝 23
博文 213
码字总数 13841
作品 0
浦东
程序员
私信 提问
在mac OSX中安装启动zookeeper(采用brew安装方式)

前言 项目需要,所以,在mac OSX中安装了一下zookeeper。 安装 查看 安装 安装后,在 已经有了缺省配置 查看缺省配置文件 缺省内容如下: 启动服务 执行命令 查看zookeeper运行及状态 安装后...

u014534808
05/12
0
0
mac:macOS开机恢复系统或选择不同系统

如果您无法从 macOS 恢复功能启动 无法通过内建恢复系统启动时,新款 Mac 电脑及部分旧款 Mac 电脑会自动尝试通过互联网从 macOS 恢复功能启动。出现这种情况时,您在启动期间将会看到旋转的...

Oh_really
08/25
0
0
Mac OSX操作系统安装和配置Zend Server 6教程(1)

作为web开发人员,应该熟悉掌握各种系统下安装和配置web服务器与站点的技术。 随着越来越多的开发人员选择Zend Server服务器,慧都推出了在Mac OSX系统安装和配置Zend Server 6教程,此教程将...

kouxunli1
2013/10/15
0
0
MacOS Install Docker

使用 Homebrew 安装 macOS 我们可以使用 Homebrew 来安装 Docker。 Homebrew 的 Cask 已经支持 Docker for Mac,因此可以很方便的使用 Homebrew Cask 来进行安装: $ brew cask install dock...

Linux就该这么学
10/22
0
0
OSX malware and exploit collection (~100 files) + links and resources for OSX malware analysis

此文为关于MAC OSX系统的所有攻击脚本和溢出代码的收藏集。附带资源链接和相关讲解文档~mark下 'Tis the season. Here is a nice collection of ~100 Mac OS malware and Word document expl...

Cnlouds
2013/11/26
0
2

没有更多内容

加载失败,请刷新页面

加载更多

Confluence 6 快捷键

快捷键图标。 官方的下载地址为:https://atlassianblog.wpengine.com/wp-content/uploads/2018/01/keyboard-shortcuts-infographics.pdf...

honeymose
今天
2
0
Apache限定目录解析PHP,限制user_agent,PHP相关的配置

Apache限定目录解析PHP 配置前访问upload/index.php [root@test-a ~]# curl -x192.168.77.139:80 'www.test.com/upload/index.php'This is upload diretory 配置,/usr/local/apache2.4/......

野雪球
今天
3
0
java.util.Concurrent.Exchanger源码

类图 源码: package java.util.concurrent;import java.util.concurrent.atomic.AtomicInteger;import java.util.concurrent.atomic.AtomicReference;import java.util.concurrent......

狼王黄师傅
今天
6
0
Kubernetes里的secret最基本的用法

Secret解决了密码、token、密钥等敏感数据的配置问题,使用Secret可以避免把这些敏感数据以明文的形式暴露到镜像或者Pod Spec中。 Secret可以以Volume或者环境变量的方式使用。 使用如下命令...

JerryWang_SAP
昨天
5
0
2018-11-20学习笔记

1. python数据类型: 给变量赋值什么样的值,变量就是什么样的类型 给变量赋值整数,变量就是整数类型 给变量赋值字符串,变量就是字符串类型 123 和“123”一样吗? 在python中 单引号 与双...

laoba
昨天
3
0

没有更多内容

加载失败,请刷新页面

加载更多

返回顶部
顶部