1.环境参数
- 编程语言:JAVA
- Linux环境:Centos 6.4
- Hadoop版本:CDH (hadoop-2.6.0-cdh5.7.0)
2.下载地址
3.相关的Linux操作
- 1)使用管理员账号登陆Linux,建立用户hadoop 密码123456:
[root@chao ~]
[root@chao ~]
- 2)把下载的压缩包发送到Linux,macOS终端命令:
scp jdk7u79linuxx64.tar hadoop@192.168.27.131:~
tar -xvf file.tar
tar -zxvf file.tar.gz
[hadoop@chao ~]$ tar -zxvf hadoop-2.6.0-cdh5.7.0.tar -C ./app/
sudo yum install openssh-clients
sudo yum install ssh
- 5)JDK和Hadoop都是解压就可以了,为方便使用命令还要进行环境配置:
[hadoop@chao ~]$ vi ~/.bash_profile
// 配置文件里添加(一个是jdk,一个是hadoop):
export JAVA_HOME=/home/hadoop/app/jdk1.7.0_79
export PATH=$JAVA_HOME/bin:$PATH
export HADOOP_HOME=/home/hadoop/app/hadoop-2.6.0-cdh5.7.0
export PATH=$PATH:$HADOOP_HOME/bin:$HADOOP_HOME/sbin
[hadoop@chao ~]$ source ~/.bash_profile
[hadoop@chao ~]$ ssh-keygen -t rsa
// 然后不输内容全部回车,下面操作中的文件名不要修改
[hadoop@chao ~]$ cp ~/.ssh/id_rsa.pub ~/.ssh/authorized_keys
[hadoop@chao ~]$ cat ~/.ssh/authorized_keys
ssh localhost
exit
ssh 192.168.27.131
exit
- 7)ll命令看不到.*的隐藏文件,用ls -la可查看
ls
ll
ls -la
4.Hadoop配置文件的修改
- 配置文件目录:/home/hadoop/app/hadoop-2.6.0-cdh5.7.0/etc/hadoop/
- 1)hadoop-env.sh 中添加:
export JAVA_HOME=/home/hadoop/app/jdk1.7.0_79
<property>
<name>fs.defaultFS</name>
<value>hdfs://hadoop000:8020</value>
</property>
<property>
<name>hadoop.tmp.dir</name>
<value>/home/hadoop/app/tmp</value>
</property>
5.下一步:进行HDFS配置