您好,登錄后才能下訂單哦!
一、zookeeper
1、/etc/profile
HADOOP_PREFIX=/opt/hadoop
JAVA_HOME=/opt/jdk18
ZOOKEEPER_HOME=/opt/zookeeper
HBASE_HOME=/opt/hbase
PATH=$PATH:$JAVA_HOME/bin:$HADOOP_PREFIX/bin:$HADOOP_PREFIX/sbin:$ZOOKEEPER_HOME/bin:$HBASE_HOME/bin
export HADOOP_PREFIX PATH JAVA_HOME ZOOKEEPER_HOME HBASE_HOME USER LOGNAME MAIL HOSTNAME HISTSIZE HISTCONTROL
2、創(chuàng)建目錄:
mkdir -p /opt/zookeeper/data
mkdir -p /opt/zookeeper/logs
3、修改zoo.cfg配置文件,在在文件末尾添加。
server.1=NameNode34:2888:3888
server.2=DataNode35:2888:3888
server.3=DataNode37:2888:3888
server.4=DataNode38:2888:3888
dataDir=/opt/zookeeper/data
dataLogDir=/opt/zookeeper/logs
4、創(chuàng)建myid文件
在dataDir目錄下創(chuàng)建myid文件,該文件的內(nèi)容根據(jù)server定義的不同而不同,如server.1 該文件的內(nèi)容是1,server.2 該文件內(nèi)容是 2,以此類推.
節(jié)點(diǎn)1
echo "1">myid
節(jié)點(diǎn)2
echo "2">myid
節(jié)點(diǎn)3
echo "3">myid
節(jié)點(diǎn)4
echo "4">myid
5、拷貝至其他節(jié)點(diǎn)
scp /etc/profile root@DataNode35:/etc/profile
scp /etc/profile root@DataNode37:/etc/profile
scp /etc/profile root@DataNode38:/etc/profile
scp -r /opt/zookeeper root@DataNode35:/opt
scp -r /opt/zookeeper root@DataNode37:/opt
scp -r /opt/zookeeper root@DataNode38:/opt
6、在每個(gè)節(jié)點(diǎn)上
source /etc/profile
7、在每個(gè)節(jié)點(diǎn)上執(zhí)行 zkServer.sh start
JMX enabled by default
Using config: /usr1/zookeeper/bin/../conf/zoo.cfg
Starting zookeeper ... STARTED
1.8 驗(yàn)證
[hadoop1@node4 bin]$ ./zkServer.sh status
JMX enabled by default
Using config: /usr1/zookeeper/bin/../conf/zoo.cfg
Mode: leader
[hadoop1@node1 bin]$ ./zkServer.sh status
JMX enabled by default
Using config: /usr1/zookeeper/bin/../conf/zoo.cfg
Mode: follower
[hadoop1@node2 bin]$ ./zkServer.sh status
JMX enabled by default
Using config: /usr1/zookeeper/bin/../conf/zoo.cfg
Mode: follower
[hadoop1@node3 bin]$ ./zkServer.sh status
JMX enabled by default
Using config: /usr1/zookeeper/bin/../conf/zoo.cfg
Mode: follower
-- The End --
二、hbase
1、下載hbase
2、/etc/profile
HADOOP_PREFIX=/opt/hadoop
JAVA_HOME=/opt/jdk18
ZOOKEEPER_HOME=/opt/zookeeper
HBASE_HOME=/opt/hbase
PATH=$PATH:$JAVA_HOME/bin:$HADOOP_PREFIX/bin:$HADOOP_PREFIX/sbin:$ZOOKEEPER_HOME/bin:$HBASE_HOME/bin
export HADOOP_PREFIX PATH JAVA_HOME ZOOKEEPER_HOME HBASE_HOME USER LOGNAME MAIL HOSTNAME HISTSIZE HISTCONTROL
3、修改配置文件/opt/hbase/conf/hbase-env.sh
export JAVA_HOME=/opt/jdk18/
export HBASE_CLASSPATH=/opt/hbase/conf
export HBASE_MANAGES_ZK=true
4、在hbase安裝目錄下建立tmp文件夾
mkdir tmp
5、修改hbase-site.xml
<configuration>
<property>
<name>hbase.rootdir</name>
<value>hdfs://NameNode34:9000/hbase</value>
</property>
<property>
<name>hbase.cluster.distributed</name>
<value>true</value>
</property>
<property>
<name>hbase.tmp.dir</name>
<value>/opt/hbase/tmp</value>
</property>
<property>
<name>hbase.zookeeper.quorum</name>
<value>NameNode34,DataNode35,DataNode37,DataNode38</value>
</property>
<property>
<name>hbase.zookeeper.property.dataDir</name>
<value>/opt/hbase/tmp/zookeeper</value>
</property>
</configuration>
6、編輯/opt/hbase/conf/regionservers,將所有的slavenode添加到這個(gè)文件
NameNode34
DataNode35
DataNode37
DataNode38
7、將Hbase拷貝到其他節(jié)點(diǎn)機(jī)并對(duì)其他節(jié)點(diǎn)機(jī)配置環(huán)境變量
scp /etc/profile root@DataNode35:/etc/profile
scp /etc/profile root@DataNode37:/etc/profile
scp /etc/profile root@DataNode38:/etc/profile
scp -r /opt/hbase root@DataNode35:/opt
scp -r /opt/hbase root@DataNode37:/opt
scp -r /opt/hbase root@DataNode38:/opt
8、在每個(gè)節(jié)點(diǎn)上
source /etc/profile
9、在主節(jié)點(diǎn)啟動(dòng)hbase(只在主節(jié)點(diǎn)啟動(dòng)就OK)
start-hbase.sh
10、驗(yàn)證hbase
jps
11、測(cè)試hbase shell
hbase shell
Create ‘test’,’data’
Disable ‘test’
Dorp ‘test’
參考:
zookeeper:
http://blog.chinaunix.net/uid-77311-id-4580114.html
hbase:
http://blog.itpub.net/28929558/viewspace-1204409
免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如果涉及侵權(quán)請(qǐng)聯(lián)系站長(zhǎng)郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。