码迷,mamicode.com
首页 > 其他好文 > 详细

CentOS系列教程(七)

时间:2020-04-15 21:42:11      阅读:96      评论:0      收藏:0      [点我收藏+]

标签:防火   tar   direct   ORC   space   mode   微信   isa   lips   

本文是 kubernets集群实验部署前的准备操作。

以下是操作过程:

#########################################################

更换yum源

[master@localhost ~]$ su root
Password:
[root@localhost master]# mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.original0
[root@localhost master]# ls -F /etc/yum.repos.d/
CentOS-Base.repo.original0 CentOS-Debuginfo.repo CentOS-Media.repo CentOS-Vault.repo
CentOS-CR.repo CentOS-fasttrack.repo CentOS-Sources.repo
[root@localhost master]# wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.163.com/.help/CentOS7-Base-163.repo
--2020-04-14 19:42:42-- http://mirrors.163.com/.help/CentOS7-Base-163.repo
Resolving mirrors.163.com (mirrors.163.com)... 59.111.0.251
Connecting to mirrors.163.com (mirrors.163.com)|59.111.0.251|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 1572 (1.5K) [application/octet-stream]
Saving to: ‘/etc/yum.repos.d/CentOS-Base.repo’

100%[=========================================================================================================>] 1,572 --.-K/s in 0s

2020-04-14 19:42:42 (469 MB/s) - ‘/etc/yum.repos.d/CentOS-Base.repo’ saved [1572/1572]

[root@localhost master]# ls -F /etc/yum.repos.d/
CentOS-Base.repo CentOS-CR.repo CentOS-fasttrack.repo CentOS-Sources.repo
CentOS-Base.repo.original0 CentOS-Debuginfo.repo CentOS-Media.repo CentOS-Vault.repo
[root@localhost master]# cat -n /etc/yum.repos.d/CentOS-Base.repo
1 # CentOS-Base.repo
2 #
3 # The mirror system uses the connecting IP address of the client and the
4 # update status of each mirror to pick mirrors that are updated to and
5 # geographically close to the client. You should use this for CentOS updates
6 # unless you are manually picking other mirrors.
7 #
8 # If the mirrorlist= does not work for you, as a fall back you can try the
9 # remarked out baseurl= line instead.
10 #
11 #
12 [base]
13 name=CentOS-$releasever - Base - 163.com
14 #mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os
15 baseurl=http://mirrors.163.com/centos/$releasever/os/$basearch/
16 gpgcheck=1
17 gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-7
18
19 #released updates
20 [updates]
21 name=CentOS-$releasever - Updates - 163.com
22 #mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates
23 baseurl=http://mirrors.163.com/centos/$releasever/updates/$basearch/
24 gpgcheck=1
25 gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-7
26
27 #additional packages that may be useful
28 [extras]
29 name=CentOS-$releasever - Extras - 163.com
30 #mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras
31 baseurl=http://mirrors.163.com/centos/$releasever/extras/$basearch/
32 gpgcheck=1
33 gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-7
34
35 #additional packages that extend functionality of existing packages
36 [centosplus]
37 name=CentOS-$releasever - Plus - 163.com
38 baseurl=http://mirrors.163.com/centos/$releasever/centosplus/$basearch/
39 gpgcheck=1
40 enabled=0
41 gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-7
[root@localhost master]# yum clean all
Loaded plugins: fastestmirror, langpacks
Cleaning repos: base extras updates
Cleaning up everything
Maybe you want: rm -rf /var/cache/yum, to also free up space taken by orphaned data from disabled or removed repos
Cleaning up list of fastest mirrors
[root@localhost master]# yum makecache
Loaded plugins: fastestmirror, langpacks
Determining fastest mirrors
base | 3.6 kB 00:00:00
extras | 2.9 kB 00:00:00
updates | 2.9 kB 00:00:00
(1/10): base/7/x86_64/group_gz | 165 kB 00:00:00
(2/10): base/7/x86_64/primary_db | 6.0 MB 00:00:04
(3/10): base/7/x86_64/filelists_db | 7.3 MB 00:00:04
(4/10): extras/7/x86_64/primary_db | 165 kB 00:00:00
(5/10): extras/7/x86_64/filelists_db | 217 kB 00:00:00
(6/10): extras/7/x86_64/other_db | 106 kB 00:00:00
(7/10): base/7/x86_64/other_db | 2.6 MB 00:00:02
(8/10): updates/7/x86_64/filelists_db | 4.5 MB 00:00:03
(9/10): updates/7/x86_64/other_db | 573 kB 00:00:00
(10/10): updates/7/x86_64/primary_db | 7.6 MB 00:00:05
Metadata Cache Created
[root@localhost master]#


