卸载Ubuntu自带的openjdk
sudo apt-get remove openjdk*
安装JDK
检测集群时间是否同步
date
同步之
date -s(--s)
检测防火墙是否关闭
ufw disable //ubuntu 关闭防火墙
service iptables stop//centos 关闭防火墙
chkconfig iptables off //centos 防火墙开机也不会启动了
检测主机名和ip映射有没有配置
//Ubuntu下的操作
vim /etc/hostname
vim /etc/hosts
修改zookeeper的配置文件
cd zookeeper/conf
cp zoo_sample.cfg zoo.cfg
vim zoo.cig
修改dataDir
并添加
#server编号=主机名:心跳端口:选举端口
server.1=bd01:2888:3888
server.2=bd04:2888:3888
server.3=ca01:2888:3888
在dataDir下创建文件
创建文件myid。其中内容为服务器的编号