Linux>集群(三台机器)>ssh远程登录>时间同步>起别名>远程拷贝>关闭防火墙

新增linux系统

在这里插入图片描述
第一步: 克隆虚拟机
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
第二步: 更改新增系统的mac地址
vim /etc/udev/rules.d/70-persistent-net.rules
在这里插入图片描述
第三步: 更改网卡信息 (setup)
vim /etc/sysconfig/network-scripts/ifcfg-eth0
在这里插入图片描述
第四步: 重启系统生效
[root@node02 ~]# reboot

三台机器 关闭防火墙

内网环境 安全性比较高, 防火墙开启会影响效率, 所以 关闭防火墙
三台机器执行以下命令(root用户来执行)

service iptables         可选择方式一
/etc/init.d/iptables     可选择方式二
Usage: iptables {
   start|stop|reload|restart|condrestart|status|panic|save}

# 查看防火墙的状态  status    
 [root@node02 ~]# service iptables status         (方式一)
 [root@node02 ~]# /etc/init.d/iptables status    (方式二)
 iptables:未运行防火墙。

# 启动防火墙服务  start 
[root@node02 ~]# service iptables start          (方式一)
[root@node02 ~]# /etc/init.d/iptables start     (方式二)
  
# 重启 防火墙 服务  restart 
[root@node02 ~]# service iptables restart
[root@node02 ~]# /etc/init.d/iptables restart
 
# 停止 防火墙 服务  stop 
  [root@node02 ~]# service iptables stop 
  [root@node02 ~]# /etc/init.d/iptables stop
  
#* 彻底关闭防火墙  off (开机不自起)   on (开机自起)
 [root@node02 ~]# chkconfig iptables off 

在这里插入图片描述

三台机器关闭selinux

进入seLinux编辑 ( vim /etc/selinux/config )

[root@node02 ~]# vim /etc/selinux/config 

在这里插入图片描述

三台机器更改主机名

更改别名 (vim /etc/sysconfig/network )
注意:重启才会生效

[root@node02 ~]# vim /etc/sysconfig/network 

在这里插入图片描述
方式二:窗口设置修改别名
在这里插入图片描述

三台机器 给ip地址起别名

给ip地址起别名

[root@node02 ~]# vim /etc/hosts
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.100.201      node01
192.168.100.202      node02
192.168.100.203      node03

测试
ping 192.168.100.202
ping hadoop02

[root@node02 ~]# ping 192.168.100.202    (通过 ping ip)
PING 192.168.100.202 (192.168.100.202) 56(84) bytes of data.
64 bytes from 192.168.100.202: icmp_seq=1 ttl=64 time=0.017 ms

[root@node02 ~]# ping node02             (通过ping 别名 )
PING node02 (192.168.100.202) 56(84) bytes of data.
64 bytes from node02 (192.168.100.202): icmp_seq=1 ttl=64 time=0.010 ms

一.scp 远程文件拷贝

是什么?
scp是 remote file copy program 的缩写, scp是远程文件拷贝命令。
从本地拷贝到远程机器上
在这里插入图片描述
1.文件
拷贝文件
语法格式( scp local_file remote_username@remote_ip:remote_folder)

[root@node02 ~]# scp /etc/hosts   node03:/etc/
[root@node02 ~]# scp /etc/hosts   root@node03:/etc/

需求: 将本地 01.txt 文件 复制到 192.168.100.202 机器的 /export目录下 

scp  /export/aaa/01.txt   root@192.168.100.202:/export   (方式一)
 
scp  /export/aaa/02.txt   root@hadoop02:/export          (方式二)
 
[root@node02 ~]#scp /export/aaa/02.txt  hadoop02:/export (方式三)

2.文件夹
拷贝目录
语法格式 (scp -r local_folder remote_username@remote_ip:remote_folder)

需求: 将本地 aaa 目录 复制到 192.168.100.202 机器的 /export 目录下 
 [root@node02 ~]# scp -r /export/aaa
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值