[work0@localhost ~]$ su root
Password:
[root@localhost work0]# mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.original0
[root@localhost work0]# ls -F /etc/yum.repos.d/
CentOS-Base.repo.original0 CentOS-Debuginfo.repo CentOS-Media.repo CentOS-Vault.repo
CentOS-CR.repo CentOS-fasttrack.repo CentOS-Sources.repo
[root@localhost work0]# wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.163.com/.help/CentOS7-Base-163.repo
--2020-04-14 19:45:45-- http://mirrors.163.com/.help/CentOS7-Base-163.repo
Resolving mirrors.163.com (mirrors.163.com)... 59.111.0.251
Connecting to mirrors.163.com (mirrors.163.com)|59.111.0.251|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 1572 (1.5K) [application/octet-stream]
Saving to: ‘/etc/yum.repos.d/CentOS-Base.repo’

100%[=========================================================================================================>] 1,572 --.-K/s in 0s

2020-04-14 19:45:45 (127 MB/s) - ‘/etc/yum.repos.d/CentOS-Base.repo’ saved [1572/1572]

[root@localhost work0]# ls -F /etc/yum.repos.d/
CentOS-Base.repo CentOS-CR.repo CentOS-fasttrack.repo CentOS-Sources.repo
CentOS-Base.repo.original0 CentOS-Debuginfo.repo CentOS-Media.repo CentOS-Vault.repo
[root@localhost work0]# cat -n /etc/yum.repos.d/CentOS-Base.repo
1 # CentOS-Base.repo
2 #
3 # The mirror system uses the connecting IP address of the client and the
4 # update status of each mirror to pick mirrors that are updated to and
5 # geographically close to the client. You should use this for CentOS updates
6 # unless you are manually picking other mirrors.
7 #
8 # If the mirrorlist= does not work for you, as a fall back you can try the
9 # remarked out baseurl= line instead.
10 #
11 #
12 [base]
13 name=CentOS-$releasever - Base - 163.com
14 #mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os
15 baseurl=http://mirrors.163.com/centos/$releasever/os/$basearch/
16 gpgcheck=1
17 gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-7
18
19 #released updates
20 [updates]
21 name=CentOS-$releasever - Updates - 163.com
22 #mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates
23 baseurl=http://mirrors.163.com/centos/$releasever/updates/$basearch/
24 gpgcheck=1
25 gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-7
26
27 #additional packages that may be useful
28 [extras]
29 name=CentOS-$releasever - Extras - 163.com
30 #mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras
31 baseurl=http://mirrors.163.com/centos/$releasever/extras/$basearch/
32 gpgcheck=1
33 gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-7
34
35 #additional packages that extend functionality of existing packages
36 [centosplus]
37 name=CentOS-$releasever - Plus - 163.com
38 baseurl=http://mirrors.163.com/centos/$releasever/centosplus/$basearch/
39 gpgcheck=1
40 enabled=0
41 gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-7
[root@localhost work0]# yum clean all
Loaded plugins: fastestmirror, langpacks
Cleaning repos: base extras updates
Cleaning up everything
Maybe you want: rm -rf /var/cache/yum, to also free up space taken by orphaned data from disabled or removed repos
Cleaning up list of fastest mirrors
[root@localhost work0]# yum makecache
Loaded plugins: fastestmirror, langpacks
Determining fastest mirrors
base | 3.6 kB 00:00:00
extras | 2.9 kB 00:00:00
updates | 2.9 kB 00:00:00
(1/10): base/7/x86_64/group_gz | 165 kB 00:00:00
(2/10): base/7/x86_64/filelists_db | 7.3 MB 00:00:05
(3/10): extras/7/x86_64/filelists_db | 217 kB 00:00:00
(4/10): extras/7/x86_64/other_db | 106 kB 00:00:00
(5/10): base/7/x86_64/primary_db | 6.0 MB 00:00:06
(6/10): extras/7/x86_64/primary_db | 165 kB 00:00:01
(7/10): base/7/x86_64/other_db | 2.6 MB 00:00:02
(8/10): updates/7/x86_64/filelists_db | 4.5 MB 00:00:04
(9/10): updates/7/x86_64/other_db | 573 kB 00:00:00
(10/10): updates/7/x86_64/primary_db | 7.6 MB 00:00:05
Metadata Cache Created
[root@localhost work0]#


