HDFS Lab (3) hadoop Node configuration
Vi / etc/hosts
Add Node dns Information
192.168.209.157 node1
192.168.209.158 node2
192.168.209.159 node3
Vi / etc/profile
Add a running directory
Export HADOOP_HOME=/home/hadoop/hadoop-3.1.0
ExportPATH=$PATH:$HADOOP_HOME/bin
Copy to each node in the past
Scp / etc/profile node2:/etc/profile
Scp / etc/profile node3:/etc/profile
Execute at each node
Source / etc/profile
Refresh configuration
Then copy the key to different nodes
Ssh-copy-id node1
Ssh-copy-id node2
Ssh-copy-id node3
Mkdir tmp creates a temporary directory
Create data and name in / home/hadoop/hadoop-3.1.0
Vi / home/hadoop/hadoop-3.1.0/etc/hadoop/core-site.xml
Fs.defaultFS
Hdfs://node1:50070
Hadoop.tmp.dir
/ home/hadoop/hadoop-3.1.0/tmp
Vi / home/hadoop/hadoop-3.1.0/etc/hadoop/hdfs-site.xml
Dfs.namenode.http-address node1:50070 dfs.namenode.secondary.http-address node2:50090 dfs.namenode.name.dir / home/hadoop/hadoop-3.1.0/name dfs.replication 2 dfs.datanode.data.dir / home/hadoop/hadoop-3.1.0/data
Vi / home/hadoop/hadoop-3.1.0/etc/hadoop/mapred-site.xml
Mapreduce.framework.name yarn
Vi / home/hadoop/hadoop-3.1.0/etc/hadoop/yarn-site.xml
Yarn.resourcemanager.hostname master yarn.nodemanager.aux-services mapreduce_shuffle yarn.nodemanager.aux-services.mapreduce.shuffle.class org.apache.hadoop.mapred.ShuffleHandler
It's starting to start.
. / bin/hdfs namenode-format
I can't find java. Let me fix a mistake.
Find the location of the bag.
Rpm-qal | grep jdk
Vi / etc/profile
Join the java environment configuration information
Export JAVA_HOME=/usr/java/jdk1.8.0_162 export PATH=$JAVA_HOME/bin:$PATH
Export HADOOP_HOME=/home/hadoop/hadoop-3.1.0
ExportPATH=$PATH:$HADOOP_HOME/bin
Refresh the configuration source / etc/profile
Format it again.
. / bin/hdfs namenode-format
Start the failed bird.
Let me fix a mistake.
SHUTDOWN_MSG: Shutting down NameNode at java.net.UnknownHostException: hadoop-1: hadoop-1: Name or service not known
The local name is hadoop-1, which is different from the node1 in the configuration, so nmtui is changed to hostname first.
Format again
Start dfs
. / sbin/start-dfs.sh
Wrong bird
Starting namenodes on [node1] node1: ERROR: JAVA_HOME is not set and could not be found.
I have obviously set up javahome. Take a look at the log again. There is a black word.
Vi. / etc/hadoop/hadoop-env.sh
Export JAVA_HOME=/usr/java/jdk1.8.0_162
Start dfs again
None of the three stations reported anything wrong.
Start yarm
. / sbin/start-yarn.sh
Components started by node1
Node2 component
Node3 component
There are all startup commands in the sbin directory
. sbin/start-all.sh
. sbin/stop-all.sh