IT数码 购物 网址 头条 软件 日历 阅读 图书馆
TxT小说阅读器
↓语音阅读,小说下载,古典文学↓
图片批量下载器
↓批量下载图片,美女图库↓
图片自动播放器
↓图片自动播放器↓
一键清除垃圾
↓轻轻一点,清除系统垃圾↓
开发: C++知识库 Java知识库 JavaScript Python PHP知识库 人工智能 区块链 大数据 移动开发 嵌入式 开发工具 数据结构与算法 开发测试 游戏开发 网络协议 系统运维
教程: HTML教程 CSS教程 JavaScript教程 Go语言教程 JQuery教程 VUE教程 VUE3教程 Bootstrap教程 SQL数据库教程 C语言教程 C++教程 Java教程 Python教程 Python3教程 C#教程
数码: 电脑 笔记本 显卡 显示器 固态硬盘 硬盘 耳机 手机 iphone vivo oppo 小米 华为 单反 装机 图拉丁
 
   -> 大数据 -> zookeeper的安装和基本使用 -> 正文阅读

[大数据]zookeeper的安装和基本使用

  • 安装:
  1. zookeeper-3.4.6.tar.gz 解压到/app/zookeeper-3.4.6 目录

tar -zxvf zookeeper-3.4.6.tar.gz

(2) conf目录下,修改zoo.cfg ?dataDir 集群信息,conf目录下(具体配置见下表)

cp zoo_sample.cfg zoo.cfg

新建data目录:

mkdir -p /app/zookeeper-3.4.6/data

# 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=/app/zookeeper-3.4.6/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

server.0=192.168.56.101:2888:3888

server.1=192.168.56.102:2888:3888

server.2=192.168.56.103:2888:3888

  1. myid 配置本机节点,$dataDir? 目录下

echo "0" > /app/zookeeper-3.4.6/data/myid

  1. 拷贝完整目录到其他两台机器,修改myid即可

  • 配置环境变量

(1)vi /etc/profile

#set zookeeper environment

export ZK_HOME=/app/zookeeper-3.4.6

export PATH=$PATH:$ZK_HOME/bin

(2)生效环境变量

source /etc/profile

  • 主要命令脚本

启动zookeeper服务

zkServer.sh start

停止命令:

zkServer.sh stop

重启命令:

zkServer.sh restart

查看集群节点状态:

zkServer.sh status

  • 问题
  1. 需要关闭防火墙

查看防火墙状态:?systemctl status firewalld.service

绿的running表示防火墙开启

执行关闭命令:?systemctl stop firewalld.service

再次执行查看防火墙命令:systemctl status firewalld.service

执行开机禁用防火墙自启命令??: systemctl disable firewalld.service

启动:systemctl start firewalld.service

防火墙随系统开启启动? : systemctl enable firewalld.service

firewall-cmd --permanent --add-port=3306/tcp

service firewalld restart

2,日志文件 zookeeper.out? (建议修改目录,否则,日志生产是在当前执行命令的路径下)

(1)修改 ZK_HOME/conf/log4j.properties 文件:

zookeeper.log.dir=/app/zookeeper-3.4.6/logs

zookeeper.tracelog.dir=/app/zookeeper-3.4.6/logs

  1. 修改?ZK_HOME/bin/zkEnv.sh?文件,标红部分:

if [ "x${ZOO_LOG_DIR}" = "x" ]

then

????ZOO_LOG_DIR="/app/zookeeper-3.4.6/logs"

fi

  大数据 最新文章
实现Kafka至少消费一次
亚马逊云科技:还在苦于ETL?Zero ETL的时代
初探MapReduce
【SpringBoot框架篇】32.基于注解+redis实现
Elasticsearch:如何减少 Elasticsearch 集
Go redis操作
Redis面试题
专题五 Redis高并发场景
基于GBase8s和Calcite的多数据源查询
Redis——底层数据结构原理
上一篇文章      下一篇文章      查看所有文章
加:2021-07-10 14:37:33  更:2021-07-10 14:39:11 
 
开发: C++知识库 Java知识库 JavaScript Python PHP知识库 人工智能 区块链 大数据 移动开发 嵌入式 开发工具 数据结构与算法 开发测试 游戏开发 网络协议 系统运维
教程: HTML教程 CSS教程 JavaScript教程 Go语言教程 JQuery教程 VUE教程 VUE3教程 Bootstrap教程 SQL数据库教程 C语言教程 C++教程 Java教程 Python教程 Python3教程 C#教程
数码: 电脑 笔记本 显卡 显示器 固态硬盘 硬盘 耳机 手机 iphone vivo oppo 小米 华为 单反 装机 图拉丁

360图书馆 购物 三丰科技 阅读网 日历 万年历 2024年5日历 -2024/5/7 6:03:42-

图片自动播放器
↓图片自动播放器↓
TxT小说阅读器
↓语音阅读,小说下载,古典文学↓
一键清除垃圾
↓轻轻一点,清除系统垃圾↓
图片批量下载器
↓批量下载图片,美女图库↓
  网站联系: qq:121756557 email:121756557@qq.com  IT数码