21.端口信息
HDFS中配置的namenode
rpc //8020
webui //50070
datanode
rpc //8032
webui //50075
secondarynamenode
webui //50090
historyServer
webui //19888
resourcemanager
webui //8088
nodemanager
webui //8042
linux系统中可用netstat -tuanlp这个命令来查看所有的内部端口、外部端口连接、
TCP/UDP的所有信息
22.修改日志存放路径
默认是在tar包目录下面的log文件夹
修改tar包etc配置文件下的hadoop-env.sh文件夹
添加:
export HADOOP_LOG_DIR=/var/log/hadoop
查看分析日志首先看的是.log文件, .out文件默认保留5个,会自动滚动覆盖
23.四大模块对于的配置文件
(1).common
hadoop-common-xxx.jar
core-site.xml
core-default.xml
(2).hdfs
hdfs-site.xml
hdfs-default.xml
(3).mapreduce
mapred-site.xml
mapred-default.xml
(4).yarn
yarn-site.xml
yarn-default.xml
24.Namenode和Datanode数据存放位置的说明
(1).Namenode的数据存放位置配置
在hdfs-default.xml中有如下参数可以修改,可以制定多个目录,这样就会在本机存在
多个目录存放的一样的namenode的镜像文件数据,一定程度上保证了数据的安全性,并行写
<property>
<name>dfs.namenode.name.dir</name>
<value>file://${hadoop.tmp.dir}/dfs/name</value>
<description>Determines where on the local filesystem the DFS name node
should store the name table(fsimage). If this is a comma-delimited list
of directories then the name table is replicated in all of the
directories, for redundancy. </description>
</property>
名称配置多个目录在于更可靠;
每个目录存放的内容都是相同的.
(2).Datanode的数据存放位置配置
数据节点配置多个目录,不是副本;
每个目录存放的内容不同,用","号分割
在hdfs-default.xml中有如下参数可以修改
<property>
<name>dfs.datanode.data.dir</name>
<value>file://${hadoop.tmp.dir}/dfs/data</value>
<description>Determines where on the local filesystem an DFS data node
should store its blocks. If this is a comma-delimited
list of directories, then data will be stored in all named
directories, typically on different devices. The directories should be tagged
with corresponding storage types ([SSD]/[DISK]/[ARCHIVE]/[RAM_DISK]) for HDFS
storage policies. The default storage type will be DISK if the directory does
not have a storage type tagged explicitly. Directories that do not exist will
be created if local filesystem permission allows.
</description>
</property>
(3).secondarynamenode数据存放位置
可以存放多个目录,存放的效果和存放namenode数据的多个目录都是一样的
<property>
<name>dfs.namenode.checkpoint.dir</name>
<value>file://${hadoop.tmp.dir}/dfs/namesecondary</value>
<description>Determines where on the local filesystem the DFS secondary
name node should store the temporary images to merge.
If this is a comma-delimited list of directories then the image is
replicated in all of the directories for redundancy.
</description>
</property>
25.Commission|Decommission服役和退役节点的配置以及节点refreshNodes
三个配置文件的关系:
salves文件规定的主机是启动的时候允许启动相应的datanode进行,但是不能保证是否
能够连接到namenode上。
真正保证能够连接到namenode上的配置文件是在hdfs-defaults.xml中的dfs.hosts这个参数值决定的,
这个值指向的是一个文件,文件中记录了哪些主机允许连接到namenode上,如果为空,所有的机器都是
被允许的。
在hdfs-defaults.xml中有个dfs.hosts.exclude参数,这个参数上配置的文件决定了排除哪些机器连接到
namenode的,也就是不允许连接到namenode上面的机器列表。
当include文件和exclude文件同时存在的时候:
include exclude 描述
no no 数据节点无法连接到名称节点
no yes 数据节点无法连接到名称节点
yes no 数据节点可以连接到名称节点
yes yes 数据节点可以连接到名称节点,但会退役