标签:生成 res mirror echo cal tle 切换 ast 加密
目录
1.NameNode 名称节点 master 管理其他节点。需要配置ssh免密管理
2.DateNode 数据节点
3.SecondaryNameNode 辅助名称节点
|主机名|ip|作用|
|-|-|-|
|s101|192.168.255.101|NameNode |
|s102|192.168.255.102|DateNode |
|s103|192.168.255.103|DateNode |
|s104|192.168.255.104|DateNode |
需要root权限
cat >/etc/hosts<<EOF
127.0.0.1 localhost
192.168.255.101 s101
192.168.255.102 s102
192.168.255.103 s103
192.168.255.104 s104
EOF
s101对所有节点(包括自己)需要免密登录
在s101上生成公私密钥对,把公钥发给所有节点(包括自己)的认证库中,通信时,公钥加密,私钥解密。
#-t 加密算法
#-P 无密加密
#-f 指定私钥文件
ssh-keygen -t rsa -P '' -f ~/.ssh/id_rsa
cd ~/.ssh
cat id_rsa.pub >> authorized_keys
cd ~/.ssh
chmod 755 authorized_keys
ssh localhost
ssh-copy-id centos@s102
#远程登录验证
ssh centos@s102
ssh-copy-id centos@s103
ssh centos@s103
ssh-copy-id centos@s104
ssh centos@s104
切换root
#-t 加密算法
#-P 无密加密
#-f 指定私钥文件
ssh-keygen -t rsa -P '' -f ~/.ssh/id_rsa
cd ~/.ssh
cat id_rsa.pub >> authorized_keys
cd ~/.ssh
chmod 755 authorized_keys
ssh localhost
ssh-copy-id s102
#远程登录验证
ssh s102
ssh-copy-id s103
ssh s103
ssh-copy-id s104
ssh s104
内容如下
cat /etc/hosts
127.0.0.1 localhost
192.168.255.101 s101
192.168.255.102 s102
192.168.255.103 s103
192.168.255.104 s104
远程复制该文件到所有主机
root权限
scp /etc/hosts root@s102:/etc/hosts
scp /etc/hosts root@s103:/etc/hosts
scp /etc/hosts root@s104:/etc/hosts
#可登录查看
root权限
tar xf jdk-8u201-linux-x64.tar.gz
ln -s jdk1.8.0_201 jdk
echo -e '\n#配置java环境变量' >> /etc/profile
echo -e 'export JAVA_HOME=/opt/jdk' >> /etc/profile
echo -e 'export PATH=$PATH:$JAVA_HOME/bin' >> /etc/profile
source /etc/profile
java -version
wget http://mirrors.tuna.tsinghua.edu.cn/apache/hadoop/common/hadoop-3.2.1/hadoop-3.2.1.tar.gz
tar xf hadoop-3.2.1.tar.gz
ln -s hadoop-3.2.1 hadoop
echo -e '\n#配置hadoop环境变量' >> /etc/profile
echo -e 'export HADOOP_HOME=/opt/hadoop' >> /etc/profile
echo -e 'export PATH=$PATH:$HADOOP_HOME/bin' >> /etc/profile
echo -e 'export PATH=$PATH:$HADOOP_HOME/sbin' >> /etc/profile
source /etc/profile
root权限
vim /opt/hadoop/etc/hadoop/hdfs-site.xml
<configuration>
<!--指定HDFS副本数量,这里只设置了一个节点(hadoop01)副本数量为1)-->
<property>
<name>dfs.replication</name>
<value>1</value>
</property>
</configuration>
vim /opt/hadoop/etc/hadoop/hadoop-env.sh
echo 'export JAVA_HOME=/opt/jdk' >> /opt/hadoop/etc/hadoop/hadoop-env.sh
vim /opt/hadoop/etc/hadoop/mapred-site.xml
<configuration>
<property>
<name>mapreduce.framework.name</name>
<value>yarn</value>
</property>
</configuration>
vim /opt/hadoop/etc/hadoop/yarn-site.xml
<configuration>
<property>
<name>yarn.resourcemanager.hostname</name>
<value>s101</value>
</property>
<property>
<name>yarn.nodemanager.aux-services</name>
<value>mapreduce_shuffle</value>
</property>
</configuration>
hdfs namenode -format
start-all.sh
jps
curl http://s101:50070/
标签:生成 res mirror echo cal tle 切换 ast 加密
原文地址:https://www.cnblogs.com/anyux/p/12013226.html