• Oracle 19c RAC OS的准备检查阶段


    Step 1 : check out 物理存储,至少8G以上

    1. [root@node1 ~]# grep MemTotal /proc/meminfo
    2. MemTotal: 8154896 kB
    3. [root@node1 ~]#

    Step 2.check out Swap空间

    1. [root@node1 ~]# grep SwapTotal /proc/meminfo
    2. SwapTotal: 8257532 kB
    3. [root@node1 ~]#

    Step 3:check out 文件系统

    1. [root@node1 ~]#
    2. [root@node1 ~]# df -h
    3. Filesystem Size Used Avail Use% Mounted on
    4. devtmpfs 3.9G 0 3.9G 0% /dev
    5. tmpfs 8.0G 0 8.0G 0% /dev/shm
    6. tmpfs 3.9G 13M 3.9G 1% /run
    7. tmpfs 3.9G 0 3.9G 0% /sys/fs/cgroup
    8. /dev/mapper/centos-root 48G 14G 35G 29% /
    9. /dev/sda1 1014M 198M 817M 20% /boot
    10. /dev/mapper/centos-home 24G 46M 24G 1% /home
    11. tmpfs 797M 48K 797M 1% /run/user/54331
    12. tmpfs 797M 0 797M 0% /run/user/0
    13. [root@node1 ~]#

    Step 4: check out core

    1. [root@node1 ~]#
    2. [root@node1 ~]# cat /etc/redhat-release
    3. CentOS Linux release 7.5.1804 (Core)
    4. [root@node1 ~]# uname -a
    5. Linux node1 3.10.0-1160.76.1.el7.x86_64 #1 SMP Wed Aug 10 16:21:17 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
    6. [root@node1 ~]#

    Step 5:network check out and setting

    1. ifconfig -a
    2. ip addr

    [root@node1 ~]# ifconfig -a
    ens33: flags=4163  mtu 1500
            inet 192.168.8.111  netmask 255.255.255.0  broadcast 192.168.8.255
            inet6 fe80::e1f2:64b0:514a:353e  prefixlen 64  scopeid 0x20
            ether 00:0c:29:38:85:6b  txqueuelen 1000  (Ethernet)
            RX packets 2119214  bytes 3016503510 (2.8 GiB)
            RX errors 0  dropped 0  overruns 0  frame 0
            TX packets 184342  bytes 27860604 (26.5 MiB)
            TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

    ens34: flags=4163  mtu 1500
            inet 192.168.100.111  netmask 255.255.255.0  broadcast 192.168.100.255
            inet6 fe80::d4c3:9dc3:cf4b:effb  prefixlen 64  scopeid 0x20
            ether 00:0c:29:38:85:75  txqueuelen 1000  (Ethernet)
            RX packets 29  bytes 4433 (4.3 KiB)
            RX errors 0  dropped 0  overruns 0  frame 0
            TX packets 34  bytes 4555 (4.4 KiB)
            TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

    lo: flags=73  mtu 65536
            inet 127.0.0.1  netmask 255.0.0.0
            inet6 ::1  prefixlen 128  scopeid 0x10
            loop  txqueuelen 1000  (Local Loopback)
            RX packets 34  bytes 2690 (2.6 KiB)
            RX errors 0  dropped 0  overruns 0  frame 0
            TX packets 34  bytes 2690 (2.6 KiB)
            TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

    virbr0: flags=4099  mtu 1500
            inet 192.168.122.1  netmask 255.255.255.0  broadcast 192.168.122.255
            ether 52:54:00:52:aa:7a  txqueuelen 1000  (Ethernet)
            RX packets 0  bytes 0 (0.0 B)
            RX errors 0  dropped 0  overruns 0  frame 0
            TX packets 0  bytes 0 (0.0 B)
            TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

    virbr0-nic: flags=4098  mtu 1500
            ether 52:54:00:52:aa:7a  txqueuelen 1000  (Ethernet)
            RX packets 0  bytes 0 (0.0 B)
            RX errors 0  dropped 0  overruns 0  frame 0
            TX packets 0  bytes 0 (0.0 B)
            TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

    [root@node1 ~]# ip addr
    1: lo: mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
        link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
        inet 127.0.0.1/8 scope host lo
           valid_lft forever preferred_lft forever
        inet6 ::1/128 scope host
           valid_lft forever preferred_lft forever
    2: ens33: mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
        link/ether 00:0c:29:38:85:6b brd ff:ff:ff:ff:ff:ff
        inet 192.168.8.111/24 brd 192.168.8.255 scope global noprefixroute ens33
           valid_lft forever preferred_lft forever
        inet6 fe80::e1f2:64b0:514a:353e/64 scope link noprefixroute
           valid_lft forever preferred_lft forever
    3: ens34: mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
        link/ether 00:0c:29:38:85:75 brd ff:ff:ff:ff:ff:ff
        inet 192.168.100.111/24 brd 192.168.100.255 scope global noprefixroute ens34
           valid_lft forever preferred_lft forever
        inet6 fe80::d4c3:9dc3:cf4b:effb/64 scope link noprefixroute
           valid_lft forever preferred_lft forever
    4: virbr0: mtu 1500 qdisc noqueue state DOWN group default qlen 1000
        link/ether 52:54:00:52:aa:7a brd ff:ff:ff:ff:ff:ff
        inet 192.168.122.1/24 brd 192.168.122.255 scope global virbr0
           valid_lft forever preferred_lft forever
    5: virbr0-nic: mtu 1500 qdisc pfifo_fast master virbr0 state DOWN group default qlen 1000
        link/ether 52:54:00:52:aa:7a brd ff:ff:ff:ff:ff:ff
    [root@node1 ~]#

    Step 6: Check out NetworkManager服务

    1. # setting automatically:
    2. systemctl disable NetworkManager
    3. systemctl enable network
    4. # start/stop service:
    5. service NetworkManager stop
    6. # or
    7. systemctl start NetworkManager
    8. service network start
    9. # or
    10. systemctl start network

    Step 7: under the folder /etc/sysconfig/network-scripts, add the below parameter in ifcfg-ens33  and ifcfg-ens34

    HOTPLUG="no"

    两台机配好IP并重启网络服务后,将自动绑定划分的两块网卡。

    1. [root@node1 network-scripts]#
    2. [root@node1 network-scripts]# systemctl restart network
    3. [root@node1 network-scripts]#
    4. [root@node2 network-scripts]#
    5. [root@node2 network-scripts]# systemctl restart network
    6. [root@node2 network-scripts]#

    Step 8: close the firewalld.

    use the root execute below command on node1 and node2

    1. systemctl status firewalld ##first check out if firewalld be closed
    2. systemctl stop firewalld
    3. systemctl disable firewalld
    4. systemctl status firewalld
    1. [root@node1 network-scripts]#
    2. [root@node1 network-scripts]# systemctl status firewalld
    3. ● firewalld.service - firewalld - dynamic firewall daemon
    4. Loaded: loaded (/usr/lib/systemd/system/firewalld.service; disabled; vendor preset: enabled)
    5. Active: inactive (dead)
    6. Docs: man:firewalld(1)
    7. [root@node1 network-scripts]#
    8. [root@node2 network-scripts]#
    9. [root@node2 network-scripts]# systemctl restart network
    10. [root@node2 network-scripts]# systemctl status firewalld
    11. ● firewalld.service - firewalld - dynamic firewall daemon
    12. Loaded: loaded (/usr/lib/systemd/system/firewalld.service; disabled; vendor preset: enabled)
    13. Active: inactive (dead)
    14. Docs: man:firewalld(1)
    15. [root@node2 network-scripts]#

    Step 9 Close the SELinux

    use the root to execute below command.

    1. getenforce ##check out if display “Disabled”,if not ,please execute below command
    2. sed -i 's/=enforcing/=disabled/' /etc/selinux/config
    1. [root@node1 ~]# cat /etc/selinux/config
    2. # This file controls the state of SELinux on the system.
    3. # SELINUX= can take one of these three values:
    4. # enforcing - SELinux security policy is enforced.
    5. # permissive - SELinux prints warnings instead of enforcing.
    6. # disabled - No SELinux policy is loaded.
    7. SELINUX=enforcing
    8. # SELINUXTYPE= can take one of three two values:
    9. # targeted - Targeted processes are protected,
    10. # minimum - Modification of targeted policy. Only selected processes are protected.
    11. # mls - Multi Level Security protection.
    12. SELINUXTYPE=targeted
    13. [root@node1 ~]# sed -i 's/=enforcing/=disabled/' /etc/selinux/config
    14. [root@node1 ~]# cat /etc/selinux/config
    15. # This file controls the state of SELinux on the system.
    16. # SELINUX= can take one of these three values:
    17. # enforcing - SELinux security policy is enforced.
    18. # permissive - SELinux prints warnings instead of enforcing.
    19. # disabled - No SELinux policy is loaded.
    20. SELINUX=disabled
    21. # SELINUXTYPE= can take one of three two values:
    22. # targeted - Targeted processes are protected,
    23. # minimum - Modification of targeted policy. Only selected processes are protected.
    24. # mls - Multi Level Security protection.
    25. SELINUXTYPE=targeted
    26. [root@node1 ~]#
    27. [root@node2 ~]#
    28. [root@node2 ~]# cat /etc/selinux/config
    29. # This file controls the state of SELinux on the system.
    30. # SELINUX= can take one of these three values:
    31. # enforcing - SELinux security policy is enforced.
    32. # permissive - SELinux prints warnings instead of enforcing.
    33. # disabled - No SELinux policy is loaded.
    34. SELINUX=enforcing
    35. # SELINUXTYPE= can take one of three two values:
    36. # targeted - Targeted processes are protected,
    37. # minimum - Modification of targeted policy. Only selected processes are protected.
    38. # mls - Multi Level Security protection.
    39. SELINUXTYPE=targeted
    40. [root@node2 ~]# sed -i 's/=enforcing/=disabled/' /etc/selinux/config
    41. [root@node2 ~]# cat /etc/selinux/config
    42. # This file controls the state of SELinux on the system.
    43. # SELINUX= can take one of these three values:
    44. # enforcing - SELinux security policy is enforced.
    45. # permissive - SELinux prints warnings instead of enforcing.
    46. # disabled - No SELinux policy is loaded.
    47. SELINUX=disabled
    48. # SELINUXTYPE= can take one of three two values:
    49. # targeted - Targeted processes are protected,
    50. # minimum - Modification of targeted policy. Only selected processes are protected.
    51. # mls - Multi Level Security protection.
    52. SELINUXTYPE=targeted
    53. [root@node2 ~]#

    Step 10 : forbidden Transparent HugePages(THP)

    use the root to modify file /etc/default/grub

    1. [root@node1 ~]#
    2. [root@node1 ~]# cat /sys/kernel/mm/transparent_hugepage/enabled
    3. always madvise [never]
    4. [root@node1 ~]#
    5. # this display be forbidden
    6. [root@node2 ~]# cat /sys/kernel/mm/transparent_hugepage/enabled
    7. always madvise [never]
    8. [root@node2 ~]#

    [root@node1 ~]#
    [root@node1 ~]#  cat /sys/kernel/mm/transparent_hugepage/enabled
    always madvise [never]
    [root@node1 ~]#
    [root@node1 ~]#
    [root@node1 ~]#
    [root@node1 ~]# cat /etc/default/grub
    GRUB_TIMEOUT=5
    GRUB_DISTRIBUTOR="$(sed 's, release .*$,,g' /etc/system-release)"
    GRUB_DEFAULT=saved
    GRUB_DISABLE_SUBMENU=true
    GRUB_TERMINAL_OUTPUT="console"
    GRUB_CMDLINE_LINUX="rd.lvm.lv=centos/root rd.lvm.lv=centos/swap rhgb quiet"
    GRUB_DISABLE_RECOVERY="true"
    [root@node1 ~]# vim /etc/default/grub

    [root@node1 ~]# cat /etc/default/grub                          
    GRUB_TIMEOUT=5
    GRUB_DISTRIBUTOR="$(sed 's, release .*$,,g' /etc/system-release)"
    GRUB_DEFAULT=saved
    GRUB_DISABLE_SUBMENU=true
    GRUB_TERMINAL_OUTPUT="console"
    GRUB_CMDLINE_LINUX="rd.lvm.lv=centos/root rd.lvm.lv=centos/swap rhgb quiet  transparent_hugepage=never"
    GRUB_DISABLE_RECOVERY="true"
    [root@node1 ~]#
    [root@node1 ~]# grub2-mkconfig -o   /boot/grub2/grub.cfg
    Generating grub configuration file ...
    Found linux image: /boot/vmlinuz-3.10.0-1160.76.1.el7.x86_64
    Found initrd image: /boot/initramfs-3.10.0-1160.76.1.el7.x86_64.img
    Found linux image: /boot/vmlinuz-3.10.0-862.el7.x86_64
    Found initrd image: /boot/initramfs-3.10.0-862.el7.x86_64.img
    Found linux image: /boot/vmlinuz-0-rescue-ef1ade0242c746108e6148d618c791b5
    Found initrd image: /boot/initramfs-0-rescue-ef1ade0242c746108e6148d618c791b5.img
    done
    [root@node1 ~]# cat /sys/kernel/mm/transparent_hugepage/enabled
    always madvise [never]

    [root@node1 ~]#

     
    [root@node2 ~]#  cat /sys/kernel/mm/transparent_hugepage/enabled
    always madvise [never]
    [root@node2 ~]#
    [root@node2 ~]# cat /etc/default/grub
    GRUB_TIMEOUT=5
    GRUB_DISTRIBUTOR="$(sed 's, release .*$,,g' /etc/system-release)"
    GRUB_DEFAULT=saved
    GRUB_DISABLE_SUBMENU=true
    GRUB_TERMINAL_OUTPUT="console"
    GRUB_CMDLINE_LINUX="rd.lvm.lv=centos/root rd.lvm.lv=centos/swap rhgb quiet"
    GRUB_DISABLE_RECOVERY="true"
    [root@node2 ~]# vim /etc/default/grub
    [root@node2 ~]# cat /etc/default/grub
    GRUB_TIMEOUT=5
    GRUB_DISTRIBUTOR="$(sed 's, release .*$,,g' /etc/system-release)"
    GRUB_DEFAULT=saved
    GRUB_DISABLE_SUBMENU=true
    GRUB_TERMINAL_OUTPUT="console"
    GRUB_CMDLINE_LINUX="rd.lvm.lv=centos/root rd.lvm.lv=centos/swap rhgb quiet transparent_hugepage=never"
    GRUB_DISABLE_RECOVERY="true"
    [root@node2 ~]# grub2-mkconfig -o   /boot/grub2/grub.cfg
    Generating grub configuration file ...
    Found linux image: /boot/vmlinuz-3.10.0-1160.76.1.el7.x86_64
    Found initrd image: /boot/initramfs-3.10.0-1160.76.1.el7.x86_64.img
    Found linux image: /boot/vmlinuz-3.10.0-862.el7.x86_64
    Found initrd image: /boot/initramfs-3.10.0-862.el7.x86_64.img
    Found linux image: /boot/vmlinuz-0-rescue-cecdacd679114fb488322bed2dc06a53
    Found initrd image: /boot/initramfs-0-rescue-cecdacd679114fb488322bed2dc06a53.img
    done
    [root@node2 ~]# cat /sys/kernel/mm/transparent_hugepage/enabled
    always madvise [never]
    [root@node2 ~]#

    Step 11 setting NOZEROCONF 

    1. [root@node1 ~]# cat /etc/sysconfig/network
    2. # Created by anaconda
    3. NOZEROCONF=yes
    4. [root@node1 ~]#
    5. [root@node2 ~]#
    6. [root@node2 ~]# cat /etc/sysconfig/network
    7. # Created by anaconda
    8. NOZEROCONF=yes
    9. [root@node2 ~]#

    Step 12 : setting hosts

    1. [root@node1 ~]#
    2. [root@node1 ~]#
    3. [root@node1 ~]# cat /etc/hosts
    4. 127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
    5. ::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
    6. # Public
    7. 192.168.8.111 node1 node1.racdb.local
    8. 192.168.8.112 node2 node2.racdb.local
    9. # Private
    10. 192.168.100.111 node1-priv node1-priv.racdb.local
    11. 192.168.100.112 node2-priv node2-priv.racdb.local
    12. # Virtual
    13. 192.168.8.113 node1-vip node1-vip.racdb.local
    14. 192.168.8.114 node2-vip node2-vip.racdb.local
    15. # SCAN
    16. 192.168.8.115 node-cluster-scan node-cluster-scan.racdb.local
    17. 192.168.8.116 node-cluster-scan node-cluster-scan.racdb.local
    18. 192.168.8.117 node-cluster-scan node-cluster-scan.racdb.local
    19. [root@node1 ~]#

    Step 13 : Create user and user group

    user the root to execute as below command:

    1. groupadd -g 1000 oinstall
    2. groupadd -g 1100 dba
    3. groupadd -g 1200 oper
    4. groupadd -g 1300 asmadmin
    5. groupadd -g 1400 asmdba
    6. groupadd -g 1500 asmoper
    7. useradd -u 1001 -g oinstall -G asmadmin,asmdba,asmoper,dba -d /home/grid -m grid
    8. useradd -u 1000 -g oinstall -G dba,asmdba,oper -d /home/oracle -m oracle
    9. passwd oracle
    10. passwd grid

    setting passord unlimitted

    1. chage -M -1 oracle
    2. chage -M -1 grid
    3. chage -l oracle
    4. chage -l grid

    [root@node1 ~]# chage -M -1 oracle
    [root@node1 ~]# chage -M -1 grid
    [root@node1 ~]# chage -l oracle
    Last password change                                    : Nov 08, 2022
    Password expires                                        : never
    Password inactive                                       : never
    Account expires                                         : never
    Minimum number of days between password change          : 0
    Maximum number of days between password change          : -1
    Number of days of warning before password expires       : 7
    [root@node1 ~]# chage -l grid
    Last password change                                    : Nov 08, 2022
    Password expires                                        : never
    Password inactive                                       : never
    Account expires                                         : never
    Minimum number of days between password change          : 0
    Maximum number of days between password change          : -1
    Number of days of warning before password expires       : 7
    [root@node1 ~]#


    [root@node1 ~]#

    [root@node2 ~]# chage -M -1 oracle
    [root@node2 ~]# chage -M -1 grid
    [root@node2 ~]# chage -l oracle
    Last password change                                    : Nov 08, 2022
    Password expires                                        : never
    Password inactive                                       : never
    Account expires                                         : never
    Minimum number of days between password change          : 0
    Maximum number of days between password change          : -1
    Number of days of warning before password expires       : 7
    [root@node2 ~]# chage -l grid
    Last password change                                    : Nov 08, 2022
    Password expires                                        : never
    Password inactive                                       : never
    Account expires                                         : never
    Minimum number of days between password change          : 0
    Maximum number of days between password change          : -1
    Number of days of warning before password expires       : 7
    [root@node2 ~]#

    Step 14: check user and user group

    1. [root@node1 ~]#
    2. [root@node1 ~]# id oracle
    3. uid=54321(oracle) gid=54321(oinstall) groups=54321(oinstall),54322(dba),54323(oper),54324(backupdba),54325(dgdba),54326(kmdba),54327(asmdba),54330(racdba)
    4. [root@node1 ~]#
    5. [root@node1 ~]#
    6. [root@node1 ~]# id grid
    7. uid=54331(grid) gid=54321(oinstall) groups=54321(oinstall),54322(dba),54327(asmdba),54328(asmoper),54329(asmadmin),54330(racdba)
    8. [root@node1 ~]#
    9. [root@node1 ~]#
    10. [root@node1 ~]#
    1. [root@node2 ~]#
    2. [root@node2 ~]#
    3. [root@node2 ~]# id oracle
    4. uid=54321(oracle) gid=54321(oinstall) groups=54321(oinstall),54322(dba),54323(oper),54324(backupdba),54325(dgdba),54326(kmdba),54327(asmdba),54330(racdba)
    5. [root@node2 ~]#
    6. [root@node2 ~]#
    7. [root@node2 ~]#
    8. [root@node2 ~]# id grid
    9. uid=54331(grid) gid=54321(oinstall) groups=54321(oinstall),54322(dba),54327(asmdba),54328(asmoper),54329(asmadmin),54330(racdba)
    10. [root@node2 ~]#
    11. [root@node2 ~]#

    Step 15: make the installation directory

    use the root execute below command on node1 and node2.

    1. mkdir -p /oracle/app/oracle
    2. mkdir -p /oracle/app/grid
    3. mkdir -p /oracle/app/19.3.0/grid
    4. mkdir -p /oracle/app/oracle/product/ 19.3.0/dbhome_1
    5. chown -R grid:oinstall /oracle/app/grid
    6. chown -R grid:oinstall /oracle/app/ 19.3.0
    7. chown -R oracle:oinstall /oracle/app/oracle
    8. chmod -R 775 /oracle
    9. mkdir -p /oracle/app/oraInventory
    10. chown -R grid:oinstall /oracle/app/oraInventory
    11. chmod -R 775 /oracle/app/oraInventory

    Step16: Setting the user oracle and grid's parameter

    grid user :

    1. export ORACLE_BASE=/oracle/app/grid
    2. export ORACLE_HOME=/oracle/app/19.3.0/grid
    3. export ORACLE_SID=+ASM1
    4. export PATH=/oracle/app/19.3.0/grid/bin:/oracle/app/19.3.0/grid/OPatch:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:.
    5. export NLS_LANG=AMERICAN_AMERICA.ZHS16GBK
    6. export NLS_DATE_FORMAT='yyyy-mm-dd hh24:mi:ss'
    7. export LD_LIBRARY_PATH=/oracle/app/19.3.0/grid/lib:/usr/lib
    8. export LANG=en_US
    9. umask 022

    oracle user:

    1. export ORACLE_SID=racdb1 ##node 2 should modify to racdb2
    2. export ORACLE_BASE=/oracle/app/oracle
    3. export ORACLE_HOME=$ORACLE_BASE/product/19.3.0/dbhome_1
    4. export TNS_ADMIN=$ORACLE_HOME/network/admin
    5. export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib
    6. export NLS_DATE_FORMAT="YYYY-MM-DD HH24:MI:SS"
    7. export TMP=/tmp
    8. export TMPDIR=$TMP
    9. export PATH=$ORACLE_HOME/bin:ORACLE_HOME/OPatch:$PATH
    10. export NLS_LANG="AMERICAN_CHINA.ZHS16GBK"
    11. umask 022
    1. export ORACLE_HOME=/oracle/app/19.3.0/grid
    2. export PATH=$PATH:$ORACLE_HOME/bin

    Step 17 install rpm package

    1. yum install -y compat*
    2. yum install -y compat-libcap*
    3. yum install -y gcc*
    4. yum install -y gcc-c++*
    5. yum install -y glibc-devel*
    6. yum install -y ksh*
    7. yum install -y libstdc++-devel*
    8. yum install -y libaio-devel*

    Step 18: Core parameter setting

    1. # 配置以下内核参数
    2. cat >/etc/sysctl.d/97-oracledatabase-sysctl.conf<<EOF
    3. fs.aio-max-nr = 1048576
    4. fs.file-max = 6815744
    5. kernel.shmall = 2097152
    6. kernel.shmmax = 4294967295
    7. kernel.shmmni = 4096
    8. kernel.sem = 250 32000 100 128
    9. net.ipv4.ip_local_port_range = 9000 65500
    10. net.core.rmem_default = 262144
    11. net.core.rmem_max = 4194304
    12. net.core.wmem_default = 262144
    13. net.core.wmem_max = 1048576
    14. EOF
    15. # 使配置生效
    16. sysctl --system

    Step 19 : close other services:

    1. systemctl stop avahi-dnsconfd
    2. systemctl stop avahi-daemon
    3. systemctl stop cups
    4. systemctl stop postfix
    5. systemctl stop smartd
    6. systemctl disable avahi-dnsconfd
    7. systemctl disable avahi-daemon
    8. systemctl disable cups
    9. systemctl disable postfix
    10. systemctl disable smartd

    [root@node1 ~]# systemctl stop avahi-dnsconfd

    systemctl stop avahi-daemon
    Failed to stop avahi-dnsconfd.service: Unit avahi-dnsconfd.service not loaded.
    [root@node1 ~]#
    [root@node1 ~]# systemctl stop avahi-daemon

    systemctl stop cups

    systemctl stop postfix

    Warning: Stopping avahi-daemon.service, but it can still be activated by:
      avahi-daemon.socket
    [root@node1 ~]#
    [root@node1 ~]# systemctl stop cups
    systemctl stop smartd

    systemctl disable avahi-dnsconfd

    Warning: Stopping cups.service, but it can still be activated by:
      cups.socket
      cups.path
    [root@node1 ~]#
    [root@node1 ~]# systemctl stop postfix
    systemctl disable avahi-daemon

    systemctl disable cups

    systemctl disable postfix

    [root@node1 ~]#
    [root@node1 ~]# systemctl stop smartd
    systemctl disable smartd[root@node1 ~]#
    [root@node1 ~]# systemctl disable avahi-dnsconfd
    Failed to execute operation: No such file or directory
    [root@node1 ~]#
    [root@node1 ~]# systemctl disable avahi-daemon
    Removed symlink /etc/systemd/system/multi-user.target.wants/avahi-daemon.service.
    Removed symlink /etc/systemd/system/sockets.target.wants/avahi-daemon.socket.
    Removed symlink /etc/systemd/system/dbus-org.freedesktop.Avahi.service.
    [root@node1 ~]#
    [root@node1 ~]# systemctl disable cups
    Removed symlink /etc/systemd/system/multi-user.target.wants/cups.path.
    Removed symlink /etc/systemd/system/multi-user.target.wants/cups.service.
    Removed symlink /etc/systemd/system/sockets.target.wants/cups.socket.
    Removed symlink /etc/systemd/system/printer.target.wants/cups.service.
    [root@node1 ~]#
    [root@node1 ~]# systemctl disable postfix
    Removed symlink /etc/systemd/system/multi-user.target.wants/postfix.service.
    [root@node1 ~]#
    [root@node1 ~]# systemctl disable smartd
    Removed symlink /etc/systemd/system/multi-user.target.wants/smartd.service.
    [root@node1 ~]#
    [root@node1 ~]#

    Step 20: setting NTP service

    在Linux7上,先用root禁用默认的chronyd服务,再下载安装NTP服务

    1. # systemctl stop chronyd
    2. # systemctl disable chronyd

     

    1. [root@node1 ~]#
    2. [root@node1 ~]#
    3. [root@node1 ~]# systemctl stop chronyd
    4. [root@node1 ~]# systemctl disable chronyd
    5. Removed symlink /etc/systemd/system/multi-user.target.wants/chronyd.service.
    6. [root@node1 ~]#
    7. [root@node1 ~]#
    8. [root@node1 ~]#
    9. [root@node1 ~]# yum install ntp
    10. Loaded plugins: fastestmirror, langpacks
    11. Loading mirror speeds from cached hostfile
    12. * base: mirrors.ustc.edu.cn
    13. * extras: mirrors.ustc.edu.cn
    14. * updates: mirrors.ustc.edu.cn
    15. Resolving Dependencies
    16. --> Running transaction check
    17. ---> Package ntp.x86_64 0:4.2.6p5-29.el7.centos.2 will be installed
    18. --> Processing Dependency: ntpdate = 4.2.6p5-29.el7.centos.2 for package: ntp-4.2.6p5-29.el7.centos.2.x86_64
    19. --> Processing Dependency: libopts.so.25()(64bit) for package: ntp-4.2.6p5-29.el7.centos.2.x86_64
    20. --> Running transaction check
    21. ---> Package autogen-libopts.x86_64 0:5.18-5.el7 will be installed
    22. ---> Package ntpdate.x86_64 0:4.2.6p5-28.el7.centos will be updated
    23. ---> Package ntpdate.x86_64 0:4.2.6p5-29.el7.centos.2 will be an update
    24. --> Finished Dependency Resolution
    25. Dependencies Resolved
    26. =========================================================================================================================================================================================================================================
    27. Package Arch Version Repository Size
    28. =========================================================================================================================================================================================================================================
    29. Installing:
    30. ntp x86_64 4.2.6p5-29.el7.centos.2 base 549 k
    31. Installing for dependencies:
    32. autogen-libopts x86_64 5.18-5.el7 base 66 k
    33. Updating for dependencies:
    34. ntpdate x86_64 4.2.6p5-29.el7.centos.2 base 87 k
    35. Transaction Summary
    36. =========================================================================================================================================================================================================================================
    37. Install 1 Package (+1 Dependent package)
    38. Upgrade ( 1 Dependent package)
    39. Total size: 701 k
    40. Total download size: 615 k
    41. Is this ok [y/d/N]: y
    42. Downloading packages:
    43. (1/2): ntp-4.2.6p5-29.el7.centos.2.x86_64.rpm | 549 kB 00:00:00
    44. (2/2): autogen-libopts-5.18-5.el7.x86_64.rpm | 66 kB 00:00:00
    45. -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    46. Total 1.6 MB/s | 615 kB 00:00:00
    47. Running transaction check
    48. Running transaction test
    49. Transaction test succeeded
    50. Running transaction
    51. Updating : ntpdate-4.2.6p5-29.el7.centos.2.x86_64 1/4
    52. Installing : autogen-libopts-5.18-5.el7.x86_64 2/4
    53. Installing : ntp-4.2.6p5-29.el7.centos.2.x86_64 3/4
    54. Cleanup : ntpdate-4.2.6p5-28.el7.centos.x86_64 4/4
    55. Verifying : autogen-libopts-5.18-5.el7.x86_64 1/4
    56. Verifying : ntpdate-4.2.6p5-29.el7.centos.2.x86_64 2/4
    57. Verifying : ntp-4.2.6p5-29.el7.centos.2.x86_64 3/4
    58. Verifying : ntpdate-4.2.6p5-28.el7.centos.x86_64 4/4
    59. Installed:
    60. ntp.x86_64 0:4.2.6p5-29.el7.centos.2
    61. Dependency Installed:
    62. autogen-libopts.x86_64 0:5.18-5.el7
    63. Dependency Updated:
    64. ntpdate.x86_64 0:4.2.6p5-29.el7.centos.2
    65. Complete!
    66. [root@node1 ~]#
    67. [root@node1 ~]# systemctl enable ntpd
    68. Created symlink from /etc/systemd/system/multi-user.target.wants/ntpd.service to /usr/lib/systemd/system/ntpd.service.
    69. [root@node1 ~]# systemctl start ntpd
    70. [root@node1 ~]#
    71. [root@node1 ~]# vi /etc/sysconfig/ntpd
    72. [root@node1 ~]# systemctl restart ntpd.service
    73. [root@node1 ~]# vi /etc/ntp.conf
    74. [root@node1 ~]#
    75. [root@node1 ~]#
    76. [root@node1 ~]# vi /etc/ntp.conf
    77. [root@node1 ~]#
    78. [root@node1 ~]#
    79. [root@node1 ~]# systemctl stop ntpd
    80. [root@node1 ~]#
    81. [root@node1 ~]# systemctl start ntpd.service
    82. [root@node1 ~]#
    83. [root@node1 ~]#
    84. [root@node1 ~]# hwclock --systohc
    85. [root@node1 ~]#
    86. [root@node1 ~]# hwclock;date
    87. Tue 08 Nov 2022 06:35:13 PM CST -0.990247 seconds
    88. Tue Nov 8 18:35:12 CST 2022
    89. [root@node1 ~]#
    90. [root@node1 ~]#

    选择chronyd同步时间:因此需要使之生效:

    1. [root@node1 ~]#
    2. [root@node1 ~]# systemctl enable --now chronyd
    3. Created symlink from /etc/systemd/system/multi-user.target.wants/chronyd.service to /usr/lib/systemd/system/chronyd.service.
    4. [root@node1 ~]# systemctl status chronyd
    5. ● chronyd.service - NTP client/server
    6. Loaded: loaded (/usr/lib/systemd/system/chronyd.service; enabled; vendor preset: enabled)
    7. Active: active (running) since Tue 2022-11-08 18:39:08 CST; 37s ago
    8. Docs: man:chronyd(8)
    9. man:chrony.conf(5)
    10. Process: 13726 ExecStartPost=/usr/libexec/chrony-helper update-daemon (code=exited, status=0/SUCCESS)
    11. Process: 13722 ExecStart=/usr/sbin/chronyd $OPTIONS (code=exited, status=0/SUCCESS)
    12. Main PID: 13724 (chronyd)
    13. Tasks: 1
    14. CGroup: /system.slice/chronyd.service
    15. └─13724 /usr/sbin/chronyd
    16. Nov 08 18:39:07 node1 systemd[1]: Starting NTP client/server...
    17. Nov 08 18:39:08 node1 chronyd[13724]: chronyd version 3.4 starting (+CMDMON +NTP +REFCLOCK +RTC +PRIVDROP +SCFILTER +SIGND +ASYNCDNS +SECHASH +IPV6 +DEBUG)
    18. Nov 08 18:39:08 node1 chronyd[13724]: Frequency 0.389 +/- 1.517 ppm read from /var/lib/chrony/drift
    19. Nov 08 18:39:08 node1 systemd[1]: Started NTP client/server.
    20. Nov 08 18:39:14 node1 chronyd[13724]: Selected source 119.28.206.193
    21. Nov 08 18:39:16 node1 chronyd[13724]: Source 108.59.2.24 replaced with 111.230.189.174
    22. [root@node1 ~]#

  • 相关阅读:
    如何让 GPT 输出稳定的 JSON
    C++11 -------- 类的新功能+可变参数模板+emplace接口
    【c++百日刷题计划】 ———— DAY4,带你轻松学习算法
    Ubuntu搭建openvpn服务器
    华为鲲鹏服务器
    Coursera耶鲁大学金融课程:Financial Markets 笔记Week 02
    Linux 操作系统中如何检查系统的启动和关机日志
    如何开始在 github 上学习东西?
    响应式布局经典范例——巨幅背景大标题
    台式机U盘安装Centos7 安装界面黑屏并且没有网卡驱动
  • 原文地址:https://blog.csdn.net/u011868279/article/details/127754768