ChinaOpen
发布于

101-环境准备查验篇

1、Windows CPU 是否支持 AVX,培训的讲师提出了要求 CPU 支持 AVX。没有给出方法。现在给出方法:下载 CPU-Z 软件,进行安装后,可以看到是否支持 AVX、AVX2 等 CPU 指令集,我的 CPU 支持的指令集如下:MMX,SSE,SSE2,SSE3,SSSE3,SSE4.1,SSE4.2,EM64T,AES,AVX,AVX2,FMA3。(http://forum.oushu.com/api/image/images/2022/12/19/27c741c51e8f0c13a5c6849c0c0b85bf.png)
1.1 CPU-Z 下载地址: https://www.cpuid.com/softwares/cpu-z.html Version: 2.03.0.x64
1.2 示例图片链接:(http://forum.oushu.com/api/image/images/2022/12/19/27c741c51e8f0c13a5c6849c0c0b85bf.png)

**2、VMWare 网络配置:**默认的网络配置是 NAT,如果想要让 CentOS 7.4 的虚机与 Windows 或 MacOS 宿主机具有想同网段地址,需要将 VMWare 的网络配置成 Bridge 桥接模式。配制后,在 CentOS 7.4 中修改一下 IP 地址配制就可以和宿主机具有同网段地址了,就可以使用 SSH 客户端软件连接 CentOS 7.4 了!
2.1 修改 VMware Bridge 示例图片链接:(http://forum.oushu.com/api/image/images/2022/12/19/6bc563293d56612b223e77cef18ab3cf.png)
2.2 CentOS 7.4 图形化修改 IP 地址过程链接
(http://forum.oushu.com/api/image/images/2022/12/19/6c7c6925cc5eec111e0ebc55619bfb81.png)
(http://forum.oushu.com/api/image/images/2022/12/19/bfc2c82951a8f4de07e045c7c82925de.png)
(http://forum.oushu.com/api/image/images/2022/12/19/0ff71566954023141e991989c8cef458.png)
**2.3 重启网络服务:**systemctl restart network

3、CentOS 7.4 环境配置:默认的配置开启了 SELinux,Firewalld,没有开启 NTP。需要关闭 SELinux、Firewalld,开启 chronyd 管理的 NTP。
3.1 关闭 SELinux: 将 /etc/sysconfig/selinux 文件中的 SELINUX,修改为 disabled,修改后文件如下:(注:需要重启操作系统:reboot)

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

This file controls the state of SELinux on the system.

SELINUX= can take one of these three values:****

enforcing - SELinux security policy is enforced.

permissive - SELinux prints warnings instead of enforcing.

disabled - No SELinux policy is loaded.

#SELINUX=enforcing
SELINUX=disabled

SELINUXTYPE= can take one of three two values:

targeted - Targeted processes are protected,

minimum - Modification of targeted policy. Only selected processes are protected.

mls - Multi Level Security protection.

SELINUXTYPE=targeted
#####################################################################################################################

**3.2 关闭 firewalld: **systemctl stop firewalld; systemctl disable firewalld

3.3 开启 chronyd 控制的 NTP
3.3.1 yum install chrony
** 3.3.2 systemctl start chronyd**
** 3.3.3 systemctl enable chronyd**
使 CentOS 7.4 连网后,使用默认的 chrony 配置文件【/etc/chrony.conf】就可以了,我的配置文件如下:

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

Use public servers from the pool.ntp.org project.

Please consider joining the pool (http://www.pool.ntp.org/join.html).

server 0.centos.pool.ntp.org iburst
server 1.centos.pool.ntp.org iburst
server 2.centos.pool.ntp.org iburst
server 3.centos.pool.ntp.org iburst

Record the rate at which the system clock gains/losses time.

driftfile /var/lib/chrony/drift

Allow the system clock to be stepped in the first three updates

if its offset is larger than 1 second.

makestep 1.0 3

Enable kernel synchronization of the real-time clock (RTC).

rtcsync

Enable hardware timestamping on all interfaces that support it.

#hwtimestamp *

Increase the minimum number of selectable sources required to adjust

the system clock.

#minsources 2

Allow NTP client access from local network.

#allow 192.168.0.0/16

Serve time even if not synchronized to a time source.

#local stratum 10

Specify file containing keys for NTP authentication.

#keyfile /etc/chrony.keys

Specify directory for log files.

logdir /var/log/chrony

Select which information is logged.

#log measurements statistics tracking
####################################################################################################

校验:

3.3.4 chronyc tracking

Reference ID : 8BC7D7FB (139.199.215.251)
Stratum : 3
Ref time (UTC) : Mon Dec 19 05:24:58 2022
System time : 0.000002729 seconds fast of NTP time
Last offset : +0.000772976 seconds
RMS offset : 0.064235285 seconds
Frequency : 3.276 ppm slow
Residual freq : +0.000 ppm
Skew : 1.020 ppm
Root delay : 0.046379201 seconds
Root dispersion : 0.023327177 seconds
Update interval : 130.5 seconds
Leap status : Normal

3.3.5 chronyc sources

210 Number of sources = 4
MS Name/IP address Stratum Poll Reach LastRx Last sample

^- ntp7.flashdance.cx 2 10 3 23m -409us[ -10ms] +/- 248ms
^* 139.199.215.251 2 10 7 1155 +14ms[ +15ms] +/- 81ms
^? time.cloudflare.com 0 6 0 - +0ns[ +0ns] +/- 0ns
^+ 111.230.189.174 2 10 7 246 +12ms[ +12ms] +/- 69ms

3.3.6 chronyc sourcestats

210 Number of sources = 4
Name/IP Address NP NR Span Frequency Freq Skew Offset Std Dev

ntp7.flashdance.cx 17 9 222m +2.959 1.380 +36ms 3184us
139.199.215.251 31 17 229m -0.597 1.203 -12ms 5146us
time.cloudflare.com 0 0 0 +0.000 2000.000 +0ns 4000ms
111.230.189.174 31 15 245m +1.119 1.445 +15ms 5285us

**3.3.7 timedatectl **

 Local time: Mon 2022-12-19 13:45:41 CST

Universal time: Mon 2022-12-19 05:45:41 UTC
RTC time: Mon 2022-12-19 05:45:41
Time zone: Asia/Shanghai (CST, +0800)
NTP enabled: yes
NTP synchronized: yes
RTC in local TZ: no
DST active: n/a

评论
    test