[work1@localhost ~]$ su root
Password:
[root@localhost work1]# mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.original0
[root@localhost work1]# ls -F /etc/yum.repos.d/
CentOS-Base.repo.original0 CentOS-Debuginfo.repo CentOS-Media.repo CentOS-Vault.repo
CentOS-CR.repo CentOS-fasttrack.repo CentOS-Sources.repo
[root@localhost work1]# wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.163.com/.help/CentOS7-Base-163.repo
--2020-04-14 19:47:51-- http://mirrors.163.com/.help/CentOS7-Base-163.repo
Resolving mirrors.163.com (mirrors.163.com)... 59.111.0.251
Connecting to mirrors.163.com (mirrors.163.com)|59.111.0.251|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 1572 (1.5K) [application/octet-stream]
Saving to: ‘/etc/yum.repos.d/CentOS-Base.repo’

100%[=========================================================================================================>] 1,572 --.-K/s in 0s

2020-04-14 19:47:51 (441 MB/s) - ‘/etc/yum.repos.d/CentOS-Base.repo’ saved [1572/1572]

[root@localhost work1]# ls -F /etc/yum.repos.d/
CentOS-Base.repo CentOS-CR.repo CentOS-fasttrack.repo CentOS-Sources.repo
CentOS-Base.repo.original0 CentOS-Debuginfo.repo CentOS-Media.repo CentOS-Vault.repo
[root@localhost work1]# cat -n /etc/yum.repos.d/CentOS-Base.repo
1 # CentOS-Base.repo
2 #
3 # The mirror system uses the connecting IP address of the client and the
4 # update status of each mirror to pick mirrors that are updated to and
5 # geographically close to the client. You should use this for CentOS updates
6 # unless you are manually picking other mirrors.
7 #
8 # If the mirrorlist= does not work for you, as a fall back you can try the
9 # remarked out baseurl= line instead.
10 #
11 #
12 [base]
13 name=CentOS-$releasever - Base - 163.com
14 #mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os
15 baseurl=http://mirrors.163.com/centos/$releasever/os/$basearch/
16 gpgcheck=1
17 gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-7
18
19 #released updates
20 [updates]
21 name=CentOS-$releasever - Updates - 163.com
22 #mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates
23 baseurl=http://mirrors.163.com/centos/$releasever/updates/$basearch/
24 gpgcheck=1
25 gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-7
26
27 #additional packages that may be useful
28 [extras]
29 name=CentOS-$releasever - Extras - 163.com
30 #mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras
31 baseurl=http://mirrors.163.com/centos/$releasever/extras/$basearch/
32 gpgcheck=1
33 gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-7
34
35 #additional packages that extend functionality of existing packages
36 [centosplus]
37 name=CentOS-$releasever - Plus - 163.com
38 baseurl=http://mirrors.163.com/centos/$releasever/centosplus/$basearch/
39 gpgcheck=1
40 enabled=0
41 gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-7
[root@localhost work1]# yum clean all
Loaded plugins: fastestmirror, langpacks
Cleaning repos: base extras updates
Cleaning up everything
Maybe you want: rm -rf /var/cache/yum, to also free up space taken by orphaned data from disabled or removed repos
Cleaning up list of fastest mirrors
[root@localhost work1]# yum makecache
Loaded plugins: fastestmirror, langpacks
Determining fastest mirrors
base | 3.6 kB 00:00:00
extras | 2.9 kB 00:00:00
updates | 2.9 kB 00:00:00
(1/10): base/7/x86_64/group_gz | 165 kB 00:00:00
(2/10): base/7/x86_64/primary_db | 6.0 MB 00:00:04
(3/10): base/7/x86_64/filelists_db | 7.3 MB 00:00:05
(4/10): extras/7/x86_64/primary_db | 165 kB 00:00:00
(5/10): extras/7/x86_64/filelists_db | 217 kB 00:00:00
(6/10): extras/7/x86_64/other_db | 106 kB 00:00:00
(7/10): base/7/x86_64/other_db | 2.6 MB 00:00:02
(8/10): updates/7/x86_64/filelists_db | 4.5 MB 00:00:04
(9/10): updates/7/x86_64/other_db | 573 kB 00:00:00
(10/10): updates/7/x86_64/primary_db | 7.6 MB 00:00:05
Metadata Cache Created
[root@localhost work1]#

