【實驗】Hadoop2.6.0的偽分佈安裝
hadoop-2.6.0.tar.gz:
jdk-7u79-linux-x64.gz:
1 設定ip地址
執行命令 service network restart
驗證: ifconfig
2 關閉防火牆
執行命令 service iptables stop
驗證: service iptables status
3 關閉防火牆的自動執行
執行命令 chkconfig iptables off
驗證: chkconfig --list | grep iptables
4 設定主機名
執行命令
(1)hostname hadoop1
(2)vi /etc/sysconfig/network
NETWORKING=yes
NETWORKING_IPV6=yes
HOSTNAME=hadoop1
5 ip與hostname繫結
執行命令 (1)vi /etc/hosts
192.168.23.131 hadoop1.localdomain hadoop1
驗證: ping hadoop1
6 設定ssh免密碼登陸
執行命令
(1)ssh-keygen -t rsa
(2)cp ~/.ssh/id_rsa.pub ~/.ssh/authorized_keys
驗證:
[root@test1 ~]# ssh hadoop1
The authenticity of host 'hadoop1 (192.168.23.131)' can't be established.
RSA key fingerprint is e9:9f:f2:ea:f2:aa:47:58:5f:12:ea:3c:50:3f:0d:1b.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'hadoop1,192.168.23.131' (RSA) to the list of known hosts.
Last login: Thu Feb 11 20:54:11 2016 from 192.168.23.1
[root@hadoop1 ~]# ssh hadoop1
Last login: Thu Feb 11 20:57:56 2016 from hadoop1.localdomain
7 安裝jdk http://my.oschina.net/gaowm/blog/275184
(1)執行命令
(2)vi /etc/profile 增加內容如下:
export JAVA_HOME=/usr/share/java/jdk1.7.0_79
export PATH=.:$JAVA_HOME/bin:$PATH
(3)source /etc/profile
驗證: java -version
8 安裝hadoop
(1)執行命令
(2)vi /etc/profile 增加內容如下:
export JAVA_HOME=/usr/share/java/jdk1.7.0_79
export HADOOP_HOME=/usr/local/hadoop
export PATH=.:$HADOOP_HOME/bin:$JAVA_HOME/bin:$PATH
(3)source /etc/profile
(4)修改/usr/local/hadoop/etc/hadoop目錄下的配置檔案hadoop-env.sh、core-site.xml、hdfs-site.xml、mapred-site.xml
(5)hadoop namenode -format
(6)start-all.sh
驗證: (1)執行命令jps 如果看到5個新的java程式,分別是NameNode、SecondaryNameNode、DataNode、ResourceManager、NodeManager
(2)在瀏覽器檢視
hadoop web控制檯頁面的埠整理:
50070:hdfs檔案管理 http://192.168.23.131:50070
8088:ResourceManager http://192.168.23.131:8088
8042:NodeManager http://192.168.23.131:8042
9 啟動時沒有NameNode的可能原因:
(1)沒有格式化
(2)環境變數設定錯誤
(3)ip與hostname繫結失敗
參考:
http://stark-summer.iteye.com/blog/2184123
jdk-7u79-linux-x64.gz:
1 設定ip地址
點選(此處)摺疊或開啟
-
[root@test1 ~]# vi /etc/sysconfig/network-scripts/ifcfg-eth0
-
# Intel Corporation 82545EM Gigabit Ethernet Controller (Copper)
-
DEVICE=eth0
-
BOOTPROTO=none
-
ONBOOT=yes
-
HWADDR=00:0c:29:51:cc:37
-
TYPE=Ethernet
-
NETMASK=255.255.255.0
-
IPADDR=192.168.23.131
-
GATEWAY=192.168.23.1
-
USERCTL=no
-
IPV6INIT=no
- PEERDNS=yes
驗證: ifconfig
2 關閉防火牆
執行命令 service iptables stop
驗證: service iptables status
3 關閉防火牆的自動執行
執行命令 chkconfig iptables off
驗證: chkconfig --list | grep iptables
4 設定主機名
執行命令
(1)hostname hadoop1
(2)vi /etc/sysconfig/network
NETWORKING=yes
NETWORKING_IPV6=yes
HOSTNAME=hadoop1
5 ip與hostname繫結
執行命令 (1)vi /etc/hosts
192.168.23.131 hadoop1.localdomain hadoop1
驗證: ping hadoop1
6 設定ssh免密碼登陸
執行命令
(1)ssh-keygen -t rsa
(2)cp ~/.ssh/id_rsa.pub ~/.ssh/authorized_keys
驗證:
[root@test1 ~]# ssh hadoop1
The authenticity of host 'hadoop1 (192.168.23.131)' can't be established.
RSA key fingerprint is e9:9f:f2:ea:f2:aa:47:58:5f:12:ea:3c:50:3f:0d:1b.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'hadoop1,192.168.23.131' (RSA) to the list of known hosts.
Last login: Thu Feb 11 20:54:11 2016 from 192.168.23.1
[root@hadoop1 ~]# ssh hadoop1
Last login: Thu Feb 11 20:57:56 2016 from hadoop1.localdomain
7 安裝jdk http://my.oschina.net/gaowm/blog/275184
(1)執行命令
點選(此處)摺疊或開啟
-
[root@hadoop1 java]# cd /usr/share/java
-
[root@hadoop1 java]# cd
-
[root@hadoop1 ~]# cd /usr/share/java
-
[root@hadoop1 java]# cp /tmp/jdk-7u79-linux-x64.gz ./
- [root@hadoop1 java]# tar -xzvf jdk-7u79-linux-x64.gz
export JAVA_HOME=/usr/share/java/jdk1.7.0_79
export PATH=.:$JAVA_HOME/bin:$PATH
(3)source /etc/profile
驗證: java -version
8 安裝hadoop
(1)執行命令
點選(此處)摺疊或開啟
-
[root@hadoop1 ~]# cd /usr/local/
-
[root@hadoop1 local]# cp /tmp/hadoop-2.6.0.tar.gz ./
-
[root@hadoop1 local]# tar -zxvf hadoop-2.6.0.tar.gz
- [root@hadoop1 local]# mv hadoop-2.6.0 hadoop
export JAVA_HOME=/usr/share/java/jdk1.7.0_79
export HADOOP_HOME=/usr/local/hadoop
export PATH=.:$HADOOP_HOME/bin:$JAVA_HOME/bin:$PATH
(3)source /etc/profile
(4)修改/usr/local/hadoop/etc/hadoop目錄下的配置檔案hadoop-env.sh、core-site.xml、hdfs-site.xml、mapred-site.xml
點選(此處)摺疊或開啟
-
[root@hadoop1 hadoop]# vi hadoop-env.sh
-
export JAVA_HOME=/usr/share/java/jdk1.7.0_79
-
-
[root@hadoop1 hadoop]# vi core-site.xml
-
<configuration>
-
<property>
-
<name>fs.default.name</name>
-
<value>hdfs://hadoop1:9000</value>
-
</property>
-
<property>
-
<name>hadoop.tmp.dir</name>
-
<value>/usr/local/hadoop/tmp</value>
-
</property>
-
-
</configuration>
-
-
-
[root@hadoop1 hadoop]# vi hdfs-site.xml
-
-
<configuration>
-
<property>
-
<name>dfs.replication</name>
-
<value>1</value>
-
</property>
-
<property>
-
<name>dfs.permissions</name>
-
<value>false</value>
-
</property>
-
-
</configuration>
-
~
-
-
[root@hadoop1 hadoop]# cp mapred-site.xml.template mapred-site.xml
-
[root@hadoop1 hadoop]# vi mapred-site.xml
-
<configuration>
-
<property>
-
<name>mapred.job.tracker</name>
-
<value>hadoop1:9001</value>
-
</property>
-
- </configuration>
(5)hadoop namenode -format
(6)start-all.sh
點選(此處)摺疊或開啟
-
[root@hadoop1 hadoop]# cd sbin
-
[root@hadoop1 sbin]# start-all.sh
-
This script is Deprecated. Instead use start-dfs.sh and start-yarn.sh
-
16/02/11 21:40:54 WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
-
Starting namenodes on [hadoop1]
-
hadoop1: starting namenode, logging to /usr/local/hadoop/logs/hadoop-root-namenode-hadoop1.out
-
The authenticity of host 'localhost (127.0.0.1)' can't be established.
-
RSA key fingerprint is e9:9f:f2:ea:f2:aa:47:58:5f:12:ea:3c:50:3f:0d:1b.
-
Are you sure you want to continue connecting (yes/no)? yes
-
localhost: Warning: Permanently added 'localhost' (RSA) to the list of known hosts.
-
localhost: starting datanode, logging to /usr/local/hadoop/logs/hadoop-root-datanode-hadoop1.out
-
Starting secondary namenodes [0.0.0.0]
-
The authenticity of host '0.0.0.0 (0.0.0.0)' can't be established.
-
RSA key fingerprint is e9:9f:f2:ea:f2:aa:47:58:5f:12:ea:3c:50:3f:0d:1b.
-
Are you sure you want to continue connecting (yes/no)? yes
-
0.0.0.0: Warning: Permanently added '0.0.0.0' (RSA) to the list of known hosts.
-
0.0.0.0: starting secondarynamenode, logging to /usr/local/hadoop/logs/hadoop-root-secondarynamenode-hadoop1.out
-
16/02/11 21:41:27 WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
-
starting yarn daemons
-
starting resourcemanager, logging to /usr/local/hadoop/logs/yarn-root-resourcemanager-hadoop1.out
-
localhost: starting nodemanager, logging to /usr/local/hadoop/logs/yarn-root-nodemanager-hadoop1.out
-
[root@hadoop1 sbin]# jps
-
7192 SecondaryNameNode
-
7432 NodeManager
-
7468 Jps
-
6913 NameNode
-
7333 ResourceManager
- 7036 DataNode
驗證: (1)執行命令jps 如果看到5個新的java程式,分別是NameNode、SecondaryNameNode、DataNode、ResourceManager、NodeManager
(2)在瀏覽器檢視
hadoop web控制檯頁面的埠整理:
50070:hdfs檔案管理 http://192.168.23.131:50070
8088:ResourceManager http://192.168.23.131:8088
8042:NodeManager http://192.168.23.131:8042
9 啟動時沒有NameNode的可能原因:
(1)沒有格式化
(2)環境變數設定錯誤
(3)ip與hostname繫結失敗
參考:
http://stark-summer.iteye.com/blog/2184123
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/30089851/viewspace-1987884/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 三、偽分佈環境下安裝hbase
- 四、偽分佈下安裝hive1.2Hive
- hadoop0.20.2偽分佈模式安裝和配置Hadoop模式
- HBASE偽分佈搭建
- HADOOP的偽分佈搭建Hadoop
- Spark新手入門——2.Hadoop叢集(偽分佈模式)安裝SparkHadoop模式
- hadoop2.6偽分佈+pig0.15+zookeeper3.4.6安裝Hadoop
- Hadoop偽分佈模式(HDFS)Hadoop模式
- 二、hadoop偽分佈搭建Hadoop
- SAP安裝實驗
- 雲端計算課程實驗之安裝Hadoop及配置偽分散式模式的HadoopHadoop分散式模式
- heartbeat安裝配置實驗
- hadoop偽分散式安裝Hadoop分散式
- Zabbix安裝實驗報告
- Perl的NT安裝實驗報告(轉)
- Redis 偽分散式安裝部署配置Redis分散式
- 實驗-資料分佈對執行計劃的影響.txt
- hive1.2偽分佈mysql資料庫配置詳解HiveMySql資料庫
- 解除安裝oracleasm實驗模擬OracleASM
- hadoop0.20.2完全分佈模式安裝和配置Hadoop模式
- Hadoop系列之Hbase的高可用完全分佈模式的安裝(六)Hadoop模式
- 【11g 單庫解除安裝、靜默安裝】實驗
- hadoop2.2.0偽分散式安裝Hadoop分散式
- CentOS6.6-DRBD安裝配置實驗CentOS
- Kafka 簡單實驗一(安裝Kafka)Kafka
- 安信實驗室教你如何實現Windows自動安裝!Windows
- 關於共軛分佈,beta分佈,二項分佈和Dirichlet分佈、多項式分佈的關係
- db2聯邦oracle實驗 ii的安裝DB2Oracle
- CentOS7下部署Hadoop2.X--偽分佈模式CentOSHadoop模式
- Redis 實現分佈鎖Redis
- Hadoop3偽分散式安裝指南Hadoop分散式
- Hadoop偽分散式安裝(MapReduce+Yarn)Hadoop分散式Yarn
- MATLAB 檢驗資料正態分佈及程式碼實現Matlab
- 擴散模型中的後驗分佈方差推導模型
- OCM實驗-grid control安裝
- 【實驗】【STATSPACK】Statspack 安裝、測試與使用
- 護照真偽查驗、翔雲護照鑑偽、證件識讀儀、出入境護照查驗裝置
- Ubuntu下偽分散式模式Hadoop的安裝及配置Ubuntu分散式模式Hadoop