【大數(shù)據(jù)運(yùn)維之三】Hadoop集群搭建

image

useradd hadoop

/etc/hadoop/hadoop-env.sh

JAVA_HOME=${JAVA_HOME}
JAVA_HOME=/usr/local/java

配置文件

公共參數(shù)

core-site.xml

<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
<!--
  Licensed under the Apache License, Version 2.0 (the "License");
  you may not use this file except in compliance with the License.
  You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License. See accompanying LICENSE file.
-->

<!-- Put site-specific property overrides in this file. -->

<configuration>
<!-- name node-->
<property>
<name>fs.defaultFS</name>
<value>hdfs://mini1:9000</value>
</property>

<!-- 進(jìn)程工作的數(shù)據(jù)目錄-->
<property>
<name>hadoop.tmp.dir</name>
<value>/home/hadoop/hdpdata</value>
</property>

</configuration>

hdfs配置(可直接使用默認(rèn)值)

hdfs-site.xml

<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
<!--
  Licensed under the Apache License, Version 2.0 (the "License");
  you may not use this file except in compliance with the License.
  You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License. See accompanying LICENSE file.
-->

<!-- Put site-specific property overrides in this file. -->

<configuration>
<!-- 副本的數(shù)量,默認(rèn)值 3 -->
<property>
<name>dfs.replication</name>
<value>2</value>
</property>

</configuration>

mapreduce配置

mapred-site.xml

<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
<!--
 Licensed under the Apache License, Version 2.0 (the "License");
 you may not use this file except in compliance with the License.
 You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

 Unless required by applicable law or agreed to in writing, software
 distributed under the License is distributed on an "AS IS" BASIS,
 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 See the License for the specific language governing permissions and
 limitations under the License. See accompanying LICENSE file.
-->

<!-- Put site-specific property overrides in this file. -->

<configuration>
<!-- 運(yùn)行平臺 默認(rèn)local -->
<property>
<name>mapreduce.framework.name</name>
<value>yarn</value>
</property>

</configuration>

yarn-site.xml


<?xml version="1.0"?>
<!--
  Licensed under the Apache License, Version 2.0 (the "License");
  you may not use this file except in compliance with the License.
  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License. See accompanying LICENSE file.
-->
<configuration>

<!-- Site specific YARN configuration properties -->
<property>
<name>yarn.resourcemanager.hostname</name>
<value>mini1</value>
</property>

<property>
<name>yarn.nodemanager.aux-services</name>
<value>mapreduce_shuffle</value>
</property>
</configuration>

hadoop添加環(huán)境變量

sudo vim /etc/profile

# HADOOP
export HADOOP_HOME=/home/hadoop/apps/hadoop-2.8.5
export PATH=$PATH:${HADOOP_HOME}/bin:${HADOOP_HOME}/sbin

hdfs格式化

hadoop namenode -format

image

啟動hadoop

namenode

