真实的国产乱ⅩXXX66竹夫人,五月香六月婷婷激情综合,亚洲日本VA一区二区三区,亚洲精品一区二区三区麻豆

成都創(chuàng)新互聯(lián)網(wǎng)站制作重慶分公司

hadoopha+zookeeper+hbase

一、環(huán)境

巴林右旗網(wǎng)站制作公司哪家好,找成都創(chuàng)新互聯(lián)公司!從網(wǎng)頁設(shè)計(jì)、網(wǎng)站建設(shè)、微信開發(fā)、APP開發(fā)、響應(yīng)式網(wǎng)站建設(shè)等網(wǎng)站項(xiàng)目制作,到程序開發(fā),運(yùn)營維護(hù)。成都創(chuàng)新互聯(lián)公司從2013年開始到現(xiàn)在10年的時(shí)間,我們擁有了豐富的建站經(jīng)驗(yàn)和運(yùn)維經(jīng)驗(yàn),來保證我們的工作的順利進(jìn)行。專注于網(wǎng)站建設(shè)就選成都創(chuàng)新互聯(lián)公司。

1、系統(tǒng):Red Hat Enterprise Linux Server release 6.4

2、所需軟件包

    hadoop-2.2.0.tar.gz  

    hbase-0.98.2-hadoop2-bin.tar.gz  

    jdk-7u67-linux-x64.tar.gz  

    zookeeper-3.4.6.tar.gz

3、各機(jī)器運(yùn)行服務(wù)

192.168.10.40 master1 namenode resourcemanager   ZKFC   hmaster  

192.168.10.41 master2 namenode                   ZKFC   hmaster(backup)

192.168.10.42 slave1  datanode nodemanager  journalnode  hregionserver  zookeeper

192.168.10.43 slave2  datanode nodemanager  journalnode  hregionserver  zookeeper

192.168.10.44 slave3  datanode nodemanager  journalnode  hregionserver  zookeeper

二、安裝步驟:(為了便于同步,一般都是在master1上操作)

1、ssh無密碼登錄

(mkdir -m700 .ssh)

2、jdk的安裝(每臺都是)

1)、解壓

tar zxf jdk-7u67-linux-x64.tar.gz 

ln -sf jdk1.7.0_67 jdk

2)、配置

sudo vim /etc/profile

export JAVA_HOME=/home/richmail/jdk

export PATH=$JAVA_HOME/bin:$PATH

export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar

3)執(zhí)行,使生效

source /etc/profile

3、zookeeper的安裝

1)解壓

tar zxf zookeeper-3.4.6.tar.gz 

ln -sf zookeeper-3.4.6 zookeeper

2)、配置

vim zookeeper/bin/zkEnv.sh

ZOO_LOG_DIR="/home/richmail/zookeeper/logs"

cd zookeeper/conf

cp zoo_sample.cfg zoo.cfg

vim zoo.cfg

tickTime=2000

initLimit=10

syncLimit=5

dataDir=/home/richmail/zookeeper/data

dataLogDir=/home/richmail/zookeeper/logs

clientPort=2181

server.1=slave1:2888:3888

server.2=slave2:2888:3888

server.3=slave3:2888:3888

mkdir -p /home/richmail/zookeeper/{data,logs}

3)、復(fù)制到slave1,slave2,slave3上 

cd

scp -rv zookeeper slave1:~/ 

ssh slave1 ‘echo 1 > /home/richmail/zookeeper/data/myid’

scp -rv zookeeper slave2:~/  

ssh slave1 ‘echo 2 > /home/richmail/zookeeper/data/myid'

scp -rv zookeeper slave3:~/  

ssh slave1 ‘echo 3 > /home/richmail/zookeeper/data/myid’

4)、啟動zookeeper

分別去slave1,slave2,slave3區(qū)啟動zookeeper

cd ~/zookeeper/bin

./zkServer.sh start

4、hadoop的安裝

1)、解壓

tar zxf hadoop-2.2.0.tar.gz

ln -sf hadoop-2.2.0 hadoop

2)、配置

cd /home/richmail/hadoop/etc/hadoop

vim core-site.xml

fs.defaultFS

hdfs://cluster

hadoop.tmp.dir

/home/richmail/hadoop/storage/tmp

ha.zookeeper.quorum

slave1:2181,slave2:2181,slave3:2181

mkdir -p /home/richmail/hadoop/storage/tmp

vim hadoop-env.sh 

export JAVA_HOME=/home/richmail/jdk

export HADOOP_PID_DIR=/var/hadoop/pids  //默認(rèn) /tmp下