同步时间服务器

[root@localhost master]# yum -y update
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
Resolving Dependencies
..................................................................................
Complete!
[root@localhost master]#
[root@localhost master]# yum install -y ntpdate
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
Package ntpdate-4.2.6p5-29.el7.centos.x86_64 already installed and latest version
Nothing to do
[root@localhost master]# ntpdate time.windows.com
14 Apr 20:30:00 ntpdate[32745]: adjust time server 20.189.79.72 offset -0.008414 sec
[root@localhost master]# ntpq -p
ntpq: read: Connection refused
[root@localhost master]# ntpstat
synchronised to NTP server (203.107.6.88) at stratum 3
time correct to within 26 ms
polling server every 64 s
[root@localhost master]# timedatectl status
Local time: Tue 2020-04-14 20:33:07 EDT
Universal time: Wed 2020-04-15 00:33:07 UTC
RTC time: Wed 2020-04-15 00:33:07
Time zone: America/New_York (EDT, -0400)
NTP enabled: yes
NTP synchronized: yes
RTC in local TZ: no
DST active: yes
Last DST change: DST began at
Sun 2020-03-08 01:59:59 EST
Sun 2020-03-08 03:00:00 EDT
Next DST change: DST ends (the clock jumps one hour backwards) at
Sun 2020-11-01 01:59:59 EDT
Sun 2020-11-01 01:00:00 EST
[root@localhost master]#


[root@localhost work0]# yum -y update
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
Resolving Dependencies
...................................................................................
Complete!
[root@localhost work0]#
[root@localhost work0]# ntp -p
bash: ntp: command not found...
[root@localhost work0]# ntpstat
synchronised to NTP server (162.159.200.123) at stratum 4
time correct to within 74 ms
polling server every 64 s
[root@localhost work0]# timedatectl status
Local time: Tue 2020-04-14 20:34:04 EDT
Universal time: Wed 2020-04-15 00:34:04 UTC
RTC time: Wed 2020-04-15 00:34:04
Time zone: America/New_York (EDT, -0400)
NTP enabled: yes
NTP synchronized: yes
RTC in local TZ: no
DST active: yes
Last DST change: DST began at
Sun 2020-03-08 01:59:59 EST
Sun 2020-03-08 03:00:00 EDT
Next DST change: DST ends (the clock jumps one hour backwards) at
Sun 2020-11-01 01:59:59 EDT
Sun 2020-11-01 01:00:00 EST
[root@localhost work0]#


