文章目录
新增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