cdh地址
http://archive-primary.cloudera.com/cdh6/cdh/5/
添加sudo权限的无密码访问的hadoop用户
# useradd hadoop
# vi /etc/sudoers
hadoop ALL=(root) NOPASSWD:ALL
# su - hadoop
下载 解压缩
[hadoop@hadoop000 softwore]$ wget http://archive-primary.cloudera.com/cdh6/cdh/5/hadoop-2.6.0-cdh6.7.0.tar.gz
[hadoop@hadoop000 app]$ tar -zxvf ../softwore/hadoop-2.6.0-cdh6.7.0.tar.gz
修改配置
首先需要jdk1.7
[root@hadoop000 jdk1.7.0_80]# echo $JAVA_HOME
/usr/java/jdk1.7.0_80
修改 etc/hadoop/hadoop-env.sh 文件
在hadoop-env.sh文件中修改java_home
export JAVA_HOME=/usr/java/jdk1.7.0_80
增加HADOOP_PREFIX
export HADOOP_PREFIX=/home/hadoop/app/hadoop-2.6.0-cdh6.7.0
修改etc/hadoop/core-site.xml:
<configuration>
<property>
<name>fs.defaultFS</name>
<value>hdfs://hadoop:9000</value>
</property>
</configuration>
修改etc/hadoop/hdfs-site.xml:
<configuration>
<property>
<name>dfs.replication</name>
<value>1</value>
</property>
</configuration>
修改etc/slaves文件
hadoop
配置ssh免密
删除.ssh文件夹 防止冲突
# rm -rf .ssh
生成ssh秘钥
# ssh-keygen -t dsa -P '' -f ~/.ssh/id_dsa
# cat ~/.ssh/id_dsa.pub >> ~/.ssh/authorized_keys
修改authorized_keys 文件权限
chmod 600 authorized_keys
初始格式化hdfs
[hadoop@hadoop000 hadoop-2.6.0-cdh6.7.0]$ bin/hdfs namenode -format
启动hdfs
[hadoop@hadoop000 hadoop-2.6.0-cdh6.7.0]$ sbin/start-dfs.sh
jps查看进程
web ui 查看
原创文章,作者:Maggie-Hunter,如若转载,请注明出处:https://blog.ytso.com/191060.html