[root@localhost work1]# yum -y update
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
Resolving Dependencies
.............................................................
Complete!
[root@localhost work1]#
[root@localhost work1]# ntp -p
bash: ntp: command not found...
[root@localhost work1]# ntpstat
synchronised to NTP server (185.209.85.222) at stratum 3
time correct to within 142 ms
polling server every 64 s
[root@localhost work1]# timedatectl status
Local time: Tue 2020-04-14 20:35:10 EDT
Universal time: Wed 2020-04-15 00:35:10 UTC
RTC time: Wed 2020-04-15 00:35:10
Time zone: America/New_York (EDT, -0400)
NTP enabled: yes
NTP synchronized: yes
RTC in local TZ: no
DST active: yes
Last DST change: DST began at
Sun 2020-03-08 01:59:59 EST
Sun 2020-03-08 03:00:00 EDT
Next DST change: DST ends (the clock jumps one hour backwards) at
Sun 2020-11-01 01:59:59 EDT
Sun 2020-11-01 01:00:00 EST
[root@localhost work1]#
########################################################

关闭防火墙及SELinux

[root@localhost master]# systemctl stop firewalld && systemctl disable firewalld
Removed symlink /etc/systemd/system/multi-user.target.wants/firewalld.service.
Removed symlink /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service.
[root@localhost master]# systemctl status firewalld
● firewalld.service - firewalld - dynamic firewall daemon
Loaded: loaded (/usr/lib/systemd/system/firewalld.service; disabled; vendor preset: enabled)
Active: inactive (dead)
Docs: man:firewalld(1)

Apr 14 20:19:13 localhost.localdomain firewalld[105054]: WARNING: COMMAND_FAILED: ‘/...
Apr 14 20:19:13 localhost.localdomain firewalld[105054]: WARNING: COMMAND_FAILED: ‘/...
Apr 14 20:19:13 localhost.localdomain firewalld[105054]: WARNING: COMMAND_FAILED: ‘/...
Apr 14 20:19:13 localhost.localdomain firewalld[105054]: WARNING: COMMAND_FAILED: ‘/...
Apr 14 20:19:13 localhost.localdomain firewalld[105054]: WARNING: COMMAND_FAILED: ‘/...
Apr 14 20:19:13 localhost.localdomain firewalld[105054]: WARNING: COMMAND_FAILED: ‘/...
Apr 14 20:19:13 localhost.localdomain firewalld[105054]: WARNING: COMMAND_FAILED: ‘/...
Apr 14 20:19:13 localhost.localdomain firewalld[105054]: WARNING: COMMAND_FAILED: ‘/...
Apr 14 20:40:52 localhost.localdomain systemd[1]: Stopping firewalld - dynamic fire....
Apr 14 20:40:53 localhost.localdomain systemd[1]: Stopped firewalld - dynamic firew....
Hint: Some lines were ellipsized, use -l to show in full.
[root@localhost master]# sed -i ‘s/^SELINUX=.*/SELINUX=disabled/‘ /etc/selinux/config && setenforce 0
[root@localhost master]# sestatus
SELinux status: enabled
SELinuxfs mount: /sys/fs/selinux
SELinux root directory: /etc/selinux
Loaded policy name: targeted
Current mode: permissive
Mode from config file: disabled
Policy MLS status: enabled
Policy deny_unknown status: allowed
Max kernel policy version: 31
[root@localhost master]#


