一、zk单独搭建
1.修改配置文件:conf/zoo.cfg
- tickTime=2000
- dataDir=/home/hadoop/data/zookeeper
- clientPort=2181
- initLimit=5
- syncLimit=2
- server.1=slave-01:2888:3888
- server.2=slave-02:2888:3888
- server.3=slave-03:2888:3888
2.生成myid文件
- 在slave-01中
- echo "1" > /home/hadoop/data/zookeeper/myid
- 在slave-02中
- echo "2" > /home/hadoop/data/zookeeper/myid
- 在slave-03中
- echo "3" > /home/hadoop/data/zookeeper/myid
3.需要在每台机子上,启动zk
- zkServer.sh start
4.检验zk
- zkServer.sh status
二、hbase
1.修改hbase-site.xml配置文件
- <configuration>
- <property>
- <name>hbase.rootdir</name>
- <value>hdfs://slave-1:9000/hbase</value>
- </property>
- <property>
- <name>hbase.cluster.distributed</name>
- <value>true</value>
- </property>
- <property>
- <name>hbase.zookeeper.property.clientPort</name>
- <value>2181</value>
- </property>
- <property>
- <name>hbase.zookeeper.quorum</name>
- <value>slave-01,slave-02,slave-03</value>
- </property>
- <property>
- <name>hbase.zookeeper.property.dataDir</name>
- <value>/home/hadoop/temp/zookeeper</value>
- </property>
- <property>
- <name>dfs.support.append</name>
- <value>true</value>
- </property>
- </configuration>
2.hbase-env.sh
- export JAVA_HOME=/usr/lib/java/jdk1.6.0_25 //JDK的安装目录
- export HBASE_CLASSPATH=/home/hadoop/hadoop-1.0.3/conf //hadoop的安装目录
- export HBASE_MANAGES_ZK=false
3.regionservers
- slave-01
- slave-02
- slave-03