生产环境实战spark (4)Linux CentOS 系统安装 防火墙检查 ssh免密码登录
2017-04-11 09:36
1036 查看
生产环境实战spark (4)Linux CentOS 系统安装 防火墙检查 ssh免密码登录
保障hadoop集群、spark集群、kafka集群、zookeeper集群的分布式通信畅通,分布式节点之间关闭防火墙。
保障hadoop集群、spark集群、kafka集群、zookeeper集群的系统登录畅通,配置节点间ssh免密码登录。
Redirecting to /bin/systemctl status iptables.service
iptables.service - IPv4 firewall with iptables
Loaded: loaded (/usr/lib/systemd/system/iptables.service; disabled)
Active: inactive (dead)
[root@master ~]# ping master
PING master (127.0.0.1) 56(84) bytes of data.
64 bytes from master (127.0.0.1): icmp_seq=1 ttl=64 time=0.060 ms
64 bytes from master (127.0.0.1): icmp_seq=2 ttl=64 time=0.085 ms
64 bytes from master (127.0.0.1): icmp_seq=3 ttl=64 time=0.084 ms
配置hosts文件中的主机名[root@master ~]# cat /etc/hosts
127.0.0.1 master
10.100.100.237 master
::1 master
[root@master ~]# ls -a
. .. anaconda-ks.cfg .bash_history .bash_logout .bash_profile .bashrc .cache .config .cshrc .dbus .oracle_jre_usage .tcshrc
[root@master ~]# ll -a
total 52
dr-xr-x---. 6 root root 4096 Apr 10 12:07 .
drwxr-xr-x. 18 root root 4096 Apr 10 06:00 ..
-rw-------. 1 root root 1655 Apr 6 08:59 anaconda-ks.cfg
-rw-------. 1 root root 1354 Apr 10 14:24 .bash_history
-rw-r--r--. 1 root root 18 Dec 29 2013 .bash_logout
-rw-r--r--. 1 root root 176 Dec 29 2013 .bash_profile
-rw-r--r--. 1 root root 176 Dec 29 2013 .bashrc
drwx------. 4 root root 4096 Apr 6 13:06 .cache
drwx------. 4 root root 4096 Apr 6 13:06 .config
-rw-r--r--. 1 root root 100 Dec 29 2013 .cshrc
drwx------. 3 root root 4096 Apr 6 13:01 .dbus
drwxr-xr-x. 2 root root 4096 Apr 10 12:07 .oracle_jre_usage
-rw-r--r--. 1 root root 129 Dec 29 2013 .tcshrc
执行ssh-keygen -t rsa命令,自动生成.ssh目录,目录中存放密钥文件。
[root@master ~]# ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/root/.ssh/id_rsa):
Created directory '/root/.ssh'.
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /root/.ssh/id_rsa.
Your public key has been saved in /root/.ssh/id_rsa.pub.
The key fingerprint is:
e3:54:d0:0c:3a:29:54:a0:e3:b4:95:dd:da:b3:ef:e8 root@master
The key's randomart image is:
+--[ RSA 2048]----+
| oo. o+ |
| o o + .o |
| + + = . . |
| o + . + . |
| o . S |
| o + |
| o |
| o |
| .E.o |
+-----------------+
[root@master ~]# ls -a
. .. anaconda-ks.cfg .bash_history .bash_logout .bash_profile .bashrc .cache .config .cshrc .dbus .oracle_jre_usage .ssh .tcshrc
[root@master ~]# cd .ssh
[root@master .ssh]# ls -a
. .. id_rsa id_rsa.pub
复制一份密码文件
[root@master .ssh]# cp id_rsa.pub authorized_keys
[root@master .ssh]# ls -l
total 12
-rw-r--r--. 1 root root 393 Apr 11 08:53 authorized_keys
-rw-------. 1 root root 1675 Apr 11 08:51 id_rsa
-rw-r--r--. 1 root root 393 Apr 11 08:51 id_rsa.pub
配置完成,ssh免密码登陆验证
[root@master .ssh]# ssh master
The authenticity of host 'master (::1)' can't be established.
ECDSA key fingerprint is 05:5b:98:b2:90:46:86:26:7f:9a:fa:0c:80:1d:27:df.
Are you sure you want to continue connecting (yes/no)? y
Please type 'yes' or 'no': yes
Warning: Permanently added 'master' (ECDSA) to the list of known hosts.
Last login: Tue Apr 11 08:41:46 2017 from 132.150.75.19
[root@master ~]# ssh master
Last login: Tue Apr 11 08:56:49 2017 from master
保障hadoop集群、spark集群、kafka集群、zookeeper集群的分布式通信畅通,分布式节点之间关闭防火墙。
保障hadoop集群、spark集群、kafka集群、zookeeper集群的系统登录畅通,配置节点间ssh免密码登录。
1.关闭防火墙
[root@master ~]# service iptables statusRedirecting to /bin/systemctl status iptables.service
iptables.service - IPv4 firewall with iptables
Loaded: loaded (/usr/lib/systemd/system/iptables.service; disabled)
Active: inactive (dead)
[root@master ~]# ping master
PING master (127.0.0.1) 56(84) bytes of data.
64 bytes from master (127.0.0.1): icmp_seq=1 ttl=64 time=0.060 ms
64 bytes from master (127.0.0.1): icmp_seq=2 ttl=64 time=0.085 ms
64 bytes from master (127.0.0.1): icmp_seq=3 ttl=64 time=0.084 ms
配置hosts文件中的主机名[root@master ~]# cat /etc/hosts
127.0.0.1 master
10.100.100.237 master
::1 master
2.配置ssh免密码登录。
[root@master ~]# ls -a. .. anaconda-ks.cfg .bash_history .bash_logout .bash_profile .bashrc .cache .config .cshrc .dbus .oracle_jre_usage .tcshrc
[root@master ~]# ll -a
total 52
dr-xr-x---. 6 root root 4096 Apr 10 12:07 .
drwxr-xr-x. 18 root root 4096 Apr 10 06:00 ..
-rw-------. 1 root root 1655 Apr 6 08:59 anaconda-ks.cfg
-rw-------. 1 root root 1354 Apr 10 14:24 .bash_history
-rw-r--r--. 1 root root 18 Dec 29 2013 .bash_logout
-rw-r--r--. 1 root root 176 Dec 29 2013 .bash_profile
-rw-r--r--. 1 root root 176 Dec 29 2013 .bashrc
drwx------. 4 root root 4096 Apr 6 13:06 .cache
drwx------. 4 root root 4096 Apr 6 13:06 .config
-rw-r--r--. 1 root root 100 Dec 29 2013 .cshrc
drwx------. 3 root root 4096 Apr 6 13:01 .dbus
drwxr-xr-x. 2 root root 4096 Apr 10 12:07 .oracle_jre_usage
-rw-r--r--. 1 root root 129 Dec 29 2013 .tcshrc
执行ssh-keygen -t rsa命令,自动生成.ssh目录,目录中存放密钥文件。
[root@master ~]# ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/root/.ssh/id_rsa):
Created directory '/root/.ssh'.
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /root/.ssh/id_rsa.
Your public key has been saved in /root/.ssh/id_rsa.pub.
The key fingerprint is:
e3:54:d0:0c:3a:29:54:a0:e3:b4:95:dd:da:b3:ef:e8 root@master
The key's randomart image is:
+--[ RSA 2048]----+
| oo. o+ |
| o o + .o |
| + + = . . |
| o + . + . |
| o . S |
| o + |
| o |
| o |
| .E.o |
+-----------------+
[root@master ~]# ls -a
. .. anaconda-ks.cfg .bash_history .bash_logout .bash_profile .bashrc .cache .config .cshrc .dbus .oracle_jre_usage .ssh .tcshrc
[root@master ~]# cd .ssh
[root@master .ssh]# ls -a
. .. id_rsa id_rsa.pub
复制一份密码文件
[root@master .ssh]# cp id_rsa.pub authorized_keys
[root@master .ssh]# ls -l
total 12
-rw-r--r--. 1 root root 393 Apr 11 08:53 authorized_keys
-rw-------. 1 root root 1675 Apr 11 08:51 id_rsa
-rw-r--r--. 1 root root 393 Apr 11 08:51 id_rsa.pub
配置完成,ssh免密码登陆验证
[root@master .ssh]# ssh master
The authenticity of host 'master (::1)' can't be established.
ECDSA key fingerprint is 05:5b:98:b2:90:46:86:26:7f:9a:fa:0c:80:1d:27:df.
Are you sure you want to continue connecting (yes/no)? y
Please type 'yes' or 'no': yes
Warning: Permanently added 'master' (ECDSA) to the list of known hosts.
Last login: Tue Apr 11 08:41:46 2017 from 132.150.75.19
[root@master ~]# ssh master
Last login: Tue Apr 11 08:56:49 2017 from master
相关文章推荐
- 生产环境实战spark (3)Linux CentOS 系统安装 修改主机名 安装JDK
- 生产环境实战spark (2)Linux CentOS-7.0-1406-x86_64系统安装
- 生产环境实战spark (5)分布式集群 5台设备之间hosts文件配置 ssh免密码登录
- 生产环境实战spark (1)Linux ubuntu系统安装
- 大数据环境基础之Centos安装Haoop集群(4)ssh免密码登录
- linux系统ssh无密码环境登录设置
- ssh免密码登录 Linux环境(CentOS+hadoop-2.*)
- Linux运维一:生产环境CentOS6.6系统的安装
- centos安装ssh免密码登录
- Linux系统下如何做到SSH免密码登录
- centos生产环境禁用root用户ssh登录
- linux环境下不需要手工输入密码就能SSH登录到服务端B
- Ubuntu、CentOS Linux系统安装Erlang,部署Eclipse+Erlide开发环境
- linux 安装ssh 以及机器之间免密码ssh登录
- centos linux系统忘记用户登录密码的解决方案
- Linux/CentOS启动SSH远程登录无密码
- CentOS(5.8/6.4)linux生产环境若干优化实战 _转
- CentOS(5.8/6.4)linux生产环境若干优化实战
- CentOS(5.8/6.4)linux生产环境若干优化实战
- CentOS(5.8/6.4)linux生产环境若干优化实战