ICode9

精准搜索请尝试: 精确搜索
首页 > 其他分享> 文章详细

Hadoop环境配置(zookeeper环境搭建)

2021-12-19 22:02:44  阅读:154  来源: 互联网

标签:opt bin zookeeper 环境 Hadoop module 3.5 apache


注:安装之前关闭防火墙

1、关闭防火墙

(1)、防火墙状态的查看

命令:systemctl status firewalld

(2)、关闭防火墙

命令:systemctl stop firewalld

(3)、设置开机防火墙不启动

命令:systemctl disable firewalld

2、将zookeeper安装包拉到/opt/software/文件夹中

安装包版本:apache-zookeeper-3.5.7-bin.tar.gz

3、解压zookeeper安装包到/opt/module/文件夹下

命令:

cd /opt/software/
tar -zxvf 安装包名 -C  /opt/module/ 

4、在解压后的zookeeper文件下,创建log文件夹和data文件夹

命令:cd /opt/module/apache-zookeeper-3.5.7-bin/

创建命令:

mkdir data
mkdir log

 

4、 拷贝配置文件,命令:

cd /opt/module/apache-zookeeper-3.5.7-bin/conf/
cp zoo_sample.cfg zoo.cfg
在此路径下,将zoo_sample.cfg文件拷贝一份并重命名为zoo.cfg

5、进行配置文件更改,命令:

vi 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=/opt/module/apache-zookeeper-3.5.7-bin/data
dataLogDir=/opt/module/apache-zookeeper-3.5.7-bin/log
# 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.1.100:2888:3888
server.1=192.168.1.101:2888:3888
server.2=192.168.1.102:2888:3888

6、创建服务器myid

命令:

cd /opt/module/apache-zookeeper-3.5.7-bin/data/
 
touch myid

7、集群拷贝

命令:

scp -r /opt/module/apache-zookeeper-3.5.7-bin root@hadoop101:/opt/module/apache-zookeeper-3.5.7-bin
 
将Hadoop100/opt/module/apache-zookeeper-3.5.7-bin里面的文件拷贝到Hadoop101/opt/module/apache-zookeeper-3.5.7-bin里面
 
scp -r /opt/module/apache-zookeeper-3.5.7-bin root@hadoop102:/opt/module/apache-zookeeper-3.5.7-bin
 
将Hadoop100/opt/module/apache-zookeeper-3.5.7-bin里面的文件拷贝到Hadoop102/opt/module/apache-zookeeper-3.5.7-bin里面 

8、集群myid更改

进入每个节点进行更改:

命令:cd /opt/module/apache-zookeeper-3.5.7-bin/data/

Hadoop100的myid,改成0

命令:touch myid

Hadoop101的myid,改成1

Hadoop102的myid,改成2

9、添加系统环境变量

命令:vi /etc/profile

 在页面中添加如下内容

 

export ZOOKEEPER_HOME=/opt/module/apache-zookeeper-3.5.7-bin
export PATH=$PATH:$ZOOKEEPER_HOME/bin

10、zookeeper集群启动,每个节点都要启动

命令:cd /opt/module/apache-zookeeper-3.5.7-bin

启动命令:(在100、101、102里面都要启动)

zkServer.sh start
zkServer.sh status
依次启动

 

 

 11、zkCli连接验证

命令:zkCli.sh -server hadoop100:2181

按Ctrl+Z停止运行

用jps查看出现ZooKeeperMain进程

出现QuorumPeerMain则说明zookeeper启动成功

标签:opt,bin,zookeeper,环境,Hadoop,module,3.5,apache
来源: https://blog.csdn.net/m0_64966342/article/details/122030312

本站声明: 1. iCode9 技术分享网(下文简称本站)提供的所有内容,仅供技术学习、探讨和分享;
2. 关于本站的所有留言、评论、转载及引用,纯属内容发起人的个人观点,与本站观点和立场无关;
3. 关于本站的所有言论和文字,纯属内容发起人的个人观点,与本站观点和立场无关;
4. 本站文章均是网友提供,不完全保证技术分享内容的完整性、准确性、时效性、风险性和版权归属;如您发现该文章侵犯了您的权益,可联系我们第一时间进行删除;
5. 本站为非盈利性的个人网站,所有内容不会用来进行牟利,也不会利用任何形式的广告来间接获益,纯粹是为了广大技术爱好者提供技术内容和技术思想的分享性交流网站。

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有