在Oracle Linux 7.1上安装Docker

在Oracle Linux 7.1上安装Docker
1.首先使用正确的yum设置来升级Oracle Linux 7.1实例。为了安装最新的Docker版本(18.9.1.ce),需要ol7_latest,ol7_uekr4与ol7_addons启用

[root@localhost /]# cd /etc/yum.repos.d/
[root@localhost /]#wget http://yum.oracle.com/public-yum-ol7.repo
[root@localhost yum.repos.d]# vi public-yum-ol7.repo
[ol7_latest]
name=Oracle Linux $releasever Latest ($basearch)
baseurl=http://yum.oracle.com/repo/OracleLinux/OL7/latest/$basearch/
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
gpgcheck=1
enabled=1

[ol7_UEKR4]
name=Latest Unbreakable Enterprise Kernel Release 4 for Oracle Linux $releasever ($basearch)
baseurl=http://yum.oracle.com/repo/OracleLinux/OL7/UEKR4/$basearch/
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
gpgcheck=1
enabled=1

[ol7_addons]
name=Oracle Linux $releasever Add ons ($basearch)
baseurl=http://yum.oracle.com/repo/OracleLinux/OL7/addons/$basearch/
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
gpgcheck=1
enabled=1

2.开始安装docker

[root@localhost yum.repos.d]# yum install docker-engine
Loaded plugins: langpacks
ol7_UEKR4                                                                                                                                                                                                            | 2.5 kB  00:00:00
ol7_addons                                                                                                                                                                                                           | 1.2 kB  00:00:00
ol7_latest                                                                                                                                                                                                           | 2.7 kB  00:00:00
(1/4): ol7_addons/x86_64/updateinfo                                                                                                                                                                                  |  60 kB  00:00:00
(2/4): ol7_UEKR4/x86_64/updateinfo                                                                                                                                                                                   |  82 kB  00:00:01
(3/4): ol7_addons/x86_64/primary                                                                                                                                                                                     |  82 kB  00:00:02
(4/4): ol7_UEKR4/x86_64/primary_db                                                                                                                                                                                   | 4.0 MB  00:03:38
ol7_addons                                                                                                                                                                                                                          328/328
Resolving Dependencies
--> Running transaction check
---> Package docker-engine.x86_64 0:18.09.1.ol-1.0.5.el7 will be installed
--> Processing Dependency: container-selinux >= 2:2.77 for package: docker-engine-18.09.1.ol-1.0.5.el7.x86_64
--> Processing Dependency: libseccomp >= 2.3 for package: docker-engine-18.09.1.ol-1.0.5.el7.x86_64
--> Processing Dependency: containerd for package: docker-engine-18.09.1.ol-1.0.5.el7.x86_64
--> Processing Dependency: docker-cli for package: docker-engine-18.09.1.ol-1.0.5.el7.x86_64
--> Processing Dependency: runc for package: docker-engine-18.09.1.ol-1.0.5.el7.x86_64
--> Processing Dependency: libdevmapper.so.1.02(DM_1_02_97)(64bit) for package: docker-engine-18.09.1.ol-1.0.5.el7.x86_64
--> Processing Dependency: libsystemd.so.0(LIBSYSTEMD_209)(64bit) for package: docker-engine-18.09.1.ol-1.0.5.el7.x86_64
--> Processing Dependency: libsystemd.so.0()(64bit) for package: docker-engine-18.09.1.ol-1.0.5.el7.x86_64
--> Running transaction check
---> Package container-selinux.noarch 2:2.77-5.el7 will be installed
--> Processing Dependency: selinux-policy-base >= 3.13.1-216.el7 for package: 2:container-selinux-2.77-5.el7.noarch
--> Processing Dependency: selinux-policy >= 3.13.1-216.el7 for package: 2:container-selinux-2.77-5.el7.noarch
--> Processing Dependency: policycoreutils >= 2.5-11 for package: 2:container-selinux-2.77-5.el7.noarch
--> Processing Dependency: selinux-policy-targeted >= 3.13.1-216.el7 for package: 2:container-selinux-2.77-5.el7.noarch
---> Package containerd.x86_64 0:1.2.0-1.0.5.el7 will be installed
---> Package device-mapper-libs.x86_64 7:1.02.93-3.el7 will be updated
--> Processing Dependency: device-mapper-libs = 7:1.02.93-3.el7 for package: 7:device-mapper-1.02.93-3.el7.x86_64
---> Package device-mapper-libs.x86_64 7:1.02.149-10.0.3.el7_6.8 will be an update
---> Package docker-cli.x86_64 0:18.09.1.ol-1.0.5.el7 will be installed
---> Package libseccomp.x86_64 0:2.1.1-2.el7 will be updated
---> Package libseccomp.x86_64 0:2.3.1-3.el7 will be an update
---> Package runc.x86_64 0:1.0.0-19.rc5.git4bb1fe4.0.3.el7 will be installed
--> Processing Dependency: criu for package: runc-1.0.0-19.rc5.git4bb1fe4.0.3.el7.x86_64
---> Package systemd-libs.x86_64 0:208-20.0.1.el7 will be updated
--> Processing Dependency: systemd-libs = 208-20.0.1.el7 for package: systemd-208-20.0.1.el7.x86_64
---> Package systemd-libs.x86_64 0:219-62.0.4.el7_6.7 will be an update
--> Processing Dependency: liblz4.so.1()(64bit) for package: systemd-libs-219-62.0.4.el7_6.7.x86_64
--> Running transaction check
---> Package criu.x86_64 0:3.9-5.el7 will be installed
--> Processing Dependency: libprotobuf-c.so.1(LIBPROTOBUF_C_1.0.0)(64bit) for package: criu-3.9-5.el7.x86_64
--> Processing Dependency: libnl-3.so.200(libnl_3)(64bit) for package: criu-3.9-5.el7.x86_64
--> Processing Dependency: libprotobuf-c.so.1()(64bit) for package: criu-3.9-5.el7.x86_64
--> Processing Dependency: libnet.so.1()(64bit) for package: criu-3.9-5.el7.x86_64
---> Package device-mapper.x86_64 7:1.02.93-3.el7 will be updated
--> Processing Dependency: device-mapper = 7:1.02.93-3.el7 for package: 7:device-mapper-event-1.02.93-3.el7.x86_64
---> Package device-mapper.x86_64 7:1.02.149-10.0.3.el7_6.8 will be an update
---> Package lz4.x86_64 0:1.7.5-2.0.1.el7 will be installed
---> Package policycoreutils.x86_64 0:2.2.5-15.0.1.el7 will be updated
--> Processing Dependency: policycoreutils = 2.2.5-15.0.1.el7 for package: policycoreutils-python-2.2.5-15.0.1.el7.x86_64
---> Package policycoreutils.x86_64 0:2.5-29.0.1.el7_6.1 will be an update
--> Processing Dependency: libsemanage >= 2.5-14 for package: policycoreutils-2.5-29.0.1.el7_6.1.x86_64
--> Processing Dependency: libsepol >= 2.5-10 for package: policycoreutils-2.5-29.0.1.el7_6.1.x86_64
--> Processing Dependency: libselinux-utils >= 2.5-14 for package: policycoreutils-2.5-29.0.1.el7_6.1.x86_64
--> Processing Dependency: libsepol.so.1(LIBSEPOL_1.1)(64bit) for package: policycoreutils-2.5-29.0.1.el7_6.1.x86_64
--> Processing Dependency: libsemanage.so.1(LIBSEMANAGE_1.1)(64bit) for package: policycoreutils-2.5-29.0.1.el7_6.1.x86_64
--> Processing Dependency: libsepol.so.1(LIBSEPOL_1.0)(64bit) for package: policycoreutils-2.5-29.0.1.el7_6.1.x86_64
---> Package selinux-policy.noarch 0:3.13.1-23.0.1.el7 will be updated
---> Package selinux-policy.noarch 0:3.13.1-229.0.3.el7_6.12 will be an update
---> Package selinux-policy-targeted.noarch 0:3.13.1-23.0.1.el7 will be updated
---> Package selinux-policy-targeted.noarch 0:3.13.1-229.0.3.el7_6.12 will be an update
---> Package systemd.x86_64 0:208-20.0.1.el7 will be updated
--> Processing Dependency: systemd = 208-20.0.1.el7 for package: libgudev1-208-20.0.1.el7.x86_64
--> Processing Dependency: systemd = 208-20.0.1.el7 for package: systemd-sysv-208-20.0.1.el7.x86_64
--> Processing Dependency: systemd = 208-20.0.1.el7 for package: systemd-python-208-20.0.1.el7.x86_64
---> Package systemd.x86_64 0:219-62.0.4.el7_6.7 will be an update
--> Processing Dependency: kmod >= 18-4 for package: systemd-219-62.0.4.el7_6.7.x86_64
--> Processing Dependency: libcryptsetup.so.12(CRYPTSETUP_2.0)(64bit) for package: systemd-219-62.0.4.el7_6.7.x86_64
--> Processing Dependency: libcryptsetup.so.12()(64bit) for package: systemd-219-62.0.4.el7_6.7.x86_64
--> Running transaction check
---> Package cryptsetup-libs.x86_64 0:1.6.6-3.el7 will be updated
--> Processing Dependency: cryptsetup-libs = 1.6.6-3.el7 for package: cryptsetup-python-1.6.6-3.el7.x86_64
--> Processing Dependency: cryptsetup-libs(x86-64) = 1.6.6-3.el7 for package: cryptsetup-1.6.6-3.el7.x86_64
---> Package cryptsetup-libs.x86_64 0:2.0.3-3.el7 will be an update
---> Package device-mapper-event.x86_64 7:1.02.93-3.el7 will be updated
--> Processing Dependency: device-mapper-event = 7:1.02.93-3.el7 for package: 7:lvm2-libs-2.02.115-3.el7.x86_64
---> Package device-mapper-event.x86_64 7:1.02.149-10.0.3.el7_6.8 will be an update
--> Processing Dependency: device-mapper-event-libs = 7:1.02.149-10.0.3.el7_6.8 for package: 7:device-mapper-event-1.02.149-10.0.3.el7_6.8.x86_64
---> Package kmod.x86_64 0:14-10.el7 will be updated
---> Package kmod.x86_64 0:20-23.0.1.el7 will be an update
---> Package libgudev1.x86_64 0:208-20.0.1.el7 will be updated
---> Package libgudev1.x86_64 0:219-62.0.4.el7_6.7 will be an update
--> Processing Dependency: glib2 >= 2.42 for package: libgudev1-219-62.0.4.el7_6.7.x86_64
---> Package libnet.x86_64 0:1.1.6-7.el7 will be installed
---> Package libnl3.x86_64 0:3.2.21-8.0.1.el7 will be updated
--> Processing Dependency: libnl3 = 3.2.21-8.0.1.el7 for package: libnl3-cli-3.2.21-8.0.1.el7.x86_64
---> Package libnl3.x86_64 0:3.2.28-4.el7 will be an update
---> Package libselinux-utils.x86_64 0:2.2.2-6.el7 will be updated
---> Package libselinux-utils.x86_64 0:2.5-14.1.el7 will be an update
--> Processing Dependency: libselinux(x86-64) = 2.5-14.1.el7 for package: libselinux-utils-2.5-14.1.el7.x86_64
---> Package libsemanage.x86_64 0:2.1.10-16.el7 will be updated
--> Processing Dependency: libsemanage = 2.1.10-16.el7 for package: libsemanage-python-2.1.10-16.el7.x86_64
---> Package libsemanage.x86_64 0:2.5-14.el7 will be an update
---> Package libsepol.x86_64 0:2.1.9-3.el7 will be updated
---> Package libsepol.x86_64 0:2.5-10.el7 will be an update
---> Package policycoreutils-python.x86_64 0:2.2.5-15.0.1.el7 will be updated
---> Package policycoreutils-python.x86_64 0:2.5-29.0.1.el7_6.1 will be an update
--> Processing Dependency: setools-libs >= 3.3.8-4 for package: policycoreutils-python-2.5-29.0.1.el7_6.1.x86_64
---> Package protobuf-c.x86_64 0:1.0.2-3.el7 will be installed
---> Package systemd-python.x86_64 0:208-20.0.1.el7 will be updated
---> Package systemd-python.x86_64 0:219-62.0.4.el7_6.7 will be an update
---> Package systemd-sysv.x86_64 0:208-20.0.1.el7 will be updated
---> Package systemd-sysv.x86_64 0:219-62.0.4.el7_6.7 will be an update
--> Running transaction check
---> Package cryptsetup.x86_64 0:1.6.6-3.el7 will be updated
---> Package cryptsetup.x86_64 0:2.0.3-3.el7 will be an update
---> Package cryptsetup-python.x86_64 0:1.6.6-3.el7 will be updated
---> Package cryptsetup-python.x86_64 0:2.0.3-3.el7 will be an update
---> Package device-mapper-event-libs.x86_64 7:1.02.93-3.el7 will be updated
---> Package device-mapper-event-libs.x86_64 7:1.02.149-10.0.3.el7_6.8 will be an update
---> Package glib2.x86_64 0:2.40.0-4.el7 will be updated
---> Package glib2.x86_64 0:2.56.1-4.el7_6 will be an update
---> Package libnl3-cli.x86_64 0:3.2.21-8.0.1.el7 will be updated
---> Package libnl3-cli.x86_64 0:3.2.28-4.el7 will be an update
---> Package libselinux.x86_64 0:2.2.2-6.el7 will be updated
--> Processing Dependency: libselinux = 2.2.2-6.el7 for package: libselinux-python-2.2.2-6.el7.x86_64
---> Package libselinux.x86_64 0:2.5-14.1.el7 will be an update
---> Package libsemanage-python.x86_64 0:2.1.10-16.el7 will be updated
---> Package libsemanage-python.x86_64 0:2.5-14.el7 will be an update
---> Package lvm2-libs.x86_64 7:2.02.115-3.el7 will be updated
--> Processing Dependency: lvm2-libs = 7:2.02.115-3.el7 for package: 7:lvm2-2.02.115-3.el7.x86_64
--> Processing Dependency: lvm2-libs = 7:2.02.115-3.el7 for package: 7:lvm2-python-libs-2.02.115-3.el7.x86_64
---> Package lvm2-libs.x86_64 7:2.02.180-10.0.3.el7_6.8 will be an update
---> Package setools-libs.x86_64 0:3.3.7-46.el7 will be updated
---> Package setools-libs.x86_64 0:3.3.8-4.el7 will be an update
--> Running transaction check
---> Package libselinux-python.x86_64 0:2.2.2-6.el7 will be updated
---> Package libselinux-python.x86_64 0:2.5-14.1.el7 will be an update
---> Package lvm2.x86_64 7:2.02.115-3.el7 will be updated
---> Package lvm2.x86_64 7:2.02.180-10.0.3.el7_6.8 will be an update
--> Processing Dependency: device-mapper-persistent-data >= 0.7.0-0.1.rc6 for package: 7:lvm2-2.02.180-10.0.3.el7_6.8.x86_64
---> Package lvm2-python-libs.x86_64 7:2.02.115-3.el7 will be updated
---> Package lvm2-python-libs.x86_64 7:2.02.180-10.0.3.el7_6.8 will be an update
--> Running transaction check
---> Package device-mapper-persistent-data.x86_64 0:0.4.1-2.el7 will be updated
---> Package device-mapper-persistent-data.x86_64 0:0.7.3-3.el7 will be an update
--> Processing Conflict: systemd-219-62.0.4.el7_6.7.x86_64 conflicts initscripts < 9.49.28-1
--> Restarting Dependency Resolution with new changes.
--> Running transaction check
---> Package initscripts.x86_64 0:9.49.24-1.0.1.el7 will be updated
---> Package initscripts.x86_64 0:9.49.46-1.0.1.el7 will be an update
--> Processing Conflict: initscripts-9.49.46-1.0.1.el7.x86_64 conflicts redhat-release < 7.5-0.11
--> Restarting Dependency Resolution with new changes.
--> Running transaction check
---> Package redhat-release-server.x86_64 1:7.1-1.0.2.el7 will be updated
---> Package redhat-release-server.x86_64 1:7.6-4.0.1.el7 will be an update
--> Processing Conflict: initscripts-9.49.46-1.0.1.el7.x86_64 conflicts oraclelinux-release < 7:7.5-1.0.3
--> Restarting Dependency Resolution with new changes.
--> Running transaction check
---> Package oraclelinux-release.x86_64 7:7.1-1.0.5.el7 will be updated
---> Package oraclelinux-release.x86_64 7:7.6-1.0.15.el7 will be an update
--> Processing Conflict: systemd-219-62.0.4.el7_6.7.x86_64 conflicts dracut < 033-243
--> Restarting Dependency Resolution with new changes.
--> Running transaction check
---> Package dracut.x86_64 0:033-240.0.1.el7 will be updated
--> Processing Dependency: dracut = 033-240.0.1.el7 for package: dracut-config-rescue-033-240.0.1.el7.x86_64
--> Processing Dependency: dracut = 033-240.0.1.el7 for package: dracut-network-033-240.0.1.el7.x86_64
---> Package dracut.x86_64 0:033-554.0.3.el7 will be an update
--> Running transaction check
---> Package dracut-config-rescue.x86_64 0:033-240.0.1.el7 will be updated
---> Package dracut-config-rescue.x86_64 0:033-554.0.3.el7 will be an update
---> Package dracut-network.x86_64 0:033-240.0.1.el7 will be updated
---> Package dracut-network.x86_64 0:033-554.0.3.el7 will be an update
--> Finished Dependency Resolution

