首先安装jdk
设置环境变量
下载hadoop
修改jdk profile,增加HADOOP_HOME
修改hadoop下的4个文件
hadoop-env.sh
export JAVA_HOME=../../../../home/briup/jdk1.7
core-site.xml
<property>
<name>hadoop.tmp.dir</name>
<value>/hadoop</value>
</property>
<property>
<name>dfs.name.dir</name>
<value>/hadoop/name</value>
</property>
<property>
<name>fs.default.name</name>
<value>hdfs://127.0.0.1:9000</value>
</property>
hdfs-site.xml
<property>
<name>dfs.data.dir</name>
<value>/hadoop/data</value>
</property>
mapred-site.xml
<property>
<name>mapred.job.tracker</name>
<value>127.0.0.1:9001</value>
</property>
格式化
hadoop namenode -format
开启
start-all.sh
遇见的异常
1.运行Hadoop start-all.sh遇到的错误ssh: connect to host localhost port 22: Connection refused
sudo apt-get install openssh-server
2.root@localhost’s password:localhost:permission denied,please try again
1.修改root密码:#sudo passwd root
2.辑配置文件,允许以 root 用户通过 ssh 登录:sudo vi /etc/ssh/sshd_config
找到:PermitRootLogin prohibit-password禁用
添加:PermitRootLogin yes
3.sudo service ssh restart
重新启动成功。