vim hdfs-site.xml 

dfs.nameservices

cluster

dfs.ha.namenodes.cluster

master1,master2

dfs.namenode.rpc-address.cluster.master1

master1:9000

dfs.namenode.rpc-address.cluster.master2

master2:9000

dfs.namenode.http-address.cluster.master1

master1:50070

dfs.namenode.http-address.cluster.master2

master2:50070

dfs.namenode.shared.edits.dir

qjournal://slave1:8485;slave2:8485;slave3:8485/cluster

dfs.ha.automatic-failover.enabled

true

dfs.client.failover.proxy.provider.cluster

org.apache.hadoop.hdfs.server.namenode.ha.ConfiguredFailoverProxyProvider

dfs.ha.fencing.methods

sshfence

dfs.ha.fencing.ssh.private-key-files

/home/richmail/.ssh/id_rsa

dfs.journalnode.edits.dir

/home/richmail/hadoop/storage/journal

mkdir -p /home/richmail/hadoop/storage/journal

vim mapred-site.xml

mapreduce.framework.name

yarn

vim yarn-env.sh

export YARN_PID_DIR=/var/hadoop/pids

 vim yarn-site.sh

yarn.resourcemanager.hostname

master1

yarn.nodemanager.aux-services

mapreduce_shuffle

vim slaves

slave1

slave2

slave3

3)、復(fù)制至其他機(jī)器

cd

scp -rv hadoop master2:~/

scp -rv hadoop slaver1:~/

scp -rv hadoop slaver2:~/

scp -rv hadoop slaver3:~/

4)、啟動hadoop

1)、在slave1,slave2,slave3上執(zhí)行journalnode

cd ~/hadoop/sbin

./hadoop-daemon.sh start journalnode

2)、在master1上執(zhí)行

cd ~/hadoop/bin

./hdfs zkfc -formatZK

./hdfs namenode -format

cd ../sbin

./hadoop-daemon.sh start namenode

./start-all.sh

3)、在master2上執(zhí)行

cd ~/hadoop/bin

hdfs namenode -bootstrapStandby

cd ../sbin

hadoop-daemon.sh start namenode

5)、驗(yàn)證

使用瀏覽器訪問192.168.10.40:50070和192.168.10.41:50070,能夠看到兩個(gè)節(jié)點(diǎn)。一個(gè)是active,一個(gè)是standny

或者在名字節(jié)點(diǎn)執(zhí)行命令:

hdfs haadmin -getServiceState master1

hdfs haadmin -getServiceState master2

執(zhí)行hdfs haadmin –failover –forceactive master1 master2,可以使這兩個(gè)節(jié)點(diǎn)的狀態(tài)進(jìn)行交換

5、hbase的安裝

1)、解壓

tar zxf hbase-0.98.2-hadoop2-bin.tar.gz 

ln -sf hbase-0.98.2-hadoop2 hbase 

2)、配置

cd ~/hbase/conf

vim hbase-env.sh

export JAVA_HOME=/home/richmail/jdk

export HBASE_MANAGES_ZK=false

vim hbase-env.sh 

export HBASE_PID_DIR=/var/hadoop/pids

vim regionservers

slave1

slave2

slave3

vim hbase-site.xml 

hbase.rootdir

hdfs://cluster/hbase

hbase.master

60000

hbase.zookeeper.quorum

slave1,slave2,slave3

hbase.zookeeper.property.clientPort

2181

hbase.zookeeper.property.dataDir

/home/richmail/hbase/zkdata

hbase.cluster.distributed

true

hbase.tmp.dir

/home/richmail/hbase/data

mkdir ~/hbase/{zkdata,data}

hbase有個(gè)啟動錯誤需要把hadoop的配置文件hdfs-site.xml復(fù)制到hbase/conf下,才能解決

3)、復(fù)制至其他機(jī)器

cd

scp -rv hbase master2:~/

scp -rv hbase slaver1:~/

scp -rv hbase slaver2:~/

scp -rv hbase slaver3:~/

4)、啟動hbase

在master1上執(zhí)行

cd ~/hbase/bin

./start-hbase.sh

在master2上執(zhí)行

./bin/hbase-daemon.sh start master --backup

至此這個(gè)集群就部署OK啦


當(dāng)前題目:hadoopha+zookeeper+hbase
文章來源:http://weahome.cn/article/gehhhg.html

其他資訊

在線咨詢

微信咨詢

電話咨詢

028-86922220(工作日)

18980820575(7×24)

提交需求

返回頂部