Dependencies Resolved

============================================================================================================================================================================================================================================
 Package                                                            Arch                                        Version                                                               Repository                                       Size
============================================================================================================================================================================================================================================
Installing:
 docker-engine                                                      x86_64                                      18.09.1.ol-1.0.5.el7                                                  ol7_addons                                       19 M
Updating:
 dracut                                                             x86_64                                      033-554.0.3.el7                                                       ol7_latest                                      328 k
 initscripts                                                        x86_64                                      9.49.46-1.0.1.el7                                                     ol7_latest                                      439 k
 oraclelinux-release                                                x86_64                                      7:7.6-1.0.15.el7                                                      ol7_latest                                       54 k
 redhat-release-server                                              x86_64                                      1:7.6-4.0.1.el7                                                       ol7_latest                                      9.8 k
Installing for dependencies:
 container-selinux                                                  noarch                                      2:2.77-5.el7                                                          ol7_addons                                       37 k
 containerd                                                         x86_64                                      1.2.0-1.0.5.el7                                                       ol7_addons                                       21 M
 criu                                                               x86_64                                      3.9-5.el7                                                             ol7_latest                                      432 k
 docker-cli                                                         x86_64                                      18.09.1.ol-1.0.5.el7                                                  ol7_addons                                       14 M
 libnet                                                             x86_64                                      1.1.6-7.el7                                                           ol7_latest                                       57 k
 lz4                                                                x86_64                                      1.7.5-2.0.1.el7                                                       ol7_latest                                       98 k
 protobuf-c                                                         x86_64                                      1.0.2-3.el7                                                           ol7_latest                                       27 k
 runc                                                               x86_64                                      1.0.0-19.rc5.git4bb1fe4.0.3.el7                                       ol7_addons                                      1.9 M
Updating for dependencies:
 cryptsetup                                                         x86_64                                      2.0.3-3.el7                                                           ol7_latest                                      153 k
 cryptsetup-libs                                                    x86_64                                      2.0.3-3.el7                                                           ol7_latest                                      337 k
 cryptsetup-python                                                  x86_64                                      2.0.3-3.el7                                                           ol7_latest                                       35 k
 device-mapper                                                      x86_64                                      7:1.02.149-10.0.3.el7_6.8                                             ol7_latest                                      293 k
 device-mapper-event                                                x86_64                                      7:1.02.149-10.0.3.el7_6.8                                             ol7_latest                                      188 k
 device-mapper-event-libs                                           x86_64                                      7:1.02.149-10.0.3.el7_6.8                                             ol7_latest                                      188 k
 device-mapper-libs                                                 x86_64                                      7:1.02.149-10.0.3.el7_6.8                                             ol7_latest                                      320 k
 device-mapper-persistent-data                                      x86_64                                      0.7.3-3.el7                                                           ol7_latest                                      404 k
 dracut-config-rescue                                               x86_64                                      033-554.0.3.el7                                                       ol7_latest                                       60 k
 dracut-network                                                     x86_64                                      033-554.0.3.el7                                                       ol7_latest                                      102 k
 glib2                                                              x86_64                                      2.56.1-4.el7_6                                                        ol7_latest                                      2.5 M
 kmod                                                               x86_64                                      20-23.0.1.el7                                                         ol7_latest                                      121 k
 libgudev1                                                          x86_64                                      219-62.0.4.el7_6.7                                                    ol7_latest                                       96 k
 libnl3                                                             x86_64                                      3.2.28-4.el7                                                          ol7_latest                                      277 k
 libnl3-cli                                                         x86_64                                      3.2.28-4.el7                                                          ol7_latest                                      159 k
 libseccomp                                                         x86_64                                      2.3.1-3.el7                                                           ol7_latest                                       55 k
 libselinux                                                         x86_64                                      2.5-14.1.el7                                                          ol7_latest                                      162 k
 libselinux-python                                                  x86_64                                      2.5-14.1.el7                                                          ol7_latest                                      235 k
 libselinux-utils                                                   x86_64                                      2.5-14.1.el7                                                          ol7_latest                                      151 k
 libsemanage                                                        x86_64                                      2.5-14.el7                                                            ol7_latest                                      150 k
 libsemanage-python                                                 x86_64                                      2.5-14.el7                                                            ol7_latest                                      112 k
 libsepol                                                           x86_64                                      2.5-10.el7                                                            ol7_latest                                      297 k
 lvm2                                                               x86_64                                      7:2.02.180-10.0.3.el7_6.8                                             ol7_latest                                      1.3 M
 lvm2-libs                                                          x86_64                                      7:2.02.180-10.0.3.el7_6.8                                             ol7_latest                                      1.1 M
 lvm2-python-libs                                                   x86_64                                      7:2.02.180-10.0.3.el7_6.8                                             ol7_latest                                      186 k
 policycoreutils                                                    x86_64                                      2.5-29.0.1.el7_6.1                                                    ol7_latest                                      916 k
 policycoreutils-python                                             x86_64                                      2.5-29.0.1.el7_6.1                                                    ol7_latest                                      455 k
 selinux-policy                                                     noarch                                      3.13.1-229.0.3.el7_6.12                                               ol7_latest                                      484 k
 selinux-policy-targeted                                            noarch                                      3.13.1-229.0.3.el7_6.12                                               ol7_latest                                      6.9 M
 setools-libs                                                       x86_64                                      3.3.8-4.el7                                                           ol7_latest                                      620 k
 systemd                                                            x86_64                                      219-62.0.4.el7_6.7                                                    ol7_latest                                      5.1 M
 systemd-libs                                                       x86_64                                      219-62.0.4.el7_6.7                                                    ol7_latest                                      407 k
 systemd-python                                                     x86_64                                      219-62.0.4.el7_6.7                                                    ol7_latest                                      133 k
 systemd-sysv                                                       x86_64                                      219-62.0.4.el7_6.7                                                    ol7_latest                                       84 k

Transaction Summary
============================================================================================================================================================================================================================================
Install  1 Package  (+ 8 Dependent packages)
Upgrade  4 Packages (+34 Dependent packages)

Total download size: 81 M
Is this ok [y/d/N]: y
Downloading packages:
No Presto metadata available for ol7_latest
warning: /var/cache/yum/x86_64/7Server/ol7_latest/packages/cryptsetup-2.0.3-3.el7.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID ec551f03: NOKEY                                                      ] 373 kB/s | 1.6 MB  00:03:39 ETA
Public key for cryptsetup-2.0.3-3.el7.x86_64.rpm is not installed
(1/47): cryptsetup-2.0.3-3.el7.x86_64.rpm                                                                                                                                                                            | 153 kB  00:00:04
(2/47): criu-3.9-5.el7.x86_64.rpm                                                                                                                                                                                    | 432 kB  00:00:04
Public key for container-selinux-2.77-5.el7.noarch.rpm is not installed
(3/47): container-selinux-2.77-5.el7.noarch.rpm                                                                                                                                                                      |  37 kB  00:00:04
(4/47): cryptsetup-python-2.0.3-3.el7.x86_64.rpm                                                                                                                                                                     |  35 kB  00:00:00
(5/47): cryptsetup-libs-2.0.3-3.el7.x86_64.rpm                                                                                                                                                                       | 337 kB  00:00:01
(6/47): device-mapper-event-1.02.149-10.0.3.el7_6.8.x86_64.rpm                                                                                                                                                       | 188 kB  00:00:00
(7/47): device-mapper-1.02.149-10.0.3.el7_6.8.x86_64.rpm                                                                                                                                                             | 293 kB  00:00:01
(8/47): device-mapper-event-libs-1.02.149-10.0.3.el7_6.8.x86_64.rpm                                                                                                                                                  | 188 kB  00:00:00
(9/47): device-mapper-persistent-data-0.7.3-3.el7.x86_64.rpm                                                                                                                                                         | 404 kB  00:00:00
(10/47): device-mapper-libs-1.02.149-10.0.3.el7_6.8.x86_64.rpm                                                                                                                                                       | 320 kB  00:00:02
(11/47): containerd-1.2.0-1.0.5.el7.x86_64.rpm                                                                                                                                                                       |  21 MB  00:00:13
(12/47): dracut-config-rescue-033-554.0.3.el7.x86_64.rpm                                                                                                                                                             |  60 kB  00:00:01
(13/47): dracut-network-033-554.0.3.el7.x86_64.rpm                                                                                                                                                                   | 102 kB  00:00:00
(14/47): dracut-033-554.0.3.el7.x86_64.rpm                                                                                                                                                                           | 328 kB  00:00:02
(15/47): initscripts-9.49.46-1.0.1.el7.x86_64.rpm                                                                                                                                                                    | 439 kB  00:00:00
(16/47): kmod-20-23.0.1.el7.x86_64.rpm                                                                                                                                                                               | 121 kB  00:00:00
(17/47): libgudev1-219-62.0.4.el7_6.7.x86_64.rpm                                                                                                                                                                     |  96 kB  00:00:00
(18/47): glib2-2.56.1-4.el7_6.x86_64.rpm                                                                                                                                                                             | 2.5 MB  00:00:02
(19/47): libnl3-3.2.28-4.el7.x86_64.rpm                                                                                                                                                                              | 277 kB  00:00:00
(20/47): docker-cli-18.09.1.ol-1.0.5.el7.x86_64.rpm                                                                                                                                                                  |  14 MB  00:00:12
(21/47): libnet-1.1.6-7.el7.x86_64.rpm                                                                                                                                                                               |  57 kB  00:00:01
(22/47): libseccomp-2.3.1-3.el7.x86_64.rpm                                                                                                                                                                           |  55 kB  00:00:00
(23/47): libselinux-2.5-14.1.el7.x86_64.rpm                                                                                                                                                                          | 162 kB  00:00:00
(24/47): libnl3-cli-3.2.28-4.el7.x86_64.rpm                                                                                                                                                                          | 159 kB  00:00:00
(25/47): libselinux-python-2.5-14.1.el7.x86_64.rpm                                                                                                                                                                   | 235 kB  00:00:00
(26/47): libselinux-utils-2.5-14.1.el7.x86_64.rpm                                                                                                                                                                    | 151 kB  00:00:00
(27/47): libsemanage-python-2.5-14.el7.x86_64.rpm                                                                                                                                                                    | 112 kB  00:00:00
(28/47): libsemanage-2.5-14.el7.x86_64.rpm                                                                                                                                                                           | 150 kB  00:00:00
(29/47): libsepol-2.5-10.el7.x86_64.rpm                                                                                                                                                                              | 297 kB  00:00:00
(30/47): lvm2-2.02.180-10.0.3.el7_6.8.x86_64.rpm                                                                                                                                                                     | 1.3 MB  00:00:00
(31/47): lvm2-python-libs-2.02.180-10.0.3.el7_6.8.x86_64.rpm                                                                                                                                                         | 186 kB  00:00:00
(32/47): lvm2-libs-2.02.180-10.0.3.el7_6.8.x86_64.rpm                                                                                                                                                                | 1.1 MB  00:00:01
(33/47): lz4-1.7.5-2.0.1.el7.x86_64.rpm                                                                                                                                                                              |  98 kB  00:00:00
(34/47): oraclelinux-release-7.6-1.0.15.el7.x86_64.rpm                                                                                                                                                               |  54 kB  00:00:00
(35/47): policycoreutils-2.5-29.0.1.el7_6.1.x86_64.rpm                                                                                                                                                               | 916 kB  00:00:00
(36/47): policycoreutils-python-2.5-29.0.1.el7_6.1.x86_64.rpm                                                                                                                                                        | 455 kB  00:00:00
(37/47): redhat-release-server-7.6-4.0.1.el7.x86_64.rpm                                                                                                                                                              | 9.8 kB  00:00:00
(38/47): docker-engine-18.09.1.ol-1.0.5.el7.x86_64.rpm                                                                                                                                                               |  19 MB  00:00:10
(39/47): selinux-policy-3.13.1-229.0.3.el7_6.12.noarch.rpm                                                                                                                                                           | 484 kB  00:00:00
(40/47): protobuf-c-1.0.2-3.el7.x86_64.rpm                                                                                                                                                                           |  27 kB  00:00:02
(41/47): setools-libs-3.3.8-4.el7.x86_64.rpm                                                                                                                                                                         | 620 kB  00:00:00
(42/47): runc-1.0.0-19.rc5.git4bb1fe4.0.3.el7.x86_64.rpm                                                                                                                                                             | 1.9 MB  00:00:04
(43/47): selinux-policy-targeted-3.13.1-229.0.3.el7_6.12.noarch.rpm                                                                                                                                                  | 6.9 MB  00:00:03
(44/47): systemd-libs-219-62.0.4.el7_6.7.x86_64.rpm                                                                                                                                                                  | 407 kB  00:00:00
(45/47): systemd-python-219-62.0.4.el7_6.7.x86_64.rpm                                                                                                                                                                | 133 kB  00:00:00
(46/47): systemd-sysv-219-62.0.4.el7_6.7.x86_64.rpm                                                                                                                                                                  |  84 kB  00:00:00
(47/47): systemd-219-62.0.4.el7_6.7.x86_64.rpm                                                                                                                                                                       | 5.1 MB  00:00:04
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                                                                                                                       2.8 MB/s |  81 MB  00:00:29
Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
Importing GPG key 0xEC551F03:
 Userid     : "Oracle OSS group (Open Source Software group) "
 Fingerprint: 4214 4123 fecf c55b 9086 313d 72f9 7b74 ec55 1f03
 Package    : 7:oraclelinux-release-7.1-1.0.5.el7.x86_64 (@anaconda/7.1)
 From       : /etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
Is this ok [y/N]: y
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Updating   : libsepol-2.5-10.el7.x86_64                                                                                                                                                                                              1/85
  Updating   : libselinux-2.5-14.1.el7.x86_64                                                                                                                                                                                          2/85
  Updating   : libsemanage-2.5-14.el7.x86_64                                                                                                                                                                                           3/85
  Installing : lz4-1.7.5-2.0.1.el7.x86_64                                                                                                                                                                                              4/85
  Updating   : systemd-libs-219-62.0.4.el7_6.7.x86_64                                                                                                                                                                                  5/85
  Updating   : 1:redhat-release-server-7.6-4.0.1.el7.x86_64                                                                                                                                                                            6/85
  Updating   : cryptsetup-libs-2.0.3-3.el7.x86_64                                                                                                                                                                                      7/85
  Updating   : 7:device-mapper-libs-1.02.149-10.0.3.el7_6.8.x86_64                                                                                                                                                                     8/85
  Updating   : 7:device-mapper-1.02.149-10.0.3.el7_6.8.x86_64                                                                                                                                                                          9/85
  Updating   : systemd-219-62.0.4.el7_6.7.x86_64                                                                                                                                                                                      10/85
  Updating   : dracut-033-554.0.3.el7.x86_64                                                                                                                                                                                          11/85
  Updating   : kmod-20-23.0.1.el7.x86_64                                                                                                                                                                                              12/85
  Updating   : 7:device-mapper-event-libs-1.02.149-10.0.3.el7_6.8.x86_64                                                                                                                                                              13/85
  Updating   : libseccomp-2.3.1-3.el7.x86_64                                                                                                                                                                                          14/85
  Updating   : glib2-2.56.1-4.el7_6.x86_64                                                                                                                                                                                            15/85
  Updating   : libselinux-utils-2.5-14.1.el7.x86_64                                                                                                                                                                                   16/85
  Updating   : policycoreutils-2.5-29.0.1.el7_6.1.x86_64                                                                                                                                                                              17/85
  Updating   : selinux-policy-3.13.1-229.0.3.el7_6.12.noarch                                                                                                                                                                          18/85
  Updating   : libnl3-3.2.28-4.el7.x86_64                                                                                                                                                                                             19/85
  Updating   : selinux-policy-targeted-3.13.1-229.0.3.el7_6.12.noarch                                                                                                                                                                 20/85
  Updating   : 7:device-mapper-event-1.02.149-10.0.3.el7_6.8.x86_64                                                                                                                                                                   21/85
  Updating   : 7:lvm2-libs-2.02.180-10.0.3.el7_6.8.x86_64                                                                                                                                                                             22/85
  Updating   : 7:oraclelinux-release-7.6-1.0.15.el7.x86_64                                                                                                                                                                            23/85
  Updating   : libsemanage-python-2.5-14.el7.x86_64                                                                                                                                                                                   24/85
  Updating   : libselinux-python-2.5-14.1.el7.x86_64                                                                                                                                                                                  25/85
  Updating   : setools-libs-3.3.8-4.el7.x86_64                                                                                                                                                                                        26/85
  Updating   : policycoreutils-python-2.5-29.0.1.el7_6.1.x86_64                                                                                                                                                                       27/85
  Installing : 2:container-selinux-2.77-5.el7.noarch                                                                                                                                                                                  28/85
  Installing : containerd-1.2.0-1.0.5.el7.x86_64                                                                                                                                                                                      29/85
  Installing : docker-cli-18.09.1.ol-1.0.5.el7.x86_64                                                                                                                                                                                 30/85
  Installing : libnet-1.1.6-7.el7.x86_64                                                                                                                                                                                              31/85
  Installing : protobuf-c-1.0.2-3.el7.x86_64                                                                                                                                                                                          32/85
  Installing : criu-3.9-5.el7.x86_64                                                                                                                                                                                                  33/85
  Installing : runc-1.0.0-19.rc5.git4bb1fe4.0.3.el7.x86_64                                                                                                                                                                            34/85
  Updating   : device-mapper-persistent-data-0.7.3-3.el7.x86_64                                                                                                                                                                       35/85
  Updating   : 7:lvm2-2.02.180-10.0.3.el7_6.8.x86_64                                                                                                                                                                                  36/85