[root@localhost work0]# systemctl stop firewalld && systemctl disable firewalld
Removed symlink /etc/systemd/system/multi-user.target.wants/firewalld.service.
Removed symlink /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service.
[root@localhost work0]# systemctl status firewalld
● firewalld.service - firewalld - dynamic firewall daemon
Loaded: loaded (/usr/lib/systemd/system/firewalld.service; disabled; vendor preset: enabled)
Active: inactive (dead)
Docs: man:firewalld(1)

Apr 14 20:23:12 localhost.localdomain firewalld[99036]: WARNING: COMMAND_FAILED: ‘/....
Apr 14 20:23:12 localhost.localdomain firewalld[99036]: WARNING: COMMAND_FAILED: ‘/....
Apr 14 20:23:12 localhost.localdomain firewalld[99036]: WARNING: COMMAND_FAILED: ‘/....
Apr 14 20:23:12 localhost.localdomain firewalld[99036]: WARNING: COMMAND_FAILED: ‘/....
Apr 14 20:23:12 localhost.localdomain firewalld[99036]: WARNING: COMMAND_FAILED: ‘/....
Apr 14 20:23:12 localhost.localdomain firewalld[99036]: WARNING: COMMAND_FAILED: ‘/....
Apr 14 20:23:12 localhost.localdomain firewalld[99036]: WARNING: COMMAND_FAILED: ‘/....
Apr 14 20:23:12 localhost.localdomain firewalld[99036]: WARNING: COMMAND_FAILED: ‘/....
Apr 14 20:42:28 localhost.localdomain systemd[1]: Stopping firewalld - dynamic fire....
Apr 14 20:42:29 localhost.localdomain systemd[1]: Stopped firewalld - dynamic firew....
Hint: Some lines were ellipsized, use -l to show in full.
[root@localhost work0]# sed -i ‘s/^SELINUX=.*/SELINUX=disabled/‘ /etc/selinux/config && setenforce 0
[root@localhost work0]# sestatus
SELinux status: enabled
SELinuxfs mount: /sys/fs/selinux
SELinux root directory: /etc/selinux
Loaded policy name: targeted
Current mode: permissive
Mode from config file: disabled
Policy MLS status: enabled
Policy deny_unknown status: allowed
Max kernel policy version: 31
[root@localhost work0]#


[root@localhost work1]# systemctl stop firewalld && systemctl disable firewalld
Removed symlink /etc/systemd/system/multi-user.target.wants/firewalld.service.
Removed symlink /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service.
[root@localhost work1]# systemctl status firewalld
● firewalld.service - firewalld - dynamic firewall daemon
Loaded: loaded (/usr/lib/systemd/system/firewalld.service; disabled; vendor preset: enabled)
Active: inactive (dead)
Docs: man:firewalld(1)

Apr 14 20:20:04 localhost.localdomain firewalld[108328]: WARNING: COMMAND_FAILED: ‘/usr/sbin/iptables -w10 -w --table filter --delete FORW...ain?).
Apr 14 20:20:04 localhost.localdomain firewalld[108328]: WARNING: COMMAND_FAILED: ‘/usr/sbin/iptables -w10 -w --table filter --delete FORW... name.
Apr 14 20:20:04 localhost.localdomain firewalld[108328]: WARNING: COMMAND_FAILED: ‘/usr/sbin/iptables -w10 -w --table filter --delete FORW... name.
Apr 14 20:20:04 localhost.localdomain firewalld[108328]: WARNING: COMMAND_FAILED: ‘/usr/sbin/iptables -w10 -w --table filter --delete INPU...ain?).
Apr 14 20:20:04 localhost.localdomain firewalld[108328]: WARNING: COMMAND_FAILED: ‘/usr/sbin/iptables -w10 -w --table filter --delete INPU...ain?).
Apr 14 20:20:04 localhost.localdomain firewalld[108328]: WARNING: COMMAND_FAILED: ‘/usr/sbin/iptables -w10 -w --table filter --delete OUTP...ain?).
Apr 14 20:20:04 localhost.localdomain firewalld[108328]: WARNING: COMMAND_FAILED: ‘/usr/sbin/iptables -w10 -w --table filter --delete INPU...ain?).
Apr 14 20:20:04 localhost.localdomain firewalld[108328]: WARNING: COMMAND_FAILED: ‘/usr/sbin/iptables -w10 -w --table filter --delete INPU...ain?).
Apr 14 20:43:20 localhost.localdomain systemd[1]: Stopping firewalld - dynamic firewall daemon...
Apr 14 20:43:22 localhost.localdomain systemd[1]: Stopped firewalld - dynamic firewall daemon.
Hint: Some lines were ellipsized, use -l to show in full.
[root@localhost work1]# sed -i ‘s/^SELINUX=.*/SELINUX=disabled/‘ /etc/selinux/config && setenforce 0
[root@localhost work1]# sestatus
SELinux status: enabled
SELinuxfs mount: /sys/fs/selinux
SELinux root directory: /etc/selinux
Loaded policy name: targeted
Current mode: permissive
Mode from config file: disabled
Policy MLS status: enabled
Policy deny_unknown status: allowed
Max kernel policy version: 31
[root@localhost work1]#
###########################################################

