mac下virtualbox 安装 zookeeper, hadoop 2.6, hbase 1.0 (安装zookeeper)

系统及软件相关信息
mac: OS X Yosemite 10.10.2
VirtualBox: 4.3.28
CentOS 7
http://isoredirect.centos.org/centos/7/isos/x86_64/CentOS-7-x86_64-DVD-1503-01.iso

JDK 1.7
Zookeeper: 3.4.6
http://www.apache.org/dyn/closer.cgi/zookeeper/
hadoop 2.6.0
https://hadoop.apache.org/releases.html
hbase 1.0.1.1
http://www.apache.org/dyn/closer.cgi/hbase/

CentOS 设置
设置主机名 vim /etc/sysconfig/network
NETWORKING=yes
HOSTNAME=vm1

设置 ip
vim /etc/sysconfig/network-scripts/ifcfg-eth0 可能不是这个名字
Adress: 192.168.56.8
Netmask: 255.255.255.0
Gateway: 192.168.56.1
ONBOOT=yes

设置主机和ip关系 vim /etc/hosts
192.168.56.8 vm1

重复上边的步骤设置第二台vm 的主机名为 vm2 , ip为192.168.56.88
设置完后三台机器主机名和ip分别为
mac 192.168.56.1
vm1 192.168.56.8
vm2 192.168.56.88

设置三台机器的相互免登陆,相关命令为
ssh-keygen -t rsa
ssh-copy-id mac

安装JDK
tar -zxvf yourjdk.tar.gz -C /usr/local/
将java添加到环境变量中 vim /etc/profile
export JAVA_HOME=/usr/local/jdk1.7.0_55
export PATH=$PATH:$JAVA_HOME/bin
刷新配置 source /etc/profile

安装 ZooKeeper
tar -zxvf zookeeper-3.4.6.tar.gz -C /usr/local/
配置 conf 目录下 mv zoo_sample.cfg zoo.cfg
更改 vi zoo.cfg
dataDir = /data/zookeeper
server.1=mac:2888:3888
server.2=vm1:2888:3888
server.3=vm2:2888:3888

新建刚设置的 dataDir 文件文件夹
在里面添加个myid 并设置为当前server 的 id

拷贝到另两台机器上,做相应的修改
scp -r zookeeper vm1:/usr/local/zookeeper

分部启动三台机器的 zookeeper
zkServer.sh start

然后用 jps 显示就会发现有这个了
QuorumPeerMain

然后三台机器中一台是 Leader,另两台为 follower
01

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s