Created symlink from /etc/systemd/system/sysinit.target.wants/lvm2-lvmpolld.socket to /usr/lib/systemd/system/lvm2-lvmpolld.socket.
  Installing : docker-engine-18.09.1.ol-1.0.5.el7.x86_64                                                                                                                                                                              37/85
  Updating   : initscripts-9.49.46-1.0.1.el7.x86_64                                                                                                                                                                                   38/85
  Updating   : 7:lvm2-python-libs-2.02.180-10.0.3.el7_6.8.x86_64                                                                                                                                                                      39/85
  Updating   : libnl3-cli-3.2.28-4.el7.x86_64                                                                                                                                                                                         40/85
  Updating   : libgudev1-219-62.0.4.el7_6.7.x86_64                                                                                                                                                                                    41/85
  Updating   : dracut-network-033-554.0.3.el7.x86_64                                                                                                                                                                                  42/85
  Updating   : dracut-config-rescue-033-554.0.3.el7.x86_64                                                                                                                                                                            43/85
  Updating   : systemd-sysv-219-62.0.4.el7_6.7.x86_64                                                                                                                                                                                 44/85
  Updating   : systemd-python-219-62.0.4.el7_6.7.x86_64                                                                                                                                                                               45/85
  Updating   : cryptsetup-python-2.0.3-3.el7.x86_64                                                                                                                                                                                   46/85
  Updating   : cryptsetup-2.0.3-3.el7.x86_64                                                                                                                                                                                          47/85
  Cleanup    : 7:lvm2-2.02.115-3.el7.x86_64                                                                                                                                                                                           48/85
  Cleanup    : policycoreutils-python-2.2.5-15.0.1.el7.x86_64                                                                                                                                                                         49/85

UPGRADE: Automatically re-enabling default systemd units:
        brandbot.path
        rhel-autorelabel.service
        rhel-autorelabel-mark.service
        rhel-configure.service
        rhel-dmesg.service
        rhel-domainname.service
        rhel-import-state.service
        rhel-loadmodules.service
        rhel-readonly.service

  Cleanup    : initscripts-9.49.24-1.0.1.el7.x86_64                                                                                                                                                                                   50/85
  Cleanup    : libgudev1-208-20.0.1.el7.x86_64                                                                                                                                                                                        51/85
  Cleanup    : selinux-policy-targeted-3.13.1-23.0.1.el7.noarch                                                                                                                                                                       52/85
  Cleanup    : selinux-policy-3.13.1-23.0.1.el7.noarch                                                                                                                                                                                53/85
  Cleanup    : 7:oraclelinux-release-7.1-1.0.5.el7.x86_64                                                                                                                                                                             54/85
  Cleanup    : dracut-config-rescue-033-240.0.1.el7.x86_64                                                                                                                                                                            55/85
  Cleanup    : systemd-sysv-208-20.0.1.el7.x86_64                                                                                                                                                                                     56/85
  Cleanup    : dracut-network-033-240.0.1.el7.x86_64                                                                                                                                                                                  57/85
  Cleanup    : policycoreutils-2.2.5-15.0.1.el7.x86_64                                                                                                                                                                                58/85
  Cleanup    : systemd-python-208-20.0.1.el7.x86_64                                                                                                                                                                                   59/85
  Cleanup    : dracut-033-240.0.1.el7.x86_64                                                                                                                                                                                          60/85
  Cleanup    : setools-libs-3.3.7-46.el7.x86_64                                                                                                                                                                                       61/85
  Cleanup    : libselinux-utils-2.2.2-6.el7.x86_64                                                                                                                                                                                    62/85
  Cleanup    : glib2-2.40.0-4.el7.x86_64                                                                                                                                                                                              63/85
  Cleanup    : libselinux-python-2.2.2-6.el7.x86_64                                                                                                                                                                                   64/85
  Cleanup    : libsemanage-python-2.1.10-16.el7.x86_64                                                                                                                                                                                65/85
  Cleanup    : libsemanage-2.1.10-16.el7.x86_64                                                                                                                                                                                       66/85
  Cleanup    : cryptsetup-1.6.6-3.el7.x86_64                                                                                                                                                                                          67/85
  Cleanup    : libnl3-cli-3.2.21-8.0.1.el7.x86_64                                                                                                                                                                                     68/85
  Cleanup    : cryptsetup-python-1.6.6-3.el7.x86_64                                                                                                                                                                                   69/85
  Cleanup    : 7:lvm2-python-libs-2.02.115-3.el7.x86_64                                                                                                                                                                               70/85
  Cleanup    : 7:lvm2-libs-2.02.115-3.el7.x86_64                                                                                                                                                                                      71/85
  Cleanup    : 7:device-mapper-event-1.02.93-3.el7.x86_64                                                                                                                                                                             72/85
  Cleanup    : 7:device-mapper-event-libs-1.02.93-3.el7.x86_64                                                                                                                                                                        73/85
  Cleanup    : cryptsetup-libs-1.6.6-3.el7.x86_64                                                                                                                                                                                     74/85
  Cleanup    : systemd-208-20.0.1.el7.x86_64                                                                                                                                                                                          75/85
  Cleanup    : 7:device-mapper-1.02.93-3.el7.x86_64                                                                                                                                                                                   76/85
  Cleanup    : 7:device-mapper-libs-1.02.93-3.el7.x86_64                                                                                                                                                                              77/85
  Cleanup    : 1:redhat-release-server-7.1-1.0.2.el7.x86_64                                                                                                                                                                           78/85
  Cleanup    : systemd-libs-208-20.0.1.el7.x86_64                                                                                                                                                                                     79/85
  Cleanup    : libselinux-2.2.2-6.el7.x86_64                                                                                                                                                                                          80/85
  Cleanup    : libsepol-2.1.9-3.el7.x86_64                                                                                                                                                                                            81/85
  Cleanup    : kmod-14-10.el7.x86_64                                                                                                                                                                                                  82/85
  Cleanup    : libnl3-3.2.21-8.0.1.el7.x86_64                                                                                                                                                                                         83/85
  Cleanup    : device-mapper-persistent-data-0.4.1-2.el7.x86_64                                                                                                                                                                       84/85
  Cleanup    : libseccomp-2.1.1-2.el7.x86_64                                                                                                                                                                                          85/85
  Verifying  : 7:device-mapper-event-libs-1.02.149-10.0.3.el7_6.8.x86_64                                                                                                                                                               1/85
  Verifying  : glib2-2.56.1-4.el7_6.x86_64                                                                                                                                                                                             2/85
  Verifying  : docker-engine-18.09.1.ol-1.0.5.el7.x86_64                                                                                                                                                                               3/85
  Verifying  : policycoreutils-2.5-29.0.1.el7_6.1.x86_64                                                                                                                                                                               4/85
  Verifying  : libseccomp-2.3.1-3.el7.x86_64                                                                                                                                                                                           5/85
  Verifying  : kmod-20-23.0.1.el7.x86_64                                                                                                                                                                                               6/85
  Verifying  : 7:device-mapper-libs-1.02.149-10.0.3.el7_6.8.x86_64                                                                                                                                                                     7/85
  Verifying  : 7:lvm2-python-libs-2.02.180-10.0.3.el7_6.8.x86_64                                                                                                                                                                       8/85
  Verifying  : libgudev1-219-62.0.4.el7_6.7.x86_64                                                                                                                                                                                     9/85
  Verifying  : cryptsetup-libs-2.0.3-3.el7.x86_64                                                                                                                                                                                     10/85
  Verifying  : selinux-policy-3.13.1-229.0.3.el7_6.12.noarch                                                                                                                                                                          11/85
  Verifying  : 7:lvm2-2.02.180-10.0.3.el7_6.8.x86_64                                                                                                                                                                                  12/85
  Verifying  : 2:container-selinux-2.77-5.el7.noarch                                                                                                                                                                                  13/85
  Verifying  : initscripts-9.49.46-1.0.1.el7.x86_64                                                                                                                                                                                   14/85
  Verifying  : cryptsetup-python-2.0.3-3.el7.x86_64                                                                                                                                                                                   15/85
  Verifying  : libsemanage-python-2.5-14.el7.x86_64                                                                                                                                                                                   16/85
  Verifying  : 1:redhat-release-server-7.6-4.0.1.el7.x86_64                                                                                                                                                                           17/85
  Verifying  : 7:oraclelinux-release-7.6-1.0.15.el7.x86_64                                                                                                                                                                            18/85
  Verifying  : device-mapper-persistent-data-0.7.3-3.el7.x86_64                                                                                                                                                                       19/85
  Verifying  : dracut-network-033-554.0.3.el7.x86_64                                                                                                                                                                                  20/85
  Verifying  : systemd-sysv-219-62.0.4.el7_6.7.x86_64                                                                                                                                                                                 21/85
  Verifying  : containerd-1.2.0-1.0.5.el7.x86_64                                                                                                                                                                                      22/85
  Verifying  : policycoreutils-python-2.5-29.0.1.el7_6.1.x86_64                                                                                                                                                                       23/85
  Verifying  : protobuf-c-1.0.2-3.el7.x86_64                                                                                                                                                                                          24/85
  Verifying  : dracut-config-rescue-033-554.0.3.el7.x86_64                                                                                                                                                                            25/85
  Verifying  : libselinux-2.5-14.1.el7.x86_64                                                                                                                                                                                         26/85
  Verifying  : systemd-219-62.0.4.el7_6.7.x86_64                                                                                                                                                                                      27/85
  Verifying  : criu-3.9-5.el7.x86_64                                                                                                                                                                                                  28/85
  Verifying  : libsemanage-2.5-14.el7.x86_64                                                                                                                                                                                          29/85
  Verifying  : systemd-libs-219-62.0.4.el7_6.7.x86_64                                                                                                                                                                                 30/85
  Verifying  : libnl3-cli-3.2.28-4.el7.x86_64                                                                                                                                                                                         31/85
  Verifying  : systemd-python-219-62.0.4.el7_6.7.x86_64                                                                                                                                                                               32/85
  Verifying  : libselinux-python-2.5-14.1.el7.x86_64                                                                                                                                                                                  33/85
  Verifying  : libnet-1.1.6-7.el7.x86_64                                                                                                                                                                                              34/85
  Verifying  : libsepol-2.5-10.el7.x86_64                                                                                                                                                                                             35/85
  Verifying  : runc-1.0.0-19.rc5.git4bb1fe4.0.3.el7.x86_64                                                                                                                                                                            36/85
  Verifying  : selinux-policy-targeted-3.13.1-229.0.3.el7_6.12.noarch                                                                                                                                                                 37/85
  Verifying  : libselinux-utils-2.5-14.1.el7.x86_64                                                                                                                                                                                   38/85
  Verifying  : dracut-033-554.0.3.el7.x86_64                                                                                                                                                                                          39/85
  Verifying  : 7:device-mapper-event-1.02.149-10.0.3.el7_6.8.x86_64                                                                                                                                                                   40/85
  Verifying  : 7:device-mapper-1.02.149-10.0.3.el7_6.8.x86_64                                                                                                                                                                         41/85
  Verifying  : libnl3-3.2.28-4.el7.x86_64                                                                                                                                                                                             42/85
  Verifying  : docker-cli-18.09.1.ol-1.0.5.el7.x86_64                                                                                                                                                                                 43/85
  Verifying  : 7:lvm2-libs-2.02.180-10.0.3.el7_6.8.x86_64                                                                                                                                                                             44/85
  Verifying  : setools-libs-3.3.8-4.el7.x86_64                                                                                                                                                                                        45/85
  Verifying  : lz4-1.7.5-2.0.1.el7.x86_64                                                                                                                                                                                             46/85
  Verifying  : cryptsetup-2.0.3-3.el7.x86_64                                                                                                                                                                                          47/85
  Verifying  : libselinux-utils-2.2.2-6.el7.x86_64                                                                                                                                                                                    48/85
  Verifying  : libsemanage-python-2.1.10-16.el7.x86_64                                                                                                                                                                                49/85
  Verifying  : dracut-config-rescue-033-240.0.1.el7.x86_64                                                                                                                                                                            50/85
  Verifying  : systemd-libs-208-20.0.1.el7.x86_64                                                                                                                                                                                     51/85
  Verifying  : systemd-sysv-208-20.0.1.el7.x86_64                                                                                                                                                                                     52/85
  Verifying  : policycoreutils-2.2.5-15.0.1.el7.x86_64                                                                                                                                                                                53/85
  Verifying  : policycoreutils-python-2.2.5-15.0.1.el7.x86_64                                                                                                                                                                         54/85
  Verifying  : cryptsetup-python-1.6.6-3.el7.x86_64                                                                                                                                                                                   55/85
  Verifying  : 7:oraclelinux-release-7.1-1.0.5.el7.x86_64                                                                                                                                                                             56/85
  Verifying  : 7:device-mapper-event-libs-1.02.93-3.el7.x86_64                                                                                                                                                                        57/85
  Verifying  : dracut-033-240.0.1.el7.x86_64                                                                                                                                                                                          58/85
  Verifying  : cryptsetup-1.6.6-3.el7.x86_64                                                                                                                                                                                          59/85
  Verifying  : setools-libs-3.3.7-46.el7.x86_64                                                                                                                                                                                       60/85
  Verifying  : initscripts-9.49.24-1.0.1.el7.x86_64                                                                                                                                                                                   61/85
  Verifying  : kmod-14-10.el7.x86_64                                                                                                                                                                                                  62/85
  Verifying  : systemd-python-208-20.0.1.el7.x86_64                                                                                                                                                                                   63/85
  Verifying  : cryptsetup-libs-1.6.6-3.el7.x86_64                                                                                                                                                                                     64/85
  Verifying  : dracut-network-033-240.0.1.el7.x86_64                                                                                                                                                                                  65/85
  Verifying  : glib2-2.40.0-4.el7.x86_64                                                                                                                                                                                              66/85
  Verifying  : libnl3-cli-3.2.21-8.0.1.el7.x86_64                                                                                                                                                                                     67/85
  Verifying  : libnl3-3.2.21-8.0.1.el7.x86_64                                                                                                                                                                                         68/85
  Verifying  : 7:device-mapper-event-1.02.93-3.el7.x86_64                                                                                                                                                                             69/85
  Verifying  : libselinux-python-2.2.2-6.el7.x86_64                                                                                                                                                                                   70/85
  Verifying  : libsemanage-2.1.10-16.el7.x86_64                                                                                                                                                                                       71/85
  Verifying  : libseccomp-2.1.1-2.el7.x86_64                                                                                                                                                                                          72/85
  Verifying  : libsepol-2.1.9-3.el7.x86_64                                                                                                                                                                                            73/85
  Verifying  : 7:lvm2-python-libs-2.02.115-3.el7.x86_64                                                                                                                                                                               74/85
  Verifying  : 7:device-mapper-1.02.93-3.el7.x86_64                                                                                                                                                                                   75/85
  Verifying  : selinux-policy-3.13.1-23.0.1.el7.noarch                                                                                                                                                                                76/85
  Verifying  : libselinux-2.2.2-6.el7.x86_64                                                                                                                                                                                          77/85
  Verifying  : 1:redhat-release-server-7.1-1.0.2.el7.x86_64                                                                                                                                                                           78/85
  Verifying  : libgudev1-208-20.0.1.el7.x86_64                                                                                                                                                                                        79/85
  Verifying  : 7:lvm2-2.02.115-3.el7.x86_64                                                                                                                                                                                           80/85
  Verifying  : 7:lvm2-libs-2.02.115-3.el7.x86_64                                                                                                                                                                                      81/85
  Verifying  : 7:device-mapper-libs-1.02.93-3.el7.x86_64                                                                                                                                                                              82/85
  Verifying  : device-mapper-persistent-data-0.4.1-2.el7.x86_64                                                                                                                                                                       83/85
  Verifying  : selinux-policy-targeted-3.13.1-23.0.1.el7.noarch                                                                                                                                                                       84/85
  Verifying  : systemd-208-20.0.1.el7.x86_64                                                                                                                                                                                          85/85

