一 SSH 无密码登陆 & Linux防火墙 & SELinux关闭

如果系统环境崩溃。   调用/usr/bin/vim /etc/profile
 
SHH无密码登陆
所有要做得节点上运行
 
修改 host name
vi /etc/sysconfig/network
 
reboot!
 
一 创建秘钥
    ssh-keygen -t rsa -P ''
    然后一路回车
 
+--[ RSA 2048]----+
|                 |
|                 |
|        o        |
|      E. B       |
|     o.oS =      |
|    oooo .       |
|   . .=   +      |
| .o  o o o .     |
|.++o..+ .        |
+-----------------+
 
二  从节点秘钥拷贝到主机
 
scp ~/.ssh/id_rsa.pub root(用户名)@10.0.0.1(master配置hosts)(ip)  
scp ~/.ssh/id_rsa.pub root@10.0.0.1:~/.ssh/s1.pub     s1.pub(随意定的文件名,子节点发送到主机用。 主机到时候全部写入)
 
 scp ~/.ssh/id_rsa.pub root@master:~/.ssh/s1.pub
 scp ~/.ssh/id_rsa.pub root@192.168.1.110:~/.ssh/s1.pub  
 
三 将从节点的秘钥全部写入 authorized_keys
cat id_rsa.pub >> authorized_keys
cat s1.pub >> authorized_keys
cat s2.pub >> authorized_keys
 
四  将主节点的authorized_keys 发送到从节点
   scp authorized_keys root@(slave1IP):~/.ssh/authorized_keys
   scp authorized_keys root@(slave2IP):~/.ssh/authorized_keys
 
 scp authorized_keys root@192.168.1.111:~/.ssh/authorized_keys
 
五  编辑host 实现 master 访问
   vi /etc/hosts
10.40.1.110 master
10.40.1.111 slave1
10.40.1.112 slave2
 
vi
 Linux防火墙
 

1.首先查看防火墙状态 

service iptables status

2.永久性生效,重启后不会复原

开启 chkconfig iptables on

关闭 chkconfig iptables off

3 即时生效,重启后复原

开启 service iptables start

关闭 service iptables stop

 

4 设置后重启 reboot

 
 
 

三 关闭SElinux防火墙。 防止hadoop被拦截产生其他意外

Linux下关闭 SELinux 的方法如下:

vim /etc/sysconfig/selinux

找到

selinux=enabled

改为

selinux=disabled

下次重启就生效了。  reboot

然后在本次不重启的情况下使用下列命令关闭,需要root权限:

# su – root
# setenforce 0

OK。

 
 
 
 
 
 
 
 
 
God has given me a gift. Only one. I am the most complete fighter in the world. My whole life, I have trained. I must prove I am worthy of someting. rocky_24
原文地址:https://www.cnblogs.com/rocky24/p/725c39fbd4e43c9abb22497b7e6a8c03.html