关闭 swap 分区

[root@localhost master]# swapoff -a
[root@localhost master]# sed -i ‘/ swap / s/^(.*)$/#\1/g‘ /etc/fstab
[root@localhost master]# cat -n /etc/fstab
1
2 #
3 # /etc/fstab
4 # Created by anaconda on Tue Apr 14 08:46:18 2020
5 #
6 # Accessible filesystems, by reference, are maintained under ‘/dev/disk‘
7 # See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info
8 #
9 UUID=ad08156d-ad9b-4525-8861-5ab554149601 / ext4 defaults 1 1
10 UUID=a872a80c-aaf7-4b70-af32-1f39bcd637cc /boot ext4 defaults 1 2
[root@localhost master]#
【我的master机器采用的是自定义分区,只分了/boot和/,因此在文件/etc/fstab中没有swap的相关信息。而我的work0和work1采用了默认分区,在文件/etc/fstab中可以看到swap的相关信息。】


[root@localhost work0]# swapoff -a
[root@localhost work0]# sed -i ‘/ swap / s/^(.*)$/#\1/g‘ /etc/fstab
[root@localhost work0]# cat -n /etc/fstab
1
2 #
3 # /etc/fstab
4 # Created by anaconda on Tue Apr 14 09:36:38 2020
5 #
6 # Accessible filesystems, by reference, are maintained under ‘/dev/disk‘
7 # See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info
8 #
9 /dev/mapper/centos-root / xfs defaults 0 0
10 UUID=a61e2021-e23e-4a8d-91bb-c0a3f59311eb /boot xfs defaults 0 0
11 #/dev/mapper/centos-swap swap swap defaults 0 0
[root@localhost work0]#


[root@localhost work1]# swapoff -a
[root@localhost work1]# sed -i ‘/ swap / s/^(.*)$/#\1/g‘ /etc/fstab
[root@localhost work1]# cat -n /etc/fstab
1
2 #
3 # /etc/fstab
4 # Created by anaconda on Tue Apr 14 10:12:56 2020
5 #
6 # Accessible filesystems, by reference, are maintained under ‘/dev/disk‘
7 # See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info
8 #
9 /dev/mapper/centos-root / xfs defaults 0 0
10 UUID=b38b9242-a8c9-4494-a833-c59ce0a9a13d /boot xfs defaults 0 0
11 #/dev/mapper/centos-swap swap swap defaults 0 0
[root@localhost work1]#

孟伯,20200411

交流联系:微信 1807479153 ,QQ 1807479153

CentOS系列教程(七)

标签:防火   tar   direct   ORC   space   mode   微信   isa   lips   

原文地址:https://blog.51cto.com/6286393/2487608

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!