Installed:
  docker-engine.x86_64 0:18.09.1.ol-1.0.5.el7

Dependency Installed:
  container-selinux.noarch 2:2.77-5.el7     containerd.x86_64 0:1.2.0-1.0.5.el7               criu.x86_64 0:3.9-5.el7     docker-cli.x86_64 0:18.09.1.ol-1.0.5.el7     libnet.x86_64 0:1.1.6-7.el7     lz4.x86_64 0:1.7.5-2.0.1.el7
  protobuf-c.x86_64 0:1.0.2-3.el7           runc.x86_64 0:1.0.0-19.rc5.git4bb1fe4.0.3.el7

Updated:
  dracut.x86_64 0:033-554.0.3.el7                   initscripts.x86_64 0:9.49.46-1.0.1.el7                   oraclelinux-release.x86_64 7:7.6-1.0.15.el7                   redhat-release-server.x86_64 1:7.6-4.0.1.el7

Dependency Updated:
  cryptsetup.x86_64 0:2.0.3-3.el7                              cryptsetup-libs.x86_64 0:2.0.3-3.el7                          cryptsetup-python.x86_64 0:2.0.3-3.el7                  device-mapper.x86_64 7:1.02.149-10.0.3.el7_6.8
  device-mapper-event.x86_64 7:1.02.149-10.0.3.el7_6.8         device-mapper-event-libs.x86_64 7:1.02.149-10.0.3.el7_6.8     device-mapper-libs.x86_64 7:1.02.149-10.0.3.el7_6.8     device-mapper-persistent-data.x86_64 0:0.7.3-3.el7
  dracut-config-rescue.x86_64 0:033-554.0.3.el7                dracut-network.x86_64 0:033-554.0.3.el7                       glib2.x86_64 0:2.56.1-4.el7_6                           kmod.x86_64 0:20-23.0.1.el7
  libgudev1.x86_64 0:219-62.0.4.el7_6.7                        libnl3.x86_64 0:3.2.28-4.el7                                  libnl3-cli.x86_64 0:3.2.28-4.el7                        libseccomp.x86_64 0:2.3.1-3.el7
  libselinux.x86_64 0:2.5-14.1.el7                             libselinux-python.x86_64 0:2.5-14.1.el7                       libselinux-utils.x86_64 0:2.5-14.1.el7                  libsemanage.x86_64 0:2.5-14.el7
  libsemanage-python.x86_64 0:2.5-14.el7                       libsepol.x86_64 0:2.5-10.el7                                  lvm2.x86_64 7:2.02.180-10.0.3.el7_6.8                   lvm2-libs.x86_64 7:2.02.180-10.0.3.el7_6.8
  lvm2-python-libs.x86_64 7:2.02.180-10.0.3.el7_6.8            policycoreutils.x86_64 0:2.5-29.0.1.el7_6.1                   policycoreutils-python.x86_64 0:2.5-29.0.1.el7_6.1      selinux-policy.noarch 0:3.13.1-229.0.3.el7_6.12
  selinux-policy-targeted.noarch 0:3.13.1-229.0.3.el7_6.12     setools-libs.x86_64 0:3.3.8-4.el7                             systemd.x86_64 0:219-62.0.4.el7_6.7                     systemd-libs.x86_64 0:219-62.0.4.el7_6.7
  systemd-python.x86_64 0:219-62.0.4.el7_6.7                   systemd-sysv.x86_64 0:219-62.0.4.el7_6.7

Complete!

3.一旦安装完成,就可以启动docker服务

[root@localhost soft]# service docker start
Redirecting to /bin/systemctl start docker.service

[root@localhost soft]# systemctl enable docker

