1.環(huán)境說(shuō)明
10年專(zhuān)注成都網(wǎng)站制作,企業(yè)網(wǎng)站設(shè)計(jì),個(gè)人網(wǎng)站制作服務(wù),為大家分享網(wǎng)站制作知識(shí)、方案,網(wǎng)站設(shè)計(jì)流程、步驟,成功服務(wù)上千家企業(yè)。為您提供網(wǎng)站建設(shè),網(wǎng)站制作,網(wǎng)頁(yè)設(shè)計(jì)及定制高端網(wǎng)站建設(shè)服務(wù),專(zhuān)注于企業(yè)網(wǎng)站設(shè)計(jì),高端網(wǎng)頁(yè)制作,對(duì)PVC花箱等多個(gè)行業(yè),擁有多年的網(wǎng)站維護(hù)經(jīng)驗(yàn)。
master 192.168.0.223 mesos-master
slave 192.168.0.225 mesos-salve
2.環(huán)境準(zhǔn)備
關(guān)閉防火墻
關(guān)閉selinux
兩臺(tái)機(jī)器修改主機(jī)名master/slave
設(shè)置hosts,能互相解析
3.master和slave配置ssh互信
這里配置hadoop用戶(hù)雙機(jī)互信,因?yàn)閔adoop用hadoop用戶(hù)啟動(dòng)
master yum -y install sshpass ssh-keygen 一路回車(chē) ssh-copy-id -i ~/.ssh/id_rsa.pub hadoop@192.168.0.220 slave yum -y install sshpass ssh-keygen 一路回車(chē) ssh-copy-id -i ~/.ssh/id_rsa.pub hadoop@192.168.0.201 測(cè)試ssh對(duì)方主機(jī),不提示輸入密碼則OK
4.安裝JDK
tar zxvf jdk-8u65-linux-x64.tar.gz mv jdk1.8.0_65 /usr/jdk
4.1設(shè)置環(huán)境變量
export JAVA_HOME=/usr/jdk export JRE_HOME=/usr/jdk/jre export CLASSPATH=.:$CLASSPATH:$JAVA_HOME/lib:$JRE_HOME/lib export PATH=$PATH:$JAVA_HOME/bin:$JRE_HOME/bin 執(zhí)行 source /etc/profile
4.2測(cè)試JDK
java -version #出現(xiàn)版本信息
5.安裝mesos主從,看其他博客
安裝完成,會(huì)在/usr/local/lib下生成一個(gè)libmesos.so文件
6.安裝和配置Hadoop
master和slave
tar zxvf hadoop-2.5.0-cdh6.4.8.tar.gz mv hadoop-2.5.0-cdh6.4.8 /usr/hadoop cd /usr/hadoop mkdir -p tmp cd /usr/hadoop/ mv bin bin-mapreduce2/ ln -s bin-mapreduce1 bin mv example example-mapreduce2 ln -s example-mapreduce1 example cd etc/ mv hadoop hadoop-mapreduce2 ln -s hadoop-mapreduce1 hadoop
7.添加hadoop環(huán)境變量
vim /etc/profile export HADOOP_HOME=/usr/hadoop export PATH=$PATH:$HADOOP_HOME:$HADOOP_HOME/bin source /etc/profile
8.獲取hadoop on mesos的jar包
yum -y install maven openjdk-7-jdk git git clone cd hadoop mvn package #獲取jar包,jar包會(huì)在target下
9.把獲取的jar包放到hadoop安裝目錄下
master和slave
cp hadoop/target/hadoop-mesos-0.1.0.jar /usr/hadoop/share/hadoop/common/lib/
10.配置hadoop on mesos
master和slave
vim /usr/hadoop/etc/hadoop/mapred.site.xml <property> <name>mapred.job.tracker</name> <value>localhost:9001</value> </property> <property> <name>mapred.jobtracker.taskScheduler</name> <value>org.apache.hadoop.mapred.MesosScheduler</value> </property> <property> <name>mapred.mesos.taskScheduler</name> <value>org.apache.hadoop.mapred.JobQueueTaskScheduler</value> </property> <property> <name>mapred.mesos.master</name> <value>zk://192.168.0.223</value> </property> <property> <name>mapred.mesos.executor.uri</name> <value>hdfs://localhost:9000/hadoop-2.5.0-cdh6.2.0.tar.gz</value> </property>
11.給hadoop用戶(hù)權(quán)限
master和slave
chown -R hadoop:hadoop /usr/hadoop
12.在master上啟動(dòng)jobtracker,連接mesos
su hadoop MESOS_NATIVE_LIBRARY=/usr/local/lib/libmesos.so hadoop jobtracker
13.測(cè)試
輸入 192.168.0.223:5050 看看框架里有沒(méi)有hadoop
----------------------------------------------------------------------------------------
二、搭建完HDFS,搭建hadoop on mesos
按照搭建hadoop文檔配置完HDFS,需要配置core-site.xml,hdfs-site.xml,mapred-site.xml
mv bin bin-mapreduce2 ln -s bin-mapreduce1 bin #不用移動(dòng)hadoop,搭建hadoop on mesos 的時(shí)候直接在hadoop里修改
2.移動(dòng)hdfs命令和start-dfs.sh
cd /usr/hadoop/bin-mapreduce2 cp hdfs /usr/hadoop/bin-mapreduce1 cd /usr/hadoop/sbin cp start-dfs.sh /sur/hadoop/bin-mapreduce1
3.搭建hadoop on mesos
修改mapred-site.xml配置文件
<property> <name>mapred.job.tracker</name> <value>localhost:9002</value> #改為9002 避免和hdfs-site.xml中的端口沖突 </property> <property> <name>mapred.jobtracker.taskScheduler</name> <value>org.apache.hadoop.mapred.MesosScheduler</value> </property> <property> <name>mapred.mesos.taskScheduler</name> <value>org.apache.hadoop.mapred.JobQueueTaskScheduler</value> </property> <property> <name>mapred.mesos.master</name> <value>zk://192.168.0.223</value> </property> <property> <name>mapred.mesos.executor.uri</name> <value>hdfs://localhost:9000/hadoop-2.5.0-cdh6.2.0.tar.gz</value> </property>
4.格式化和啟動(dòng)HDFS
hdfs namenode -foramt start-dfs.sh
5.啟動(dòng)hadoop on mesos
su hadoop MESOS_NATIVE_LIBRARY=/usr/local/lib/libmesos.so hadoop jobtracker
當(dāng)前名稱(chēng):centos7安裝hadoop-cdh-2.5onmesos
鏈接地址:http://m.newbst.com/article24/ispcje.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供ChatGPT、做網(wǎng)站、面包屑導(dǎo)航、外貿(mào)建站、Google、外貿(mào)網(wǎng)站建設(shè)
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶(hù)投稿、用戶(hù)轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀(guān)點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話(huà):028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來(lái)源: 創(chuàng)新互聯(lián)