在mac OSX中安装启动zookeeper(采用brew安装方式)

本文涉及的产品
注册配置 MSE Nacos/ZooKeeper,182元/月
任务调度 XXL-JOB 版免费试用,400 元额度,开发版规格
服务治理 MSE Sentinel/OpenSergo,Agent数量 不受限
简介: 项目需要,所以,在mac OSX中安装了一下zookeeper。

前言

项目需要,所以,在mac OSX中安装了一下zookeeper

安装

查看brew info zookeeper


$ brew info zookeeper
zookeeper: stable 3.4.12 (bottled), HEAD
Centralized server for distributed coordination of services
https://zookeeper.apache.org/


安装brew install zookeeper

$ brew install zookeeper
==> Downloading https://homebrew.bintray.com/bottles/zookeeper-3.4.12.high_sierr
######################################################################## 100.0%
==> Pouring zookeeper-3.4.12.high_sierra.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

安装后,在/usr/local/etc/zookeeper/ 已经有了缺省配置

$ ls /usr/local/etc/zookeeper/

查看缺省配置文件

$ less -N /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
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等工具进行.

$ zkServer status
ZooKeeper JMX enabled by default
Using config: /usr/local/etc/zookeeper/zoo.cfg
Error contacting service. It is probably not running.
192:~ maerfeifei$ zkServer start
ZooKeeper JMX enabled by default
Using config: /usr/local/etc/zookeeper/zoo.cfg
Starting zookeeper ... STARTED
192:~ maerfeifei$ zkCli
Connecting to localhost:2181
Welcome to ZooKeeper!
JLine support is enabled
WATCHER::
WatchedEvent state:SyncConnected type:None path:null
[zk: localhost:2181(CONNECTED) 0]


相关文章
|
7天前
|
前端开发 安全 测试技术
Postman Mac 版安装终极指南:从下载到流畅运行,一步到位
Postman 是 API 开发与测试的高效工具,支持各类 HTTP 请求调试与团队协作。本文详解 Mac 版下载、安装步骤,助你快速上手。同时推荐一体化 API 协作平台 Apifox,集文档、调试、测试于一体,提升开发效率与团队协同能力。
|
3月前
|
iOS开发 MacOS 索引
在不受支持的 Mac 上安装 macOS Tahoe 26
在不受支持的 Mac 上安装 macOS Tahoe 26
192 0
在不受支持的 Mac 上安装 macOS Tahoe 26
|
6月前
|
Ubuntu Linux Shell
Ubuntu gnome WhiteSur-gtk-theme类mac主题正确安装和卸载方式
通过这个过程,用户不仅可以定制自己的桌面外观,还可以学习到更多关于 Linux 系统管理的知识,从而更好地掌握系统配置和主题管理的技巧。
758 12
|
6月前
|
监控 Shell Linux
Android调试终极指南:ADB安装+多设备连接+ANR日志抓取全流程解析,覆盖环境变量配置/多设备调试/ANR日志分析全流程,附Win/Mac/Linux三平台解决方案
ADB(Android Debug Bridge)是安卓开发中的重要工具,用于连接电脑与安卓设备,实现文件传输、应用管理、日志抓取等功能。本文介绍了 ADB 的基本概念、安装配置及常用命令。包括:1) 基本命令如 `adb version` 和 `adb devices`;2) 权限操作如 `adb root` 和 `adb shell`;3) APK 操作如安装、卸载应用;4) 文件传输如 `adb push` 和 `adb pull`;5) 日志记录如 `adb logcat`;6) 系统信息获取如屏幕截图和录屏。通过这些功能,用户可高效调试和管理安卓设备。
|
9月前
|
存储 SpringCloudAlibaba Java
【SpringCloud Alibaba系列】一文全面解析Zookeeper安装、常用命令、JavaAPI操作、Watch事件监听、分布式锁、集群搭建、核心理论
一文全面解析Zookeeper安装、常用命令、JavaAPI操作、Watch事件监听、分布式锁、集群搭建、核心理论。
【SpringCloud Alibaba系列】一文全面解析Zookeeper安装、常用命令、JavaAPI操作、Watch事件监听、分布式锁、集群搭建、核心理论
|
10月前
|
开发工具 git 开发者
「Mac畅玩鸿蒙与硬件3」鸿蒙开发环境配置篇3 - DevEco Studio插件安装与配置
本篇将专注于如何在 DevEco Studio 中安装和配置必要的插件,以增强开发功能和提升效率。通过正确配置插件,开发流程能够得到简化,开发体验也会更加顺畅。
394 1
「Mac畅玩鸿蒙与硬件3」鸿蒙开发环境配置篇3 - DevEco Studio插件安装与配置
|
iOS开发 MacOS Windows
Mac air使用Boot Camp安装win10 ,拷贝 Windows 文件时出错
Mac air使用Boot Camp安装win10 ,拷贝 Windows 文件时出错
|
Oracle Java 关系型数据库
Mac电脑上安装和配置Flutter开发环境
Mac电脑上安装和配置Flutter开发环境
392 60
|
10月前
|
开发工具 iOS开发 开发者
「Mac畅玩鸿蒙与硬件2」鸿蒙开发环境配置篇2 - 在Mac上安装DevEco Studio
本篇将专注于如何在 Mac 上安装鸿蒙开发工具 DevEco Studio,确保开发环境能够顺利搭建。完成安装后,可以正式开始鸿蒙应用的开发工作。
653 1
「Mac畅玩鸿蒙与硬件2」鸿蒙开发环境配置篇2 - 在Mac上安装DevEco Studio