[root@localhost soft]# service docker status
Redirecting to /bin/systemctl status docker.service
鈼[0m docker.service - Docker Application Container Engine
   Loaded: loaded (/usr/lib/systemd/system/docker.service; enabled; vendor preset: disabled)
  Drop-In: /etc/systemd/system/docker.service.d
           鈹斺攢docker-sysconfig.conf
   Active: active (running) since Mon 2019-06-10 23:15:05 CST; 6h left
     Docs: https://docs.docker.com
 Main PID: 1452 (dockerd)
   Memory: 132.2M
   CGroup: /system.slice/docker.service
           鈹溾攢1452 /usr/bin/dockerd --selinux-enabled --storage-driver devicemapper --storage-opt dm.basesize=25G
           鈹斺攢2436 containerd --config /var/run/docker/containerd/containerd.toml --log-level info

Jun 10 23:15:03 localhost.localdomain dockerd[1452]: time="2019-06-10T23:15:03.843382248+08:00" level=info msg="Successfully created filesystem xfs on device docker-253:0-1047242-base" storage-driver=devicemapper
Jun 10 23:15:04 localhost.localdomain dockerd[1452]: time="2019-06-10T23:15:04.076789613+08:00" level=info msg="Graph migration to content-addressability took 0.00 seconds"
Jun 10 23:15:04 localhost.localdomain dockerd[1452]: time="2019-06-10T23:15:04.078665673+08:00" level=warning msg="mountpoint for pids not found"
Jun 10 23:15:04 localhost.localdomain dockerd[1452]: time="2019-06-10T23:15:04.079906275+08:00" level=info msg="Loading containers: start."
Jun 10 23:15:04 localhost.localdomain dockerd[1452]: time="2019-06-10T23:15:04.554467519+08:00" level=info msg="Default bridge (docker0) is assigned with an IP address 172.17.0.0/16. Daemon option --bip can be used to...rred IP address"
Jun 10 23:15:04 localhost.localdomain dockerd[1452]: time="2019-06-10T23:15:04.859786800+08:00" level=info msg="Loading containers: done."
Jun 10 23:15:04 localhost.localdomain dockerd[1452]: time="2019-06-10T23:15:04.959099871+08:00" level=info msg="Docker daemon" commit=c3ab8a8 graphdriver(s)=devicemapper version=18.09.1-ol
Jun 10 23:15:04 localhost.localdomain dockerd[1452]: time="2019-06-10T23:15:04.959938124+08:00" level=info msg="Daemon has completed initialization"
Jun 10 23:15:05 localhost.localdomain dockerd[1452]: time="2019-06-10T23:15:05.053166130+08:00" level=info msg="API listen on /var/run/docker.sock"
Jun 10 23:15:05 localhost.localdomain systemd[1]: Started Docker Application Container Engine.
Hint: Some lines were ellipsized, use -l to show in full.

4.然后可以下载镜像文件

[root@localhost soft]# docker pull mysql/mysql-server:5.7
Trying to pull repository docker.io/mysql/mysql-server ...
5.7: Pulling from docker.io/mysql/mysql-server
35defbf6c365: Pull complete
0fa46ab0f51d: Pull complete
f70f5000008c: Pull complete
892ac46af8c0: Pull complete
Digest: sha256:ddb046076781a15200d36cb01f8f512431c3481bedebd5e92646d8c617ae212c
Status: Downloaded newer image for mysql/mysql-server:5.7
[root@localhost soft]# docker images
REPOSITORY           TAG                 IMAGE ID            CREATED             SIZE
mysql/mysql-server   5.7                 857eadf53a54        6 weeks ago         258MB

到此安装就完成了,还是很简单。

Oracle Linux 7设置中文字符集

常安装Linux系统本着最简化安装,会默认使用英文字符集,不会安装中文字符集等其他字符。但是在一些必要情况下需要中文的支持,本文将演示如何在Oracle Linux7在安装中文字符集
1、首先使用locale命令看看当前系统所使用的字符集,可以看到是英文

[root@cs2 ~]# locale
LANG=en_US.UTF-8
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=

2、再看看系统是否有安装中文字符集的支持

[root@cs2 ~]# locale -a |grep CN
bo_CN
bo_CN.utf8
ug_CN
ug_CN.utf8
zh_CN
zh_CN.gb18030
zh_CN.gb2312
zh_CN.gbk
zh_CN.utf8

3、如果没有的话使用yum安装中文字符集

yum  install ibus-table-chinese-1.4.6-3.el7.noarch

4、按如下方法修改配置文件并重启系统测试

cat /etc/locale.conf

#LANG="en_US.UTF-8"

LANG="zh_CN.gb2312"

5、重新查看字符集,修改成功,也可以用echo命令输出中文,能正常显示了

[root@cs2 ~]# locale
LANG=zh_CN.gb2312
LC_CTYPE="zh_CN.gb2312"
LC_NUMERIC="zh_CN.gb2312"
LC_TIME="zh_CN.gb2312"
LC_COLLATE="zh_CN.gb2312"
LC_MONETARY="zh_CN.gb2312"
LC_MESSAGES="zh_CN.gb2312"
LC_PAPER="zh_CN.gb2312"
LC_NAME="zh_CN.gb2312"
LC_ADDRESS="zh_CN.gb2312"
LC_TELEPHONE="zh_CN.gb2312"
LC_MEASUREMENT="zh_CN.gb2312"
LC_IDENTIFICATION="zh_CN.gb2312"
LC_ALL=

Oracle Linux 7 Configure DNS

Oracle Linux 7.1配置DNS服务
一.安装DNS需要的软件包

# yum install bind-libs bind bind-utils

二.编辑named.conf文件
在编辑前先复制一份named.conf文件

[root@jytest1 ~]# cp /etc/named.conf /etc/named.conf.backup


[root@jytest1 ~]# vi /etc/named.conf
//
// named.conf
//
// Provided by Red Hat bind package to configure the ISC BIND named(8) DNS
// server as a caching only nameserver (as a localhost DNS resolver only).
//
// See /usr/share/doc/bind*/sample/ for example named configuration files.
//

options {
        listen-on port 53 { any; };--将127.0.0.1修改成any
        listen-on-v6 port 53 { ::1; };
        directory       "/var/named";
        dump-file       "/var/named/data/cache_dump.db";
        statistics-file "/var/named/data/named_stats.txt";
        memstatistics-file "/var/named/data/named_mem_stats.txt";
        allow-query     { any; };--将127.0.0.1修改成any

        /* 
         - If you are building an AUTHORITATIVE DNS server, do NOT enable recursion.
         - If you are building a RECURSIVE (caching) DNS server, you need to enable 
           recursion. 
         - If your recursive DNS server has a public IP address, you MUST enable access 
           control to limit queries to your legitimate users. Failing to do so will
           cause your server to become part of large scale DNS amplification 
           attacks. Implementing BCP38 within your network would greatly
           reduce such attack surface 
        */
        recursion yes;

        dnssec-enable yes;
        dnssec-validation yes;
        dnssec-lookaside auto;

        /* Path to ISC DLV key */
        bindkeys-file "/etc/named.iscdlv.key";

        managed-keys-directory "/var/named/dynamic";

        pid-file "/run/named/named.pid";
        session-keyfile "/run/named/session.key";
};

logging {
        channel default_debug {
                file "data/named.run";
                severity dynamic;
        };
};

zone "." IN {
        type hint;
        file "named.ca";
};
include "/etc/named.rfc1912.zones";
include "/etc/named.root.key";

三.配置host.conf

[root@jytest1 ~]# cat /etc/host.conf
multi on

该文件指定如何解析主机名。Linux通过解析器库来获得主机名对应的IP地址。下面是一个“/etc/host.conf”的示例:
order bind,hosts
multi on
nospoof on
“order bind,hosts”指定主机名查询顺序,这里规定先使用DNS来解析域名,然后再查询“/etc/hosts”文件(也可以相反)。
“multi on”指定是否“/etc/hosts”文件中指定的主机可以有多个地址,拥有多个IP地址的主机一般称为多穴主机。
“nospoof on”指不允许对该服务器进行IP地址欺骗。IP欺骗是一种攻击系统安全的手段,通过把IP地址伪装成别的计算机,来取得其它计算机的信任。

四.修改/etc/named.rfc1912.zones

[root@jytest1 ~]# cp /etc/named.rfc1912.zones /etc/named.rfc1912.zones.backup
[root@jytest1 ~]# vi /etc/named.rfc1912.zones
// named.rfc1912.zones:
//
// Provided by Red Hat caching-nameserver package
//
// ISC BIND named zone configuration for zones recommended by
// RFC 1912 section 4.1 : localhost TLDs and address zones
// and http://www.ietf.org/internet-drafts/draft-ietf-dnsop-default-local-zones-02.txt
// (c)2007 R W Franks
//
// See /usr/share/doc/bind*/sample/ for example named configuration files.
//

zone "localhost.localdomain" IN {
        type master;
        file "named.localhost";
        allow-update { none; };
};

zone "localhost" IN {
        type master;
        file "named.localhost";
        allow-update { none; };
};

zone "1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.ip6.arpa" IN {
        type master;
        file "named.loopback";
        allow-update { none; };
};

zone "1.0.0.127.in-addr.arpa" IN {
        type master;
        file "named.loopback";
        allow-update { none; };
};

zone "0.in-addr.arpa" IN {
        type master;
        file "named.empty";
        allow-update { none; };
};

--下面为增加的内容,jybd.net.forward为正向解析,jydba.net.reverse为反向解析
zone "jydba.net" IN {
        type master;
        file "jydba.net.forward";
        allow-update { none; };
};

zone "130.138.10.in-addr.arpa" IN {
        type master;
        file "jydba.net.reverse";
        allow-update { none; };
};
"/etc/named.rfc1912.zones" 54L, 1171C written

五.修改具体的zone配置文件

[root@jytest1 named]# cd /var/named
[root@jytest1 named]# cp named.localhost jydba.net.forward
[root@jytest1 named]# cp named.loopback jydba.net.reverse

[root@jytest1 named]# vi jydba.net.forward
$TTL 1D
@       IN SOA  @ root.jydba.net. (
                                        0       ; serial
                                        1D      ; refresh
                                        1H      ; retry
                                        1W      ; expire
                                        3H )    ; minimum
        NS      @
        A       10.138.130.171
        AAAA    ::1

jytest1              A            10.138.130.171
jytest2              A            10.138.130.172
jytest1-vip          A            10.138.130.175
jytest2-vip          A            10.138.130.176
jytest-scan          A            10.138.130.177
jytest-scan          A            10.138.130.178
jytest-scan          A            10.138.130.179


[root@jytest1 named]# vi jydba.net.reverse
$TTL 1D
@       IN SOA  @ root.jydba.net. (
                                        0       ; serial
                                        1D      ; refresh
                                        1H      ; retry
                                        1W      ; expire
                                        3H )    ; minimum
        NS      @
        A       10.138.130.171
        AAAA    ::1
        PTR     localhost.

171           PTR     jytest1
172           PTR     jytest2
175           PTR     jytest1-vip
176           PTR     jytest2-vip
177           PTR     jytest-scan
178           PTR     jytest-scan
179           PTR     jytest-scan

六.配置resolv.conf

[root@jytest1 named]# cat /etc/resolv.conf
# Generated by NetworkManager
search jydba.net


# No nameservers found; try putting DNS servers into your
# ifcfg files in /etc/sysconfig/network-scripts like so:
#
# DNS1=xxx.xxx.xxx.xxx
# DNS2=xxx.xxx.xxx.xxx
# DOMAIN=lab.foo.com bar.foo.com
search jydba.net
nameserver       10.138.130.171

七.测试

[root@jytest1 named]# dig -x 10.138.130.172

; < <>> DiG 9.9.4-RedHat-9.9.4-18.el7 < <>> -x 10.138.130.172
;; global options: +cmd
;; Got answer:
;; ->>HEADER< <- opcode: QUERY, status: REFUSED, id: 20870
;; flags: qr rd; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 1
;; WARNING: recursion requested but not available

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;172.130.138.10.in-addr.arpa.   IN      PTR

;; Query time: 6 msec
;; SERVER: 10.138.130.171#53(10.138.130.171)
;; WHEN: Fri Mar 17 19:15:47 CST 2017
;; MSG SIZE  rcvd: 56




[root@jytest1 named]# service named restart
Redirecting to /bin/systemctl restart  named.service
[root@jytest1 named]# nslookup jytest1
Server:         10.138.130.171
Address:        10.138.130.171#53

** server can't find jytest1: SERVFAIL

上面出现错误,server can't find jytest1: SERVFAIL,错误信息是因为之前创建文件时使用的是root用户,将这些创建的文件修改为named用户与组。

[root@jytest1 named]# ls -lrt
total 32
-rw-r-----. 1 root  named  152 Jun 21  2007 named.localhost
-rw-r-----. 1 root  named  168 Dec 15  2009 named.loopback
-rw-r-----. 1 root  named  152 Dec 15  2009 named.empty
-rw-r-----. 1 root  named 2076 Jan 28  2013 named.ca
drwxrwx---. 2 root  named    6 Mar  6  2015 dyndb-ldap
drwxrwx---. 2 named named    6 Mar  6  2015 slaves
drwxr-x---. 7 root  named   56 Nov  5 11:03 chroot
-rw-r-----  1 root  named  728 Mar 17 18:45 named.jydba
-rw-r--r--  1 root  root   829 Mar 17 18:45 jydba.zone
drwxrwx---. 2 named named   22 Mar 17 18:45 data
-rw-r-----  1 root  root   503 Mar 17 19:13 jydba.net.forward
-rw-r-----  1 root  root   406 Mar 17 19:15 jydba.net.reverse
drwxrwx---. 2 named named   58 Mar 17 19:16 dynamic
[root@jytest1 named]# chown -R named:named jydba*
[root@jytest1 named]# ls -lrt
total 32
-rw-r-----. 1 root  named  152 Jun 21  2007 named.localhost
-rw-r-----. 1 root  named  168 Dec 15  2009 named.loopback
-rw-r-----. 1 root  named  152 Dec 15  2009 named.empty
-rw-r-----. 1 root  named 2076 Jan 28  2013 named.ca
drwxrwx---. 2 root  named    6 Mar  6  2015 dyndb-ldap
drwxrwx---. 2 named named    6 Mar  6  2015 slaves
drwxr-x---. 7 root  named   56 Nov  5 11:03 chroot
-rw-r-----  1 root  named  728 Mar 17 18:45 named.jydba
-rw-r--r--  1 named named  829 Mar 17 18:45 jydba.zone
drwxrwx---. 2 named named   22 Mar 17 18:45 data
-rw-r-----  1 named named  503 Mar 17 19:13 jydba.net.forward
-rw-r-----  1 named named  406 Mar 17 19:15 jydba.net.reverse
drwxrwx---. 2 named named   58 Mar 17 19:16 dynamic
[root@jytest1 named]# systemctl restart  named.service
[root@jytest1 named]# nslookup jytest1
Server:         10.138.130.171
Address:        10.138.130.171#53

Name:   jytest1.jydba.net
Address: 10.138.130.171

[root@jytest1 named]# nslookup jytest1.jydba.net
Server:         10.138.130.171
Address:        10.138.130.171#53

Name:   jytest1.jydba.net
Address: 10.138.130.171

[root@jytest1 named]# nslookup jytest2-priv.jydba.net
Server:         10.138.130.171
Address:        10.138.130.171#53

** server can't find jytest2-priv.jydba.net: NXDOMAIN

[root@jytest1 named]# nslookup jytest2-vip.jydba.net
Server:         10.138.130.171
Address:        10.138.130.171#53

Name:   jytest2-vip.jydba.net
Address: 10.138.130.176

[root@jytest1 named]# nslookup jytest-scan.jydba.net
Server:         10.138.130.171
Address:        10.138.130.171#53

Name:   jytest-scan.jydba.net
Address: 10.138.130.178
Name:   jytest-scan.jydba.net
Address: 10.138.130.179
Name:   jytest-scan.jydba.net
Address: 10.138.130.177

[root@jytest1 named]# nslookup 10.138.130.179
Server:         10.138.130.171
Address:        10.138.130.171#53

179.130.138.10.in-addr.arpa     name = jytest-scan.130.138.10.in-addr.arpa.

通过测试可以看到DNS通过正向与反向解析都是正常的,说明配置成功。

注意:
对于Linux 使用NetworkManager来控制网络的操作系统,当主机重启之前/etc/resolv.conf文件可能会被重写。如果发生这种情况,需要对相应的网卡配置文件增加以下记录
对于Oracle Linux 6修改类似文件 /etc/sysconfig/network-scripts/ifcfg-eth0 (ifcfg-eth1 etc.)
对于Oracle Linux 7修改类似文/etc/sysconfig/network-scripts/ifcfg-ens160 (ifcfg-ens34 etc.)
DNS1=10.138.130.171
DOMAIN=jydba.net

Oracle Linux 7.1 增加网卡及IP配置

由于需要给虚拟机(oracle linux 7.1)增加网卡并设置IP操作,在增加网卡后执行ifconfig命令可以看到增加的网卡信息,但没有生成网卡配置文件

[root@jytest1 ~]# ifconfig
ens34: flags=4163  mtu 1500
        ether 00:50:56:a0:7e:4c  txqueuelen 1000  (Ethernet)
        RX packets 14332  bytes 1177864 (1.1 MiB)
        RX errors 0  dropped 25  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

ens160: flags=4163  mtu 1500
        inet 10.138.130.171  netmask 255.255.255.0  broadcast 10.138.130.255
        inet6 fe80::250:56ff:feb1:260  prefixlen 64  scopeid 0x20
        ether 00:50:56:b1:02:60  txqueuelen 1000  (Ethernet)
        RX packets 14524  bytes 1203727 (1.1 MiB)
        RX errors 0  dropped 11  overruns 0  frame 0
        TX packets 349  bytes 31569 (30.8 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 0  (Local Loopback)
        RX packets 1152  bytes 89096 (87.0 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 1152  bytes 89096 (87.0 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:88:ce:47  txqueuelen 0  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 6  bytes 1172 (1.1 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
[root@jytest1 ~]# cd /etc/sysconfig/network-scripts
[root@jytest1 network-scripts]# ls -lrt
total 232
-rwxr-xr-x. 1 root root  1876 Nov  6  2014 ifup-TeamPort
-rwxr-xr-x. 1 root root  1755 Nov  6  2014 ifup-Team
-rwxr-xr-x. 1 root root  1556 Nov  6  2014 ifdown-TeamPort
-rwxr-xr-x. 1 root root  1599 Nov  6  2014 ifdown-Team
-rw-r--r--. 1 root root 26134 Jan 15  2015 network-functions-ipv6
-rw-r--r--. 1 root root 15316 Jan 15  2015 network-functions
-rwxr-xr-x. 1 root root  4623 Jan 15  2015 init.ipv6-global
-rwxr-xr-x. 1 root root  1740 Jan 15  2015 ifup-wireless
-rwxr-xr-x. 1 root root  2682 Jan 15  2015 ifup-tunnel
-rwxr-xr-x. 1 root root  3263 Jan 15  2015 ifup-sit
-rwxr-xr-x. 1 root root  1925 Jan 15  2015 ifup-routes
-rwxr-xr-x. 1 root root  4154 Jan 15  2015 ifup-ppp
-rwxr-xr-x. 1 root root  2609 Jan 15  2015 ifup-post
-rwxr-xr-x. 1 root root  1043 Jan 15  2015 ifup-plusb
-rwxr-xr-x. 1 root root   642 Jan 15  2015 ifup-plip
-rwxr-xr-x. 1 root root 10430 Jan 15  2015 ifup-ipv6
-rwxr-xr-x. 1 root root 12039 Jan 15  2015 ifup-ippp
-rwxr-xr-x. 1 root root 11502 Jan 15  2015 ifup-eth
-rwxr-xr-x. 1 root root   859 Jan 15  2015 ifup-bnep
-rwxr-xr-x. 1 root root 12616 Jan 15  2015 ifup-aliases
-rwxr-xr-x. 1 root root  1462 Jan 15  2015 ifdown-tunnel
-rwxr-xr-x. 1 root root  1444 Jan 15  2015 ifdown-sit
-rwxr-xr-x. 1 root root   837 Jan 15  2015 ifdown-routes
-rwxr-xr-x. 1 root root  1068 Jan 15  2015 ifdown-ppp
-rwxr-xr-x. 1 root root  1642 Jan 15  2015 ifdown-post
-rwxr-xr-x. 1 root root  4201 Jan 15  2015 ifdown-ipv6
-rwxr-xr-x. 1 root root   781 Jan 15  2015 ifdown-ippp
-rwxr-xr-x. 1 root root  5817 Jan 15  2015 ifdown-eth
-rwxr-xr-x. 1 root root   627 Jan 15  2015 ifdown-bnep
-rw-r--r--. 1 root root   254 Jan 15  2015 ifcfg-lo
-rwxr-xr-x. 1 root root 10145 Mar  6  2015 ifup-ib
-rwxr-xr-x. 1 root root  6196 Mar  6  2015 ifdown-ib
lrwxrwxrwx. 1 root root    24 Nov  5 10:11 ifdown -> ../../../usr/sbin/ifdown
lrwxrwxrwx. 1 root root    11 Nov  5 10:11 ifdown-isdn -> ifdown-ippp
lrwxrwxrwx. 1 root root    22 Nov  5 10:11 ifup -> ../../../usr/sbin/ifup
lrwxrwxrwx. 1 root root     9 Nov  5 10:11 ifup-isdn -> ifup-ippp
-rw-r--r--. 1 root root   358 Nov  5 12:01 ifcfg-ens160

可以看到并没有生成网卡配置文件ifcfg-ens34,而之前在创建虚拟机时增加的网卡ens160是有相应的配置文件ifcfg-ens160。在oracle linux 7.1中使用nmtui来设置网络,nmtui 属于curses-based text user interface(文本用户界面), 类似Linux7以前的setup工具

[root@jytest1 ~]# nmtui

使用nmtui设置完后可以看到生成了网卡ens34的配置文件ifcfg-ens34

 [root@jytest1 network-scripts]# ls -lrt
total 236
-rwxr-xr-x. 1 root root  1876 Nov  6  2014 ifup-TeamPort
-rwxr-xr-x. 1 root root  1755 Nov  6  2014 ifup-Team
-rwxr-xr-x. 1 root root  1556 Nov  6  2014 ifdown-TeamPort
-rwxr-xr-x. 1 root root  1599 Nov  6  2014 ifdown-Team
-rw-r--r--. 1 root root 26134 Jan 15  2015 network-functions-ipv6
-rw-r--r--. 1 root root 15316 Jan 15  2015 network-functions
-rwxr-xr-x. 1 root root  4623 Jan 15  2015 init.ipv6-global
-rwxr-xr-x. 1 root root  1740 Jan 15  2015 ifup-wireless
-rwxr-xr-x. 1 root root  2682 Jan 15  2015 ifup-tunnel
-rwxr-xr-x. 1 root root  3263 Jan 15  2015 ifup-sit
-rwxr-xr-x. 1 root root  1925 Jan 15  2015 ifup-routes
-rwxr-xr-x. 1 root root  4154 Jan 15  2015 ifup-ppp
-rwxr-xr-x. 1 root root  2609 Jan 15  2015 ifup-post
-rwxr-xr-x. 1 root root  1043 Jan 15  2015 ifup-plusb
-rwxr-xr-x. 1 root root   642 Jan 15  2015 ifup-plip
-rwxr-xr-x. 1 root root 10430 Jan 15  2015 ifup-ipv6
-rwxr-xr-x. 1 root root 12039 Jan 15  2015 ifup-ippp
-rwxr-xr-x. 1 root root 11502 Jan 15  2015 ifup-eth
-rwxr-xr-x. 1 root root   859 Jan 15  2015 ifup-bnep
-rwxr-xr-x. 1 root root 12616 Jan 15  2015 ifup-aliases
-rwxr-xr-x. 1 root root  1462 Jan 15  2015 ifdown-tunnel
-rwxr-xr-x. 1 root root  1444 Jan 15  2015 ifdown-sit
-rwxr-xr-x. 1 root root   837 Jan 15  2015 ifdown-routes
-rwxr-xr-x. 1 root root  1068 Jan 15  2015 ifdown-ppp
-rwxr-xr-x. 1 root root  1642 Jan 15  2015 ifdown-post
-rwxr-xr-x. 1 root root  4201 Jan 15  2015 ifdown-ipv6
-rwxr-xr-x. 1 root root   781 Jan 15  2015 ifdown-ippp
-rwxr-xr-x. 1 root root  5817 Jan 15  2015 ifdown-eth
-rwxr-xr-x. 1 root root   627 Jan 15  2015 ifdown-bnep
-rw-r--r--. 1 root root   254 Jan 15  2015 ifcfg-lo
-rwxr-xr-x. 1 root root 10145 Mar  6  2015 ifup-ib
-rwxr-xr-x. 1 root root  6196 Mar  6  2015 ifdown-ib
lrwxrwxrwx. 1 root root    24 Nov  5 10:11 ifdown -> ../../../usr/sbin/ifdown
lrwxrwxrwx. 1 root root    11 Nov  5 10:11 ifdown-isdn -> ifdown-ippp
lrwxrwxrwx. 1 root root    22 Nov  5 10:11 ifup -> ../../../usr/sbin/ifup
lrwxrwxrwx. 1 root root     9 Nov  5 10:11 ifup-isdn -> ifup-ippp
-rw-r--r--. 1 root root   346 Mar 16 12:36 ifcfg-ens160
-rw-r--r--. 1 root root   181 Mar 16 12:42 ifcfg-ens34

编辑配置文件

[root@jytest1 network-scripts]# vi ifcfg-ens34
TYPE=Ethernet
BOOTPROTO=none
IPADDR=88.88.88.1
NETMASK=255.255.255.0
PREFIX=32
DEFROUTE=yes
IPV4_FAILURE_FATAL=no
IPV6INIT=no
NAME=ens34
UUID=f0e4fffc-668c-4b3d-b1cf-ab2b0122dd7d
DEVICE=ens34
ONBOOT=yes

重启网络

[root@jytest1 network-scripts]# systemctl restart network
[root@jytest1 network-scripts]# ifconfig
ens34: flags=4163  mtu 1500
        inet 88.88.88.1  netmask 255.255.255.255  broadcast 88.88.88.1
        inet6 fe80::250:56ff:fea0:7e4c  prefixlen 64  scopeid 0x20
        ether 00:50:56:a0:7e:4c  txqueuelen 1000  (Ethernet)
        RX packets 24804  bytes 2064784 (1.9 MiB)
        RX errors 0  dropped 25  overruns 0  frame 0
        TX packets 57  bytes 8254 (8.0 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

ens160: flags=4163  mtu 1500
        inet 10.138.130.171  netmask 255.255.255.0  broadcast 10.138.130.255
        inet6 fe80::250:56ff:feb1:260  prefixlen 64  scopeid 0x20
        ether 00:50:56:b1:02:60  txqueuelen 1000  (Ethernet)
        RX packets 25331  bytes 2120003 (2.0 MiB)
        RX errors 0  dropped 11  overruns 0  frame 0
        TX packets 767  bytes 84120 (82.1 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 0  (Local Loopback)
        RX packets 1480  bytes 113808 (111.1 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 1480  bytes 113808 (111.1 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:88:ce:47  txqueuelen 0  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 6  bytes 1172 (1.1 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

 [root@jytest1 network-scripts]# ping jytest1-priv
PING jytest1-priv (88.88.88.1) 56(84) bytes of data.
64 bytes from jytest1-priv (88.88.88.1): icmp_seq=1 ttl=64 time=0.419 ms
64 bytes from jytest1-priv (88.88.88.1): icmp_seq=2 ttl=64 time=0.227 ms
^C
--- jytest1-priv ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1001ms
rtt min/avg/max/mdev = 0.227/0.323/0.419/0.096 ms

配置完成

How to Change hostname in Oracle Linux 7

在Oracle Linux7中通过修改/etc/sysconfig/network这种方式并不能修改Oracle Linux 7的主机名。为了对Oracle Linux 7修改主机名,可以通过执行以下任何一种方法来实现:
1.使用主机名控制工具(hostnamectl)
2.使用网络管理命令行工具(nmcli)
3.编辑/etc/hostname文件

1.使用主机名控制工具(hostnamectl),它是systemd-hostnamed服务的命令行工具
获取当前主机名:

[root@jytest ~]# hostnamectl status
   Static hostname: jytest
         Icon name: computer
           Chassis: n/a
        Machine ID: 66203d1dd6f54e5da356f986ac82f473
           Boot ID: e8ca08f1d73347358f085a6d0f5ed201
    Virtualization: vmware
  Operating System: Oracle Linux Server 7.1
       CPE OS Name: cpe:/o:oracle:linux:7:1
            Kernel: Linux 3.8.13-55.1.6.el7uek.x86_64
      Architecture: x86_64

修改主机名:

[root@jytest ~]# hostnamectl set-hostname jytest3

重新登录获取当前主机名可以看到主机名已经变成了jytest3

[root@jytest3 ~]# hostnamectl status
   Static hostname: jytest3
         Icon name: computer
           Chassis: n/a
        Machine ID: 66203d1dd6f54e5da356f986ac82f473
           Boot ID: e8ca08f1d73347358f085a6d0f5ed201
    Virtualization: vmware
  Operating System: Oracle Linux Server 7.1
       CPE OS Name: cpe:/o:oracle:linux:7:1
            Kernel: Linux 3.8.13-55.1.6.el7uek.x86_64
      Architecture: x86_64

2.使用网络管理命令行工具(nmcli)
获取当前主机名

[root@jytest3 ~]# nmcli general hostname
jytest3

修改主机名并重新启动systemd-hostnamed服务

[root@jytest3 ~]# nmcli general hostname jytest2
[root@jytest3 ~]# systemctl restart systemd-hostnamed

重新登录并检查当前主机名

[root@jytest2 ~]# hostname
jytest2

3.编辑/etc/hostname文件
获取当前主机名

[root@jytest2 ~]# cat /etc/hostname
jytest2

修改主机名

[root@jytest2 ~]# echo "jytest1" > /etc/hostname
[root@jytest2 ~]# cat /etc/hostname
jytest1

重启系统并检查主机名

[root@jytest2 ~]# reboot
[root@jytest1 ~]# hostname
jytest1
[root@jytest1 ~]# cat /etc/hostname
jytest1

引用:How to Configure hostname in Oracle Linux 7 (Doc ID 2049221.1)

How to Set Device Name Using UDEV on Oracle Linux 7.1

这篇文章主要介绍在Oracle Linux 7中如何使用udev来设置用户自定义的设备名。在Oracle Linux 7 中的设置方法与之前的Linux版本有较大差别。

下面的例子的对/dev/sdb,/dev/sdc通过设置udev rules来创建用户定义的设备名称
1.查看Linux版本

[root@jytest ~]# uname -a
Linux jytest 3.8.13-55.1.6.el7uek.x86_64 #2 SMP Wed Feb 11 14:18:22 PST 2015 x86_64  x86_64 x86_64 GNU/Linux

2.查找设备的UUID

[root@jytest ~]# fdisk -l

Disk /dev/sdb: 5368 MB, 5368709120 bytes, 10485760 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: dos
Disk identifier: 0x41b4373b

   Device Boot      Start         End      Blocks   Id  System

Disk /dev/sda: 53.7 GB, 53687091200 bytes, 104857600 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: dos
Disk identifier: 0x000209aa

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *        2048     1026047      512000   83  Linux
/dev/sda2         1026048   104857599    51915776   8e  Linux LVM

Disk /dev/sdc: 5368 MB, 5368709120 bytes, 10485760 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/mapper/ol-root: 47.7 GB, 47747956736 bytes, 93257728 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/mapper/ol-swap: 5368 MB, 5368709120 bytes, 10485760 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes



[root@jytest dev]# /usr/lib/udev/scsi_id -g -u /dev/sdb
36000c294ae49672e100c14f8d1708ba0
[root@jytest dev]# /usr/lib/udev/scsi_id -g -u /dev/sdc
36000c2952e94e2262a0c351bbb9817eb

注意:如果是使用vmvare虚拟机,那么显示uuid需要在vmx文件中增加disk.enableUUID = “TRUE”,我这里使用了是vmvare虚拟机,在相应的虚拟机的vmx文件增加了disk.enableUUID = “TRUE”

~ # vi/vmfs/volumes/581c05d5-12b526b2-f04f- 5c260afd5108/oracle_linux7_1/oracle_linux7_1.vmx
.encoding = "UTF-8"
disk.EnableUUID="TRUE"
...省略...

3.创建新的udev rule

[root@jytest dev]# vi /etc/udev/rules.d/99-my-asmdevices.rules

KERNEL=="sd*[!0-9]", ENV{DEVTYPE}=="disk", SUBSYSTEM=="block",  PROGRAM=="/usr/lib/udev/scsi_id -g -u -d $devnode",  RESULT=="36000c294ae49672e100c14f8d1708ba0", RUN+="/bin/sh -c 'mknod /dev/asmdisk01 b  $major $minor; chown grid:oinstall /dev/asmdisk01; chmod 0660 /dev/asmdisk01'"

KERNEL=="sd*[!0-9]", ENV{DEVTYPE}=="disk", SUBSYSTEM=="block",  PROGRAM=="/usr/lib/udev/scsi_id -g -u -d $devnode",  RESULT=="36000c2952e94e2262a0c351bbb9817eb", RUN+="/bin/sh -c 'mknod /dev/asmdisk02 b  $major $minor; chown grid:oinstall /dev/asmdisk02; chmod 0660 /dev/asmdisk02'"

4.测试新的udev rule
执行以下命令或重启来验证新的udev rule
4.1 检查新的设备名称:

[root@jytest dev]# /sbin/udevadm trigger --type=devices --action=change

[root@jytest dev]# ls -lrt asm*
brw-rw----. 1 grid oinstall 8, 32 Dec 15 18:32 asmdisk02
brw-rw----. 1 grid oinstall 8, 16 Dec 15 18:32 asmdisk01

4.2 为了重新加载udev rule执行以下命令:

[root@jytest dev]# /sbin/udevadm control --reload

4.3为了诊断udev rule执行以下命令:

[root@jytest dev]# /sbin/udevadm test /sys/block/sdb
calling: test
version 208
This program is for debugging only, it does not run any program
specified by a RUN key. It may show incorrect results, because
some values may be different, or not available at a simulation run.

=== trie on-disk ===
tool version:          208
file size:         6376691 bytes
header size             80 bytes
strings            1401963 bytes
nodes              4974648 bytes
load module index
read rules file: /usr/lib/udev/rules.d/10-dm.rules
read rules file: /usr/lib/udev/rules.d/100-balloon.rules
read rules file: /usr/lib/udev/rules.d/11-dm-lvm.rules
read rules file: /usr/lib/udev/rules.d/11-dm-mpath.rules
read rules file: /usr/lib/udev/rules.d/13-dm-disk.rules
read rules file: /usr/lib/udev/rules.d/40-libgphoto2.rules
IMPORT found builtin 'usb_id --export %%p', replacing /usr/lib/udev/rules.d/40- libgphoto2.rules:11
read rules file: /usr/lib/udev/rules.d/40-redhat.rules
read rules file: /usr/lib/udev/rules.d/40-usb-media-players.rules
read rules file: /usr/lib/udev/rules.d/40-usb_modeswitch.rules
read rules file: /usr/lib/udev/rules.d/42-usb-hid-pm.rules
read rules file: /usr/lib/udev/rules.d/50-rbd.rules
read rules file: /usr/lib/udev/rules.d/50-udev-default.rules
read rules file: /usr/lib/udev/rules.d/56-hpmud.rules
read rules file: /usr/lib/udev/rules.d/60-alias-kmsg.rules
read rules file: /usr/lib/udev/rules.d/60-cdrom_id.rules
read rules file: /usr/lib/udev/rules.d/60-fprint-autosuspend.rules
read rules file: /usr/lib/udev/rules.d/60-keyboard.rules
read rules file: /usr/lib/udev/rules.d/60-net.rules
read rules file: /usr/lib/udev/rules.d/60-persistent-alsa.rules
read rules file: /usr/lib/udev/rules.d/60-persistent-input.rules
read rules file: /usr/lib/udev/rules.d/60-persistent-serial.rules
read rules file: /usr/lib/udev/rules.d/60-persistent-storage-tape.rules
read rules file: /usr/lib/udev/rules.d/60-persistent-storage.rules
read rules file: /usr/lib/udev/rules.d/60-persistent-v4l.rules
read rules file: /usr/lib/udev/rules.d/60-raw.rules
read rules file: /usr/lib/udev/rules.d/61-accelerometer.rules
read rules file: /usr/lib/udev/rules.d/61-gnome-bluetooth-rfkill.rules
read rules file: /usr/lib/udev/rules.d/62-multipath.rules
read rules file: /usr/lib/udev/rules.d/63-md-raid-arrays.rules
read rules file: /usr/lib/udev/rules.d/64-btrfs.rules
read rules file: /usr/lib/udev/rules.d/65-libwacom.rules
read rules file: /usr/lib/udev/rules.d/65-md-incremental.rules
read rules file: /usr/lib/udev/rules.d/65-sane-backends.rules
read rules file: /usr/lib/udev/rules.d/69-cd-sensors.rules
IMPORT found builtin 'usb_id --export %p', replacing /usr/lib/udev/rules.d/69-cd- sensors.rules:89
read rules file: /usr/lib/udev/rules.d/69-dm-lvm-metad.rules
read rules file: /usr/lib/udev/rules.d/69-libmtp.rules
read rules file: /usr/lib/udev/rules.d/69-xorg-vmmouse.rules
read rules file: /etc/udev/rules.d/70-persistent-ipoib.rules
read rules file: /usr/lib/udev/rules.d/70-power-switch.rules
read rules file: /usr/lib/udev/rules.d/70-printers.rules
read rules file: /usr/lib/udev/rules.d/70-spice-vdagentd.rules
read rules file: /usr/lib/udev/rules.d/70-touchpad-quirks.rules
read rules file: /usr/lib/udev/rules.d/70-uaccess.rules
read rules file: /usr/lib/udev/rules.d/70-wacom.rules
read rules file: /usr/lib/udev/rules.d/71-biosdevname.rules
read rules file: /usr/lib/udev/rules.d/71-seat.rules
read rules file: /usr/lib/udev/rules.d/73-idrac.rules
read rules file: /usr/lib/udev/rules.d/73-seat-late.rules
read rules file: /usr/lib/udev/rules.d/75-net-description.rules
read rules file: /usr/lib/udev/rules.d/75-probe_mtd.rules
read rules file: /usr/lib/udev/rules.d/75-tty-description.rules
read rules file: /usr/lib/udev/rules.d/77-mm-ericsson-mbm.rules
read rules file: /usr/lib/udev/rules.d/77-mm-huawei-net-port-types.rules
read rules file: /usr/lib/udev/rules.d/77-mm-longcheer-port-types.rules
read rules file: /usr/lib/udev/rules.d/77-mm-nokia-port-types.rules
read rules file: /usr/lib/udev/rules.d/77-mm-pcmcia-device-blacklist.rules
read rules file: /usr/lib/udev/rules.d/77-mm-platform-serial-whitelist.rules
read rules file: /usr/lib/udev/rules.d/77-mm-simtech-port-types.rules
read rules file: /usr/lib/udev/rules.d/77-mm-telit-port-types.rules
read rules file: /usr/lib/udev/rules.d/77-mm-usb-device-blacklist.rules
read rules file: /usr/lib/udev/rules.d/77-mm-usb-serial-adapters-greylist.rules
read rules file: /usr/lib/udev/rules.d/77-mm-x22x-port-types.rules
read rules file: /usr/lib/udev/rules.d/77-mm-zte-port-types.rules
read rules file: /usr/lib/udev/rules.d/77-nm-olpc-mesh.rules
read rules file: /usr/lib/udev/rules.d/78-sound-card.rules
read rules file: /usr/lib/udev/rules.d/80-drivers.rules
read rules file: /usr/lib/udev/rules.d/80-kvm.rules
read rules file: /usr/lib/udev/rules.d/80-mm-candidate.rules
read rules file: /usr/lib/udev/rules.d/80-net-name-slot.rules
read rules file: /usr/lib/udev/rules.d/80-udisks2.rules
read rules file: /usr/lib/udev/rules.d/81-kvm-rhel.rules
read rules file: /usr/lib/udev/rules.d/85-regulatory.rules
read rules file: /usr/lib/udev/rules.d/85-usbmuxd.rules
read rules file: /usr/lib/udev/rules.d/90-alsa-restore.rules
read rules file: /usr/lib/udev/rules.d/90-alsa-tools-firmware.rules
read rules file: /usr/lib/udev/rules.d/90-iprutils.rules
read rules file: /usr/lib/udev/rules.d/90-pulseaudio.rules
read rules file: /usr/lib/udev/rules.d/90-vconsole.rules
read rules file: /usr/lib/udev/rules.d/91-drm-modeset.rules
read rules file: /usr/lib/udev/rules.d/95-cd-devices.rules
read rules file: /usr/lib/udev/rules.d/95-dm-notify.rules
read rules file: /usr/lib/udev/rules.d/95-udev-late.rules
read rules file: /usr/lib/udev/rules.d/95-upower-battery-recall-dell.rules
read rules file: /usr/lib/udev/rules.d/95-upower-battery-recall-fujitsu.rules
read rules file: /usr/lib/udev/rules.d/95-upower-battery-recall-gateway.rules
read rules file: /usr/lib/udev/rules.d/95-upower-battery-recall-ibm.rules
read rules file: /usr/lib/udev/rules.d/95-upower-battery-recall-lenovo.rules
read rules file: /usr/lib/udev/rules.d/95-upower-battery-recall-toshiba.rules
read rules file: /usr/lib/udev/rules.d/95-upower-csr.rules
read rules file: /usr/lib/udev/rules.d/95-upower-hid.rules
read rules file: /usr/lib/udev/rules.d/95-upower-wup.rules
read rules file: /usr/lib/udev/rules.d/97-bluetooth-serial.rules
read rules file: /usr/lib/udev/rules.d/98-kexec.rules
read rules file: /usr/lib/udev/rules.d/98-rdma.rules
read rules file: /etc/udev/rules.d/99-my-asmdevices.rules
read rules file: /usr/lib/udev/rules.d/99-qemu-guest-agent.rules
read rules file: /usr/lib/udev/rules.d/99-systemd.rules
rules contain 393216 bytes tokens (32768 * 12 bytes), 38852 bytes strings
30460 strings (257150 bytes), 27006 de-duplicated (221753 bytes), 3455 trie nodes used
GROUP 6 /usr/lib/udev/rules.d/50-udev-default.rules:51
IMPORT 'scsi_id --export --whitelisted -d /dev/sdb' /usr/lib/udev/rules.d/60- persistent-storage.rules:40
starting 'scsi_id --export --whitelisted -d /dev/sdb'
'scsi_id --export --whitelisted -d /dev/sdb'(out) 'ID_SCSI=1'
'scsi_id --export --whitelisted -d /dev/sdb'(out) 'ID_VENDOR=VMware'
'scsi_id --export --whitelisted -d /dev/sdb'(out) 'ID_VENDOR_ENC=VMware\x20\x20'
'scsi_id --export --whitelisted -d /dev/sdb'(out) 'ID_MODEL=Virtual_disk'
'scsi_id --export --whitelisted -d /dev/sdb'(out) 'ID_MODEL_ENC=Virtual\x20disk \x20\x20\x20\x20'
'scsi_id --export --whitelisted -d /dev/sdb'(out) 'ID_REVISION=1.0'
'scsi_id --export --whitelisted -d /dev/sdb'(out) 'ID_TYPE=disk'
'scsi_id --export --whitelisted -d /dev/sdb'(out)  'ID_SERIAL=36000c294ae49672e100c14f8d1708ba0'
'scsi_id --export --whitelisted -d /dev/sdb'(out)  'ID_SERIAL_SHORT=6000c294ae49672e100c14f8d1708ba0'
'scsi_id --export --whitelisted -d /dev/sdb'(out) 'ID_WWN=0x6000c294ae49672e'
'scsi_id --export --whitelisted -d /dev/sdb'(out)  'ID_WWN_VENDOR_EXTENSION=0x100c14f8d1708ba0'
'scsi_id --export --whitelisted -d /dev/sdb'(out)  'ID_WWN_WITH_EXTENSION=0x6000c294ae49672e100c14f8d1708ba0'
'scsi_id --export --whitelisted -d /dev/sdb'(out)  'ID_SCSI_SERIAL=6000c294ae49672e100c14f8d1708ba0'
'scsi_id --export --whitelisted -d /dev/sdb' [24105] exit with return code 0
LINK 'disk/by-id/scsi-36000c294ae49672e100c14f8d1708ba0' /usr/lib/udev/rules.d/60- persistent-storage.rules:42
IMPORT builtin 'path_id' /usr/lib/udev/rules.d/60-persistent-storage.rules:58
LINK 'disk/by-path/pci-0000:02:01.0-scsi-0:0:0:0' /usr/lib/udev/rules.d/60-persistent- storage.rules:59
IMPORT builtin 'blkid' /usr/lib/udev/rules.d/60-persistent-storage.rules:73
probe /dev/sdb raid offset=0
LINK 'disk/by-id/wwn-0x6000c294ae49672e100c14f8d1708ba0' /usr/lib/udev/rules.d/60- persistent-storage.rules:83
PROGRAM '/usr/lib/udev/scsi_id -g -u -d /dev/sdb' /etc/udev/rules.d/99-my- asmdevices.rules:2
starting '/usr/lib/udev/scsi_id -g -u -d /dev/sdb'
'/usr/lib/udev/scsi_id -g -u -d /dev/sdb'(out) '36000c294ae49672e100c14f8d1708ba0'
'/usr/lib/udev/scsi_id -g -u -d /dev/sdb' [24106] exit with return code 0
RUN '/bin/sh -c 'mknod /dev/asmdisk01 b $major $minor; chown grid:oinstall  /dev/asmdisk01; chmod 0660 /dev/asmdisk01'' /etc/udev/rules.d/99-my-asmdevices.rules:2
PROGRAM '/usr/lib/udev/scsi_id -g -u -d /dev/sdb' /etc/udev/rules.d/99-my- asmdevices.rules:4
starting '/usr/lib/udev/scsi_id -g -u -d /dev/sdb'
'/usr/lib/udev/scsi_id -g -u -d /dev/sdb'(out) '36000c294ae49672e100c14f8d1708ba0'
'/usr/lib/udev/scsi_id -g -u -d /dev/sdb' [24107] exit with return code 0
handling device node '/dev/sdb', devnum=b8:16, mode=0660, uid=0, gid=6
set permissions /dev/sdb, 060660, uid=0, gid=6
preserve already existing symlink '/dev/block/8:16' to '../sdb'
found 'b8:16' claiming '/run/udev/links/\x2fdisk\x2fby-id\x2fscsi- 36000c294ae49672e100c14f8d1708ba0'
creating link '/dev/disk/by-id/scsi-36000c294ae49672e100c14f8d1708ba0' to '/dev/sdb'
preserve already existing symlink '/dev/disk/by-id/scsi- 36000c294ae49672e100c14f8d1708ba0' to '../../sdb'
found 'b8:16' claiming '/run/udev/links/\x2fdisk\x2fby-id\x2fwwn- 0x6000c294ae49672e100c14f8d1708ba0'
creating link '/dev/disk/by-id/wwn-0x6000c294ae49672e100c14f8d1708ba0' to '/dev/sdb'
preserve already existing symlink '/dev/disk/by-id/wwn- 0x6000c294ae49672e100c14f8d1708ba0' to '../../sdb'
found 'b8:16' claiming '/run/udev/links/\x2fdisk\x2fby-path\x2fpci-0000:02:01.0-scsi- 0:0:0:0'
creating link '/dev/disk/by-path/pci-0000:02:01.0-scsi-0:0:0:0' to '/dev/sdb'
preserve already existing symlink '/dev/disk/by-path/pci-0000:02:01.0-scsi-0:0:0:0' to  '../../sdb'
.ID_FS_TYPE_NEW=
ACTION=add
DEVLINKS=/dev/disk/by-id/scsi-36000c294ae49672e100c14f8d1708ba0 /dev/disk/by-id/wwn- 0x6000c294ae49672e100c14f8d1708ba0 /dev/disk/by-path/pci-0000:02:01.0-scsi-0:0:0:0
DEVNAME=/dev/sdb
DEVPATH=/devices/pci0000:00/0000:00:11.0/0000:02:01.0/host3/target3:0:0/3:0:0:0/block/sd b
DEVTYPE=disk
ID_BUS=scsi
ID_FS_TYPE=
ID_MODEL=Virtual_disk
ID_MODEL_ENC=Virtual\x20disk\x20\x20\x20\x20
ID_PART_TABLE_TYPE=dos
ID_PATH=pci-0000:02:01.0-scsi-0:0:0:0
ID_PATH_TAG=pci-0000_02_01_0-scsi-0_0_0_0
ID_REVISION=1.0
ID_SCSI=1
ID_SCSI_SERIAL=6000c294ae49672e100c14f8d1708ba0
ID_SERIAL=36000c294ae49672e100c14f8d1708ba0
ID_SERIAL_SHORT=6000c294ae49672e100c14f8d1708ba0
ID_TYPE=disk
ID_VENDOR=VMware
ID_VENDOR_ENC=VMware\x20\x20
ID_WWN=0x6000c294ae49672e
ID_WWN_VENDOR_EXTENSION=0x100c14f8d1708ba0
ID_WWN_WITH_EXTENSION=0x6000c294ae49672e100c14f8d1708ba0
MAJOR=8
MINOR=16
MPATH_SBIN_PATH=/sbin
SUBSYSTEM=block
TAGS=:systemd:
USEC_INITIALIZED=545736
run: '/bin/sh -c 'mknod /dev/asmdisk01 b 8 16; chown grid:oinstall /dev/asmdisk01; chmod  0660 /dev/asmdisk01''
unload module index

4.4 如果不再需要device可以手动删除device文件

[root@jytest dev]# /bin/rm /dev/asmdisk01
[root@jytest dev]# /bin/rm /dev/asmdisk02
[root@jytest dev]# ls -lrt asm*
ls: cannot access asm*: No such file or directory

Linux 格式化分区 报错Could not stat /dev/sda3 — No such file or directory

执行分区过程如下:
[root@jyrac2 ~]# fdisk /dev/sda

The number of cylinders for this disk is set to 3002.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
(e.g., DOS FDISK, OS/2 FDISK)

Command (m for help): p

Disk /dev/sda: 24.6 GB, 24696061952 bytes
255 heads, 63 sectors/track, 3002 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sda1 * 1 2355 18916506 83 Linux
/dev/sda2 2356 2610 2048287+ 82 Linux swap / Solaris

Command (m for help): m
Command action
a toggle a bootable flag
b edit bsd disklabel
c toggle the dos compatibility flag
d delete a partition
l list known partition types
m print this menu
n add a new partition
o create a new empty DOS partition table
p print the partition table
q quit without saving changes
s create a new empty Sun disklabel
t change a partition’s system id
u change display/entry units
v verify the partition table
w write table to disk and exit
x extra functionality (experts only)

Command (m for help): u
Changing display/entry units to sectors

Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 3
First sector (41929650-48234495, default 41929650):
Using default value 41929650
Last sector or +size or +sizeM or +sizeK (41929650-48234495, default 48234495):
Using default value 48234495

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.

WARNING: Re-reading the partition table failed with error 16: Device or resource busy.
The kernel still uses the old table.
The new table will be used at the next reboot.
Syncing disks.
You have new mail in /var/spool/mail/root

[root@jyrac2 ~]# fdisk -l

Disk /dev/sda: 24.6 GB, 24696061952 bytes
255 heads, 63 sectors/track, 3002 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sda1 * 1 2355 18916506 83 Linux
/dev/sda2 2356 2610 2048287+ 82 Linux swap / Solaris
/dev/sda3 2611 3003 3152423 83 Linux
新的分区为/dev/sda3

对分区进行格式化:
[root@jyrac2 /]# mkfs.ext3 /dev/sda3
mke2fs 1.39 (29-May-2006)
Could not stat /dev/sda3 — No such file or directory

The device apparently does not exist; did you specify it correctly?

解决这个问题可以使用partprobe 命令,partprobe包含在parted的rpm软件包中。partprobe可以修改kernel中分区表,使kernel重新读取分区表。 因此,使用该命令就可以创建分区并且在不重新启动机器的情况下系统能够识别这些分区。
检查是否安装了partprobe软件包
[root@jyrac2 /]# rpm -q parted
parted-1.8.1-23.el5

[root@jyrac2 /]# partprobe
[root@jyrac2 /]# mkfs -t ext3 /dev/sda3
mke2fs 1.39 (29-May-2006)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
394400 inodes, 788105 blocks
39405 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=809500672
25 block groups
32768 blocks per group, 32768 fragments per group
15776 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912

Writing inode tables: done
Creating journal (16384 blocks): done
Writing superblocks and filesystem accounting information: done

This filesystem will be automatically checked every 21 mounts or
180 days, whichever comes first. Use tune2fs -c or -i to override.
You have new mail in /var/spool/mail/root
格式化分区成功
[root@jyrac2 /]# mkdir /u02
[root@jyrac2 /]# mount /dev/sda3 /u02
[root@jyrac2 ~]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sda1 18G 16G 1.5G 92% /
tmpfs 2.0G 0 2.0G 0% /dev/shm
/dev/sda3 4.0G 237M 3.6G 7% /u02

Oracle Linux 7禁用Transparent HugePages

Transparent HugePages内存在Red Hat企业Linux 6,SUSE 11和Oracle Linux 6的Oracle Linux Unbreakable Enterprise Kernel2(UEK2)早期版本中默认是启用的。Transparent HugePages内存在Oracle Linux Unbreakable Enterprise Kernel2(UEK2)内核中默认情况下是禁用的。”tuned.service”在Oracle Linux7中默认是将transparent_hugepage设置为always。即使在grub内核命令行中它是禁用的,在boot时tuned service将被设置为’always’。在UEK3中默认情况下是禁用的。

Transparent HugePages可能会造成内存在运行时的延迟分配。为了避免性能问题,Oracle强烈建议对所有Oracle数据库服务器禁用Transparent HugePages。为了提高性能Oracle建议使用标准HugePages。

Transparent HugePages内存与标准HugePages内存的差异在于内核khugepaged线程在运行时动态分配内存。标准HugePages内存是在启动时预先分配在运行时不会发生改变。
1.检查Transparent HugePage是否被启用

[root@oracle12c ~]# uname -r
3.10.0-123.el7.x86_64
[root@oracle12c ~]# cat /sys/kernel/mm/transparent_hugepage/enabled
[always] madvise never ---这说明Transparent Hugepage被启用

2.有两种禁用Transparent HugePage的模式
2.1对吞吐性能方面全局禁用Transparent HugePage
先对文件/usr/lib/tuned/throughput-performance/tuned.conf进行备份

[root@oracle12c ~]# ls -lrt /usr/lib/tuned/throughput-performance/tuned.conf*
-rw-r--r--. 1 root root 2050 May 7 2014 /usr/lib/tuned/throughput-performance/tuned.conf
-rw-r--r--. 1 root root 2050 Mar 29 11:04 /usr/lib/tuned/throughput-performance/tuned.conf.bkp


[root@oracle12c ~]# more /usr/lib/tuned/throughput-performance/tuned.conf | grep "transparent_hugepages"
transparent_hugepages=always

修改文件/usr/lib/tuned/throughput-performance/tuned.conf,将其中的
[vm]
transparent_hugepages=always
修改为
[vm]
transparent_hugepages=never


[root@oracle12c ~]# more /usr/lib/tuned/throughput-performance/tuned.conf | grep "transparent_hugepages"
transparent_hugepages=never

重启操作系统来验证修改结果


[root@oracle12c ~]# uname -r
3.10.0-123.el7.x86_64
[root@oracle12c ~]# cat /sys/kernel/mm/transparent_hugepage/enabled
always madvise [never]

2.2.对正使用的调整概要文件禁用Transparent HugePage
先识别正使用的调整概要文件

[root@oracle12c ~]# tuned-adm active
Current active profile: virtual-guest --这说明当前正使用的概要文件是Virtual-guest

Virtual-guest profile是使用文件/usr/lib/tuned/virtual-guest/tuned.conf,并且它包含了来自文件/usr/lib/tuned/throughput-performance/tuned.conf中的”throughput-performance”。首先对文件/usr/lib/tuned/virtual-guest/tuned.conf进行备份

[root@oracle12c ~]# cp /usr/lib/tuned/virtual-guest/tuned.conf /usr/lib/tuned/virtual-guest/tuned.conf.bkp
[root@oracle12c ~]# ls -lrt /usr/lib/tuned/virtual-guest/tuned.conf*
-rw-r--r--. 1 root root 697 Nov 6 2013 /usr/lib/tuned/virtual-guest/tuned.conf
-rw-r--r--. 1 root root 697 Mar 29 11:26 /usr/lib/tuned/virtual-guest/tuned.conf.bkp


[root@oracle12c ~]# more /usr/lib/tuned/virtual-guest/tuned.conf
#
# tuned configuration
#

[main]
include=throughput-performance

[sysctl]
# If a workload mostly uses anonymous memory and it hits this limit, the entire
# working set is buffered for I/O, and any more write buffering would require
# swapping, so it's time to throttle writes until I/O can catch up. Workloads
# that mostly use file mappings may be able to use even higher values.
#
# The generator of dirty data starts writeback at this percentage (system default
# is 20%)
vm.dirty_ratio = 30

# Filesystem I/O is usually much more efficient than swapping, so try to keep
# swapping low. It's usually safe to go even lower than this on systems with
# server-grade storage.
vm.swappiness = 30

向文件/usr/lib/tuned/virtual-guest/tuned.conf中增加”transparent_hugepages=never”来禁用
Transparent HugePage


[root@oracle12c ~]# vi /usr/lib/tuned/virtual-guest/tuned.conf
#
# tuned configuration
#

[main]
include=throughput-performance
[vm]
transparent_hugepages=never
[sysctl]
# If a workload mostly uses anonymous memory and it hits this limit, the entire
# working set is buffered for I/O, and any more write buffering would require
# swapping, so it's time to throttle writes until I/O can catch up. Workloads
# that mostly use file mappings may be able to use even higher values.
#
# The generator of dirty data starts writeback at this percentage (system default
# is 20%)
vm.dirty_ratio = 30

# Filesystem I/O is usually much more efficient than swapping, so try to keep
# swapping low. It's usually safe to go even lower than this on systems with
# server-grade storage.
vm.swappiness = 30

重启操作系统来验证结果

[root@oracle12c ~]# uname -r
3.10.0-123.el7.x86_64
[root@oracle12c ~]# cat /sys/kernel/mm/transparent_hugepage/enabled
always madvise [never]

Oracle Linux 7配置vncserver

DBA,在创建Oracle数据库的过程中一般要使用dbca和netca图像化进行建库和创建监听(如果使用脚本建库另说),所以图形化操作工具是必不可少的,在Linux操作系统中个人比较喜欢的图形化操作软件是VNC,今天刚好遇到了Oracle Linux 7的操作环境,就顺手记录一下配置过程。
1.检查系统是否已经安装vncserver软件包

[root@oracle12c ~]# rpm -qa|grep tigervnc
tigervnc-server-minimal-1.2.80-0.30.20130314svn5065.el7.x86_64
tigervnc-license-1.2.80-0.30.20130314svn5065.el7.noarch

没有安装执行以下命令进行安装

[root@oracle12c Packages]# pwd
/run/media/yong/OL-7.0 Server.x86_64/Packages
[root@oracle12c Packages]# yum -y install tigervnc-server-1.2.80-0.30.20130314svn5065.el7.x86_64.rpm
Loaded plugins: langpacks
Examining tigervnc-server-1.2.80-0.30.20130314svn5065.el7.x86_64.rpm: tigervnc-server-1.2.80-0.30.20130314svn5065.el7.x86_64
Marking tigervnc-server-1.2.80-0.30.20130314svn5065.el7.x86_64.rpm to be installed
Resolving Dependencies
--> Running transaction check
---> Package tigervnc-server.x86_64 0:1.2.80-0.30.20130314svn5065.el7 will be installed
--> Finished Dependency Resolution
http://public-yum.oracle.com/repo/OracleLinux/OL7/UEKR3/x86_64/repodata/repomd.xml: [Errno 14] curl#6 - "Could not resolve host: public-yum.oracle.com; Unknown error"
Trying other mirror.
http://public-yum.oracle.com/repo/OracleLinux/OL7/latest/x86_64/repodata/repomd.xml: [Errno 14] curl#6 - "Could not resolve host: public-yum.oracle.com; Unknown error"
Trying other mirror.

Dependencies Resolved

=======================================================================================================================================================================
 Package                     Arch               Version                                      Repository                                                           Size
=======================================================================================================================================================================
Installing:
 tigervnc-server             x86_64             1.2.80-0.30.20130314svn5065.el7              /tigervnc-server-1.2.80-0.30.20130314svn5065.el7.x86_64             488 k

Transaction Summary
=======================================================================================================================================================================
Install  1 Package

Total size: 488 k
Installed size: 488 k
Downloading packages:
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : tigervnc-server-1.2.80-0.30.20130314svn5065.el7.x86_64                                                                                              1/1
  Verifying  : tigervnc-server-1.2.80-0.30.20130314svn5065.el7.x86_64                                                                                              1/1

Installed:
  tigervnc-server.x86_64 0:1.2.80-0.30.20130314svn5065.el7

Complete!

2.配置vncserver,之前的版本,如果安装vnc一般都需要使用vncserver命令来设置口令,然后配置/etc/sysconfig/vncservers文件。在Oracle Linux7中,虽然然还存在这个文件,不过其内容只有如下一行:

[root@oracle12c /]# cat /etc/sysconfig/vncservers
# THIS FILE HAS BEEN REPLACED BY /lib/systemd/system/vncserver@.service

先来看一下该文件/lib/systemd/system/vncserver@.service的内容

[root@oracle12c system]# cat /lib/systemd/system/vncserver@.service
# The vncserver service unit file
#
# Quick HowTo:
# 1. Copy this file to /etc/systemd/system/vncserver@:.service
# 2. Edit  and vncserver parameters appropriately
#   ("runuser -l <USER> -c /usr/bin/vncserver %i -arg1 -arg2")
# 3. Run `systemctl daemon-reload`
# 4. Run `systemctl enable vncserver@:.service`
#
# DO NOT RUN THIS SERVICE if your local area network is
# untrusted!  For a secure way of using VNC, you should
# limit connections to the local host and then tunnel from
# the machine you want to view VNC on (host A) to the machine
# whose VNC output you want to view (host B)
#
# [user@hostA ~]$ ssh -v -C -L 590N:localhost:590M hostB
#
# this will open a connection on port 590N of your hostA to hostB's port 590M
# (in fact, it ssh-connects to hostB and then connects to localhost (on hostB).
# See the ssh man page for details on port forwarding)
#
# You can then point a VNC client on hostA at vncdisplay N of localhost and with
# the help of ssh, you end up seeing what hostB makes available on port 590M
#
# Use "-nolisten tcp" to prevent X connections to your VNC server via TCP.
#
# Use "-localhost" to prevent remote VNC clients connecting except when
# doing so through a secure tunnel.  See the "-via" option in the
# `man vncviewer' manual page.


[Unit]
Description=Remote desktop service (VNC)
After=syslog.target network.target

[Service]
Type=forking
# Clean any existing files in /tmp/.X11-unix environment
ExecStartPre=/bin/sh -c '/usr/bin/vncserver -kill %i > /dev/null 2>&1 || :'
ExecStart=/sbin/runuser -l <USER> -c "/usr/bin/vncserver %i"
PIDFile=/home/<USER>/.vnc/%H%i.pid
ExecStop=/bin/sh -c '/usr/bin/vncserver -kill %i > /dev/null 2>&1 || :'

[Install]
WantedBy=multi-user.target

从上面的可以看到如下信息,这给出了操作步骤。1:是将该文件复制一份到/etc/systemd/system目录下并命名为vncserver@:.service;2:是将<USER>替换成你要开启vncserver的用户名;3:是执行systemctl daemon-reload;4:是执行systemctl enable vncserver@:.service来启动vncserver服务。

# 1. Copy this file to /etc/systemd/system/vncserver@:.service
# 2. Edit  and vncserver parameters appropriately
#   ("runuser -l <USER> -c /usr/bin/vncserver %i -arg1 -arg2")
# 3. Run `systemctl daemon-reload`
# 4. Run `systemctl enable vncserver@:.service`

首先复制文件:

[root@oracle12c system]# cp /lib/systemd/system/vncserver@.service /etc/systemd/system/vncserver@:1.service

[root@oracle12c /]# cd /etc/systemd/system
[root@oracle12c system]# ls -lrt vnc*
-rw-r--r--. 1 root root 1744 Mar 28 10:47 vncserver@:1.service

编辑vncserver@:1.service文件将文件中的用root替换
修改前的内容如下:

[root@oracle12c system]# cat /lib/systemd/system/vncserver@.service
# The vncserver service unit file
#
# Quick HowTo:
# 1. Copy this file to /etc/systemd/system/vncserver@:.service
# 2. Edit  and vncserver parameters appropriately
#   ("runuser -l <USER> -c /usr/bin/vncserver %i -arg1 -arg2")
# 3. Run `systemctl daemon-reload`
# 4. Run `systemctl enable vncserver@:.service`
#
# DO NOT RUN THIS SERVICE if your local area network is
# untrusted!  For a secure way of using VNC, you should
# limit connections to the local host and then tunnel from
# the machine you want to view VNC on (host A) to the machine
# whose VNC output you want to view (host B)
#
# [user@hostA ~]$ ssh -v -C -L 590N:localhost:590M hostB
#
# this will open a connection on port 590N of your hostA to hostB's port 590M
# (in fact, it ssh-connects to hostB and then connects to localhost (on hostB).
# See the ssh man page for details on port forwarding)
#
# You can then point a VNC client on hostA at vncdisplay N of localhost and with
# the help of ssh, you end up seeing what hostB makes available on port 590M
#
# Use "-nolisten tcp" to prevent X connections to your VNC server via TCP.
#
# Use "-localhost" to prevent remote VNC clients connecting except when
# doing so through a secure tunnel.  See the "-via" option in the
# `man vncviewer' manual page.


[Unit]
Description=Remote desktop service (VNC)
After=syslog.target network.target

[Service]
Type=forking
# Clean any existing files in /tmp/.X11-unix environment
ExecStartPre=/bin/sh -c '/usr/bin/vncserver -kill %i > /dev/null 2>&1 || :'
ExecStart=/sbin/runuser -l <USER> -c "/usr/bin/vncserver %i"
PIDFile=/home/<USER>/.vnc/%H%i.pid
ExecStop=/bin/sh -c '/usr/bin/vncserver -kill %i > /dev/null 2>&1 || :'

[Install]
WantedBy=multi-user.target


修改后的内容如下:

[root@oracle12c system]# vi vncserver@:1.service
# The vncserver service unit file
#
# Quick HowTo:
# 1. Copy this file to /etc/systemd/system/vncserver@:.service
# 2. Edit  and vncserver parameters appropriately
#   ("runuser -l <USER> -c /usr/bin/vncserver %i -arg1 -arg2")
# 3. Run `systemctl daemon-reload`
# 4. Run `systemctl enable vncserver@:.service`
#
# DO NOT RUN THIS SERVICE if your local area network is
# untrusted!  For a secure way of using VNC, you should
# limit connections to the local host and then tunnel from
# the machine you want to view VNC on (host A) to the machine
# whose VNC output you want to view (host B)
#
# [user@hostA ~]$ ssh -v -C -L 590N:localhost:590M hostB
#
# this will open a connection on port 590N of your hostA to hostB's port 590M
# (in fact, it ssh-connects to hostB and then connects to localhost (on hostB).
# See the ssh man page for details on port forwarding)
#
# You can then point a VNC client on hostA at vncdisplay N of localhost and with
# the help of ssh, you end up seeing what hostB makes available on port 590M
#
# Use "-nolisten tcp" to prevent X connections to your VNC server via TCP.
#
# Use "-localhost" to prevent remote VNC clients connecting except when
# doing so through a secure tunnel.  See the "-via" option in the
# `man vncviewer' manual page.


[Unit]
Description=Remote desktop service (VNC)
After=syslog.target network.target

[Service]
Type=simple
# Clean any existing files in /tmp/.X11-unix environment
ExecStartPre=/bin/sh -c '/usr/bin/vncserver -kill :1 > /dev/null 2>&1 || :'
ExecStart=/sbin/runuser -l root -c "/usr/bin/vncserver :1"
PIDFile=/root/.vnc/%H:1.pid
ExecStop=/bin/sh -c '/usr/bin/vncserver -kill :1 > /dev/null 2>&1 || :'

[Install]
WantedBy=multi-user.target

这里重点要注意的是Type的值要修改为simple,不能用原来的forking,否则会在执行systemctl start vncserver@:1.service时出现问题,故障信息如下:

[root@oracle12c system]# systemctl start vncserver@:1.service
Job for vncserver@:1.service failed. See 'systemctl status vncserver@:1.service' and 'journalctl -xn' for details.
[root@oracle12c system]# systemctl status vncserver@:1.service
vncserver@:1.service - Remote desktop service (VNC)
   Loaded: loaded (/etc/systemd/system/vncserver@:1.service; enabled)
   Active: failed (Result: resources) since Mon 2016-03-28 10:57:03 CST; 26s ago
  Process: 11898 ExecStart=/sbin/runuser -l root -c /usr/bin/vncserver %i (code=exited, status=0/SUCCESS)
  Process: 11895 ExecStartPre=/bin/sh -c /usr/bin/vncserver -kill %i > /dev/null 2>&1 || : (code=exited, status=0/SUCCESS)

3.设置远程登陆的密码
操作系统登陆,执行vncpasswd,注意这个密码不一定与操作系统登陆的密码一致,需要远程桌面的所有的账号,都需要设置一次。

[root@oracle12c /]# vncpasswd root
Password:
Verify:

4.设置vncserver 为自启动

[root@oracle12c system]# systemctl daemon-reload
[root@oracle12c system]# systemctl enable vncserver@:1.service
[root@oracle12c system]# systemctl start vncserver@:1.service
[root@oracle12c system]# systemctl status vncserver@:1.service
vncserver@:1.service - Remote desktop service (VNC)
   Loaded: loaded (/etc/systemd/system/vncserver@:1.service; enabled)
   Active: active (running) since Mon 2016-03-28 13:14:47 CST; 14min ago
  Process: 7237 ExecStop=/bin/sh -c /usr/bin/vncserver -kill :1 > /dev/null 2>&1 || : (code=exited, status=0/SUCCESS)
  Process: 9030 ExecStartPre=/bin/sh -c /usr/bin/vncserver -kill :1 > /dev/null 2>&1 || : (code=exited, status=0/SUCCESS)
 Main PID: 9080 (Xvnc)
   CGroup: /system.slice/system-vncserver.slice/vncserver@:1.service
           鈥9080 /usr/bin/Xvnc :1 -desktop oracle12c:1 (root) -auth /root/.Xauthority -geometry 1024x768 -rfbwait 30000 -rfbauth /root/.vnc/passwd -rfbport 5901 -f...

Mar 28 13:14:47 oracle12c systemd[1]: Started Remote desktop service (VNC).

[root@oracle12c system]# systemctl stop vncserver@:1.service
[root@oracle12c system]# systemctl status vncserver@:1.service
vncserver@:1.service - Remote desktop service (VNC)
   Loaded: loaded (/etc/systemd/system/vncserver@:1.service; enabled)
   Active: inactive (dead) since Mon 2016-03-28 13:31:08 CST; 12s ago
  Process: 10703 ExecStop=/bin/sh -c /usr/bin/vncserver -kill :1 > /dev/null 2>&1 || : (code=exited, status=0/SUCCESS)
  Process: 9080 ExecStart=/sbin/runuser -l root -c /usr/bin/vncserver :1 (code=exited, status=0/SUCCESS)
  Process: 9030 ExecStartPre=/bin/sh -c /usr/bin/vncserver -kill :1 > /dev/null 2>&1 || : (code=exited, status=0/SUCCESS)
 Main PID: 9080 (code=exited, status=0/SUCCESS)

Mar 28 13:14:47 oracle12c systemd[1]: Started Remote desktop service (VNC).
Mar 28 13:31:08 oracle12c systemd[1]: Stopping Remote desktop service (VNC)...
Mar 28 13:31:08 oracle12c systemd[1]: Stopped Remote desktop service (VNC).
[root@oracle12c system]# systemctl start vncserver@:1.service
[root@oracle12c system]# systemctl status vncserver@:1.service
vncserver@:1.service - Remote desktop service (VNC)
   Loaded: loaded (/etc/systemd/system/vncserver@:1.service; enabled)
   Active: active (running) since Mon 2016-03-28 13:31:29 CST; 7s ago
  Process: 10703 ExecStop=/bin/sh -c /usr/bin/vncserver -kill :1 > /dev/null 2>&1 || : (code=exited, status=0/SUCCESS)
  Process: 10733 ExecStartPre=/bin/sh -c /usr/bin/vncserver -kill :1 > /dev/null 2>&1 || : (code=exited, status=0/SUCCESS)
 Main PID: 10783 (Xvnc)
   CGroup: /system.slice/system-vncserver.slice/vncserver@:1.service
           鈥10783 /usr/bin/Xvnc :1 -desktop oracle12c:1 (root) -auth /root/.Xauthority -geometry 1024x768 -rfbwait 30000 -rfbauth /root/.vnc/passwd -rfbport 5901 -...

Mar 28 13:31:29 oracle12c systemd[1]: Starting Remote desktop service (VNC)...
Mar 28 13:31:29 oracle12c systemd[1]: Started Remote desktop service (VNC).

5.关闭Oracle Linux的防火墙
root用户执行操作
查看防火墙状态。

[root@oracle12c tmp]# systemctl status firewalld
firewalld.service - firewalld - dynamic firewall daemon
   Loaded: loaded (/usr/lib/systemd/system/firewalld.service; enabled)
   Active: active (running) since Mon 2016-03-28 14:51:40 CST; 6s ago
 Main PID: 14827 (firewalld)
   CGroup: /system.slice/firewalld.service
           14827 /usr/bin/python -Es /usr/sbin/firewalld --nofork --nopid

临时关闭防火墙命令。重启电脑后,防火墙自动起来。
[root@oracle12c tmp]# systemctl stop firewalld

永久关闭防火墙命令。重启后,防火墙不会自动启动。
[root@oracle12c tmp]# systemctl disable firewalld
rm ‘/etc/systemd/system/basic.target.wants/firewalld.service’
rm ‘/etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service’

6.使用vnc viewer进行远程连接

AIX JFS2 Filesystem Concurrent Mount Protection 0506-365 Failure

朋友帮助客户通过复制来创建数据库副本来做测试,操作系统AIX,存储是V7000,使用了存储子系统的FlashCopy来进行复制,FlashCopy是IBM ESS存储服务器所支持的功能之一,主要用于本地的备份和恢复。FlashCopy在某一时间点t0建立源LUN和目标LUN之间的对应关系,随后源LUN数据块(512字节)的更新会将源LUN数据块更新前的原始数据拷贝到目标LUN中。FlashCopy可以保存系统在t-时间的数据映像,如果在T0时间系统中的数据是完整和一致的,那么在目标LUN中的数据就可以用于系统的备份和恢复。但在加载目标LUN对应文件系统时出现了故障,故障信息如下:

#mount /oracle/EP1/origlogB
mount: /dev/origlogBlv on /oracle/EP1/origlogB
0506-365 Cannot mount guarded filesystem.
The filesystem is potentially mounted on another node.

虽然AIX PowerHA可以并发访问多个系统中的卷组,但在多个节点同时mount JFS2文件系统将会造成文件系统损坏。当系统检测到文件系统中的数据或元数据与内存中的文件系统状态冲突时,这些同时mount事件也可能会造成系统崩溃。唯一的例外就是mount只读文件系统,文件或目录不会被改变。

在AIX 7100-01 and 6100-07引入了一个叫作”Mount Guard”的特性用来阻止同进或并发mount相同文件系统。如果一个文件系统已经被mount到另一个节点,那么这个功能就会被启用。AIX将会阻止这个文件系统被mount到其它节点。Mount Guard缺省情况下是没有启用的,但可以通过系统管理员进行配置。但不允许对基本操作系统的文件系统,比如/,/usr,/var等进行设置。

启用Mount Guard
为了对一个文件系统永久启用Mount Guard可以编辑/usr/sbin/chfs:

# chfs -a mountguard=yes /mountpoint

/mountpoint现在就处于保护状态并阻止并发mount。这个选项也可以在创建文件系统是给crfs使用。

# chfs -a mountguard=no /mountpoint

/mountpoint将不再受保护也不会阻止并发mount。

为了判断一个文件系统的mount guard状态,执行以下命令:

# lsfs -q /mountpoint
Name            Nodename   Mount Pt               VFS   Size    Options    Auto Accounting
/dev/fslv34     --         /mountpoint            jfs2  4194304 rw         no   no
  (lv size: 4194304, fs size: 4194304, block size: 4096, sparse files: yes, inline log: no, inline log size: 0, EAformat: v1, Quota: no, DMAPI: no, VIX: yes, EFS: no, ISNAPSHOT: no, MAXEXT: 0, MountGuard: yes)

执行/usr/sbin/mount命令将不会显示mount guard状态。

文件系统的mount与mount guard
当一个受保护的文件系统被并发mount时,第二个mount操作将会出现以下错误信息:

# mount /mountpoint
mount: /dev/fslv34 on /mountpoint:
Cannot mount guarded filesystem.
The filesystem is potentially mounted on another node

在系统崩溃后文件系统可能仍然保留了mount启用标识并且拒绝被mount。在这种情况下可以通过有
“noguard”选项的mount命令来临时覆盖文件系统的guard状态。

# mount -o noguard /mountpoint
mount: /dev/fslv34 on /mountpoint:
Mount guard override for filesystem.
The filesystem is potentially mounted on another node.

这里因为使用flashcopy技术来备份数据是通过复制LUN来完成的,也就复制了文件系统,而原来的文
件系统启用了mount guard,所以在mount目标文件系统现在有两种方法:
1.禁用目标文件系统的mount guard特性
2.使用mount -o noguard来临时覆盖mount guard特性