hadoop-daemon start namenode
hadoop-daemon stop namenode
http://****:50070
(http://10.0.1.101:50070/dfshealth.html#tab-overview)
hadoop-daemon start datanode
hadoop-daemon stop datanode

批量啟動

配置節(jié)點(diǎn)
vi etc/hadoop/slaves

mini2
mini3
mini4

執(zhí)行命令
start-all.sh(不推薦)
start-hdfs.sh
start-yarn.sh

問題

[hadoop@mini1 hadoop]$ ssh-copy-id mini1

  • /usr/bin/ssh-copy-id: ERROR: No identities found
    ~/.ssh/id_rsa id_rsa.pub文件不存在
    執(zhí)行ssh-keygen 解決
  • WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
  • 序言:七十年代末芦岂,一起剝皮案震驚了整個濱河市疾掰,隨后出現(xiàn)的幾起案子瞪浸,更是在濱河造成了極大的恐慌,老刑警劉巖绎速,帶你破解...
    沈念sama閱讀 218,607評論 6 507
  • 序言:濱河連續(xù)發(fā)生了三起死亡事件,死亡現(xiàn)場離奇詭異麻诀,居然都是意外死亡锭吨,警方通過查閱死者的電腦和手機(jī)蠢莺,發(fā)現(xiàn)死者居然都...
    沈念sama閱讀 93,239評論 3 395
  • 文/潘曉璐 我一進(jìn)店門,熙熙樓的掌柜王于貴愁眉苦臉地迎上來零如,“玉大人躏将,你說我怎么就攤上這事】祭伲” “怎么了祸憋?”我有些...
    開封第一講書人閱讀 164,960評論 0 355
  • 文/不壞的土叔 我叫張陵,是天一觀的道長肖卧。 經(jīng)常有香客問我蚯窥,道長,這世上最難降的妖魔是什么塞帐? 我笑而不...
    開封第一講書人閱讀 58,750評論 1 294
  • 正文 為了忘掉前任拦赠,我火速辦了婚禮,結(jié)果婚禮上葵姥,老公的妹妹穿的比我還像新娘荷鼠。我一直安慰自己,他們只是感情好牌里,可當(dāng)我...
    茶點(diǎn)故事閱讀 67,764評論 6 392
  • 文/花漫 我一把揭開白布颊咬。 她就那樣靜靜地躺著务甥,像睡著了一般。 火紅的嫁衣襯著肌膚如雪敞临。 梳的紋絲不亂的頭發(fā)上态辛,一...
    開封第一講書人閱讀 51,604評論 1 305
  • 那天,我揣著相機(jī)與錄音挺尿,去河邊找鬼奏黑。 笑死炊邦,一個胖子當(dāng)著我的面吹牛,可吹牛的內(nèi)容都是我干的熟史。 我是一名探鬼主播馁害,決...
    沈念sama閱讀 40,347評論 3 418
  • 文/蒼蘭香墨 我猛地睜開眼,長吁一口氣:“原來是場噩夢啊……” “哼蹂匹!你這毒婦竟也來了碘菜?” 一聲冷哼從身側(cè)響起,我...
    開封第一講書人閱讀 39,253評論 0 276
  • 序言:老撾萬榮一對情侶失蹤限寞,失蹤者是張志新(化名)和其女友劉穎忍啸,沒想到半個月后,有當(dāng)?shù)厝嗽跇淞掷锇l(fā)現(xiàn)了一具尸體履植,經(jīng)...
    沈念sama閱讀 45,702評論 1 315
  • 正文 獨(dú)居荒郊野嶺守林人離奇死亡计雌,尸身上長有42處帶血的膿包…… 初始之章·張勛 以下內(nèi)容為張勛視角 年9月15日...
    茶點(diǎn)故事閱讀 37,893評論 3 336
  • 正文 我和宋清朗相戀三年,在試婚紗的時候發(fā)現(xiàn)自己被綠了玫霎。 大學(xué)時的朋友給我發(fā)了我未婚夫和他白月光在一起吃飯的照片凿滤。...
    茶點(diǎn)故事閱讀 40,015評論 1 348
  • 序言:一個原本活蹦亂跳的男人離奇死亡,死狀恐怖鼠渺,靈堂內(nèi)的尸體忽然破棺而出鸭巴,到底是詐尸還是另有隱情,我是刑警寧澤拦盹,帶...
    沈念sama閱讀 35,734評論 5 346
  • 正文 年R本政府宣布鹃祖,位于F島的核電站,受9級特大地震影響普舆,放射性物質(zhì)發(fā)生泄漏恬口。R本人自食惡果不足惜,卻給世界環(huán)境...
    茶點(diǎn)故事閱讀 41,352評論 3 330
  • 文/蒙蒙 一沼侣、第九天 我趴在偏房一處隱蔽的房頂上張望祖能。 院中可真熱鬧,春花似錦蛾洛、人聲如沸养铸。這莊子的主人今日做“春日...
    開封第一講書人閱讀 31,934評論 0 22
  • 文/蒼蘭香墨 我抬頭看了看天上的太陽钞螟。三九已至,卻和暖如春谎碍,著一層夾襖步出監(jiān)牢的瞬間鳞滨,已是汗流浹背。 一陣腳步聲響...
    開封第一講書人閱讀 33,052評論 1 270
  • 我被黑心中介騙來泰國打工蟆淀, 沒想到剛下飛機(jī)就差點(diǎn)兒被人妖公主榨干…… 1. 我叫王不留拯啦,地道東北人澡匪。 一個月前我還...
    沈念sama閱讀 48,216評論 3 371
  • 正文 我出身青樓,卻偏偏與公主長得像褒链,于是被迫代替她去往敵國和親唁情。 傳聞我的和親對象是個殘疾皇子,可洞房花燭夜當(dāng)晚...
    茶點(diǎn)故事閱讀 44,969評論 2 355

推薦閱讀更多精彩內(nèi)容

  • 一甫匹、系統(tǒng)參數(shù)配置優(yōu)化 1荠瘪、系統(tǒng)內(nèi)核參數(shù)優(yōu)化配置 修改文件/etc/sysctl.conf,添加如下配置赛惩,然后執(zhí)行s...
    張偉科閱讀 3,754評論 0 14
  • 經(jīng)過一系列的前期環(huán)境準(zhǔn)備哀墓,現(xiàn)在可以開始Hadoop的安裝了,在這里去apache官網(wǎng)下載2.7.3的版本http:...
    歡醉閱讀 1,668評論 8 28
  • 一喷兼、理論部分知識 1篮绰、HDFS :Hadoop DIstributed File System簡寫。 易于擴(kuò)展的分...
    neimengguzn閱讀 1,529評論 0 52
  • 文/木言 “巨龍季惯,我要?dú)⒘四恪?“你們煩不煩吠各,一個接一個,我又沒有做壞事勉抓,為什么要?dú)⑽壹致俊便y鈴般的聲音響起來∨航睿幻化...
    韓梅梅閱讀 166評論 0 0
  • 媽媽隐圾,別走伍掀, 別留下我一個人睡 我好怕黑暗,孤獨(dú)的 至少暇藏,給我講一個童話蜜笤, 哄著我睡 等我睡著了 你再走好嗎, 雖...
    嬰君閱讀 260評論 0 2