#1.创建用户
groupadd ngboss
useradd -d /home/zk -g ngboss zk
useradd -d /home/hdfs -g ngboss hdfs
useradd -d /home/hbase -g ngboss hbase
#2.root下添加hosts信息
vi /etc/hosts
192.168.71.132 centos7-node01
192.168.71.131 centos7-node02
192.168.71.133 centos7-node03
#3.拓展
IPv4的IP是32bit的,/xx 表示从右往左多少位是掩码(不变的),余下的是可变的
192.168.0.0/16 表示 192.168.0.0 -> 192.168.255.255
192.168.0.0/16 表示 192.168.0.0 -> 192.168.255.255
192.168.0.0/24 表示 192.168.0.0 -> 192.168.0.255
#4.jdk配置
vi ~/.bash_profile
# .bash_profile
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
# +-------------------------------------+
# | J2EE'S PROFILE, DON'T MODIFY! |
# +-------------------------------------+
alias grep='grep --colour=auto'
alias vi='vim'
alias ll='ls -l'
alias ls='ls --color=auto'
alias mv='mv -i'
alias rm='rm -i'
export PS1="\[\033[01;32m\]\u@\h\[\033[01;34m\] \w \$\[\033[00m\] "
export TERM=linux
export EDITOR=vim
export PATH=${HOME}/bin:${HOME}/support/jdk/bin:${HOME}/support/ant/bin:${HOME}/support/python/bin:$PATH
export LANG=zh_CN.utf8
export PYTHONUNBUFFERED=1
export TIMOUT=3000
export HISTSIZE=1000
#5.验证jdk安装是否成功
. ~/.bash_profile
which java
#6.zoo.cfg文件配置
vi ~/etc/zoo.cfg
server.1=192.168.71.131:28880:38880
server.2=192.168.71.132:28880:38880
server.3=192.168.71.133:28880:38880
#7.acl.conf文件配置
vi ~/etc/acl.conf
192.18.0.0/16
#8.myid文件配置
vi ~/data/myid
#9.zk启动
zk@hadoop-node02 ~/bin $ ./zkServer.sh start
#10.端口验证
netstat -tnlp | grep 2181
#11.结构
zk@centos7-node01 ~ $ ls
bin data etc lib logs sbin support