hadoop单机版搭建
1.安装配置jdk并配置环境变量
2.安装hadoop(tar解压即可)
3.创建hadoop用户
1) addgroup hadoop //创建用户组
2) adduser -ingroup hadoop hadoop //创建用户归到hadoop用户组下
3) chown -R hadoop /hadoop目录 // 给用户赋权
4.安装ssh
1) apt-get install openssh-server //安装ssh
2) su hadoop //切换到hadoop用户
3) ssh-keygen -t rsa -P ""(提示后填写保持路基/home/hadoop/.ssh/id_rsa) //创建ssh-key
4) cat /home/hadoop/.ssh/id_rsa.pub >> /home/hadoop/.ssh/authorized_keys //添加ssh-key到受信列表,并启用此ssh-key
5) ssh localhost //验证ssh
5.配置hadoop
1) 打开conf/hadoop-env.sh 配置jdk路径
2) 打开conf/core-site.xml,配置
<configuration>
<property>
<name>fs.default.name</name>
<value>hdfs://localhost:9000</value>
</property>
<property>
<name>dfs.replication</name>
<value>1</value>
</property>
<property>
<name>hadoop.tmp.dir</name>
<value>/home/hadoop/tmp</value>
</property>
</configuration>
3)打开conf/mapred-site.xml
<configuration>
<property>
<name>mapred.job.tracker</name>
<value>localhost:9001</value>
</property>
</configuration>
6.运行测试
1) ./hadoop namenode -format //格式namenode
2) ./start-all.sh //启动hadoop
3) jps //查看hadoop是否启动成功,出现以下进程则说明安装启动成功
8150 NameNode
8367 DataNode
8667 JobTracker
8945 Jps
8581 SecondaryNameNode
8881 TaskTracker
下一篇: OpenOffice 安装使用