Hadoop伪分布式模式部署
Hadoop2.x:
官网:hadoop.apache.org
三个组件:
文档地址:
伪分布式部署:HDFS
1.创建hadoop服务的一个用户
3.部署ssh,确保其是运行的
修改权限:
配置环境变量
vi /etc/profile
export HADOOP_HOME=/opt/software/hadoop-2.8.1
export PATH=$HADOOP_HOME/bin:$PROTOC_HOME/bin:$FINDBUGS_HOME/bin:$MAVEN_HOME/bin:$JAVA_HOME/bin:$PATH
# which hadoop
# /opt/software/hadoop-2.8.1/bin/hadoop
hadoop-2.8.1]# rm -rf /hadoop-2.8.1/sbin/*.cmd
hadoop-2.8.1/share/hadoop/hdfs:jar包
core-site.xml :hadoop 核心配置文件
hdfs-site.xml :针对于hdfs服务的会起进程
slaves :集群的机器名称
配置core-site文件
<property>
<name>fs.defaultFS</name>
<value>hdfs://localhost:9000</value>
</property>
</configuration>
<property>
<name>dfs.replication</name>
<value>1</value>
</property>
</configuration>
6.配置root用户的ssh的信任关系
~]# cd .ssh
.ssh]# cat id_rsa.pub >> authorized_keys 添加自己的公钥到信任名单
The authenticity of host 'localhost (::1)' can't be established.
RSA key fingerprint is ec:85:86:32:22:94:d1:a9:f2:0b:c5:12:3f:ba:e2:61.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'localhost' (RSA) to the list of known hosts.
Sun May 13 21:49:14 CST 2018
~]# ssh localhost date
Sun May 13 21:49:17 CST 2018
$ bin/hdfs namenode -format
8.java home配置
hadoop]# vi hadoop-env.sh
export JAVA_HOME=/usr/java/jdk1.8.0_45
9.Start NameNode daemon and DataNode daemon:
hadoop-2.8.1]# sbin/start-dfs.sh 执行shell脚本
Starting namenodes on [localhost]
localhost: starting namenode, logging to /opt/software/hadoop-2.8.1/logs/hadoop-root-namenode-hadoop000.out
localhost: starting datanode, logging to /opt/software/hadoop-2.8.1/logs/hadoop-root-datanode-hadoop000.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 ec:85:86:32:22:94:d1:a9:f2:0b:c5:12:3f:ba:e2:61.
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 /opt/software/hadoop-2.8.1/logs/hadoop-root-secondarynamenode-hadoop000.out
/]# jps
9861 DataNode
9768 NameNode
10056 SecondaryNameNode
10492 Jps