将/home/hadoop/hadoop/conf/目录下的hbase-site.xml、regionserver和hbase-env.sh拷贝到/home/hadoop/hbase-config/目录下;编辑hbase-site.xml配置文件,如下:<property> <name>hbase.rootdir</name> <value>hdfs://master:9000/hbase</value> </property> <property> <name>hbase.cluster.distributed</name> <value>true</value> </property> <property> <name>hbase.master</name> <value>master</value> </property> <property> <name>hbase.zookeeper.quorum</name> <value>s1,s2</value> </property> <property> <name>zookeeper.session.timeout</name> <value>60000000</value> </property> <property> <name>hbase.zookeeper.property.clientport</name> <value>2222</value> </property>2、编辑regionserver文件S1 S23、编辑hbase-env.xml文件export JAVA_HOME=/usr/java/jdk1.6.0_26/ export CLASSPATH=$CLASSPATH:$JAVA_HOME/lib:$JAVA_HOME/jre/lib export PATH=$JAVA_HOME/bin:$PATH:$CATALINA_HOME/bin export HADOOP_HOME=/home/hadoop/hadoop export HBASE_HOME=/home/hadoop/hbase export HBASE_MANAGES_ZK=true export PATH=$PATH:/home/hadoop/hbase/bin4、复制文件到集群丛机scp -r /home/hadoop/hbase s1:/home/hadoop scp -r /home/hadoop/hbase s2:/home/hadoop5、进入/home/hadoop/zookeeper/conf/中(1)cp zoo_sample.cfg zoo.cfg(2)vim 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. dataDir=/home/hadoop/zookeeper/data # the port at which the clients will connect clientPort=2181 server.1=s1:2888:3888 server.2=s2:2888:3888(3)touch myid*编辑:1(此序号设置和zoo.cfg里面的server设置要对应)scp -r /home/hadoop/zookeeper s1:/home/hadoop scp -r /home/hadoop/zookeeper s2:/home/hadoop(4)在所有的节点执行chown -R hadoop.hadoop /home/hadoop启动hbase集群:(1)/home/hadoop/hbase/bin/start-base.sh(2)执行jps显示Hmaster是否启动(3)执行bin/hbase shell(4)create 't1' t2'' 't3'#(测试利用hmaster插入数据) list #(显示已经插入的数据) t1+t2+t3输入:http://master:60010
新闻热点
疑难解答