linux/unix – 但行好事 莫问前程 http://www.jydba.net Mon, 23 Dec 2024 09:00:28 +0000 zh-CN hourly 1 https://wordpress.org/?v=4.9.10 在Oracle Linux 7.1上安装Docker http://www.jydba.net/index.php/archives/2677 http://www.jydba.net/index.php/archives/2677#respond Mon, 10 Jun 2019 09:27:33 +0000 http://www.jydba.net/?p=2677 在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

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

]]>
http://www.jydba.net/index.php/archives/2677/feed 0
Oracle Linux 7设置中文字符集 http://www.jydba.net/index.php/archives/2561 http://www.jydba.net/index.php/archives/2561#respond Thu, 25 Oct 2018 08:44:52 +0000 http://www.jydba.net/?p=2561 常安装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=
]]>
http://www.jydba.net/index.php/archives/2561/feed 0
Oracle Linux 7 Configure DNS http://www.jydba.net/index.php/archives/2141 http://www.jydba.net/index.php/archives/2141#respond Fri, 17 Mar 2017 10:44:52 +0000 http://www.jydba.net/?p=2141 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

]]>
http://www.jydba.net/index.php/archives/2141/feed 0
Oracle Linux 7.1 增加网卡及IP配置 http://www.jydba.net/index.php/archives/2133 http://www.jydba.net/index.php/archives/2133#respond Thu, 16 Mar 2017 03:55:49 +0000 http://www.jydba.net/?p=2133 由于需要给虚拟机(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

配置完成

]]>
http://www.jydba.net/index.php/archives/2133/feed 0
How to Change hostname in Oracle Linux 7 http://www.jydba.net/index.php/archives/2081 http://www.jydba.net/index.php/archives/2081#respond Tue, 07 Mar 2017 09:01:30 +0000 http://www.jydba.net/?p=2081 在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)

]]>
http://www.jydba.net/index.php/archives/2081/feed 0
How to Set Device Name Using UDEV on Oracle Linux 7.1 http://www.jydba.net/index.php/archives/1951 http://www.jydba.net/index.php/archives/1951#respond Thu, 15 Dec 2016 12:29:43 +0000 http://www.jydba.net/?p=1951 这篇文章主要介绍在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
]]>
http://www.jydba.net/index.php/archives/1951/feed 0
Linux 格式化分区 报错Could not stat /dev/sda3 — No such file or directory http://www.jydba.net/index.php/archives/1827 http://www.jydba.net/index.php/archives/1827#respond Wed, 11 May 2016 09:12:08 +0000 http://www.jydba.net/?p=1827 执行分区过程如下:
[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

]]>
http://www.jydba.net/index.php/archives/1827/feed 0
Oracle Linux 7禁用Transparent HugePages http://www.jydba.net/index.php/archives/1762 http://www.jydba.net/index.php/archives/1762#respond Tue, 29 Mar 2016 03:48:27 +0000 http://www.jydba.net/?p=1762 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]

]]>
http://www.jydba.net/index.php/archives/1762/feed 0
Oracle Linux 7配置vncserver http://www.jydba.net/index.php/archives/1758 http://www.jydba.net/index.php/archives/1758#respond Mon, 28 Mar 2016 07:13:55 +0000 http://www.jydba.net/?p=1758 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进行远程连接

]]>
http://www.jydba.net/index.php/archives/1758/feed 0
AIX JFS2 Filesystem Concurrent Mount Protection 0506-365 Failure http://www.jydba.net/index.php/archives/1652 http://www.jydba.net/index.php/archives/1652#respond Thu, 17 Sep 2015 15:50:45 +0000 http://www.jydba.net/?p=1652 朋友帮助客户通过复制来创建数据库副本来做测试,操作系统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特性

]]>
http://www.jydba.net/index.php/archives/1652/feed 0
Redhat linux DNS配置指南 http://www.jydba.net/index.php/archives/1646 http://www.jydba.net/index.php/archives/1646#respond Tue, 25 Aug 2015 10:53:26 +0000 http://www.jydba.net/?p=1646 在oracle 11g的RAC中增加了SCAN IP,而使用 SCAN IP的一种方式就是使用DNS,这里介绍在Redhat Linux 5.4中DNS的详细配置操作
在配置DNS之前修改主机名
Redhat linux 5.4 DNS配置操作
在配置DNS之前修改主机名

[root@beiku1 etc]# hostname beiku1.sbyy.com
[root@beiku1 etc]# vi /etc/hosts
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1               beiku1.sbyy.com localhost
::1             localhost6.localdomain6 localhost6
10.138.130.161 beiku1

[root@beiku1 etc]# vi /etc/sysconfig/network
NETWORKING=yes
NETWORKING_IPV6=no
HOSTNAME=beiku1.sbyy.com
GATEWAY=10.138.130.254

一.安装软件包
Redhat linux 5.4 下的dns服务所有的bind包如下:

bind-9.3.6-4.P1.el5 
bind-libbind-devel-9.3.6-4.P1.el5 
kdebindings-devel-3.5.4-6.el5 
kdebindings-3.5.4-6.el5 
bind-devel-9.3.6-4.P1.el5 
bind-utils-9.3.6-4.P1.el5 
bind-chroot-9.3.6-4.P1.el5 
ypbind-1.19-12.el5 
system-config-bind-4.0.3-4.el5 
bind-libs-9.3.6-4.P1.el5 
bind-sdb-9.3.6-4.P1.el5 

使用rpm –qa | grep bind来检查系统是否已经安装了以上软件包:

[root@beiku1 soft]# rpm -qa | grep bind
bind-chroot-9.3.6-4.P1.el5
kdebindings-3.5.4-6.el5
ypbind-1.19-12.el5
bind-libs-9.3.6-4.P1.el5
bind-9.3.6-4.P1.el5
system-config-bind-4.0.3-4.el5
bind-utils-9.3.6-4.P1.el5

对于没有安装的软件包执行以下命令进行安装

[root@beiku1 soft]# rpm -ivh bind-9.3.6-4.P1.el5.i386.rpm
warning: bind-9.3.6-4.P1.el5.i386.rpm: Header V3 DSA signature: NOKEY, key ID 37017186
Preparing...                ########################################### [100%]
        package bind-9.3.6-4.P1.el5.i386 is already installed
[root@beiku1 soft]# rpm -ivh caching-nameserver-9.3.6-4.P1.el5.i386.rpm
warning: caching-nameserver-9.3.6-4.P1.el5.i386.rpm: Header V3 DSA signature: NOKEY, key ID 37017186
Preparing...                ########################################### [100%]
   1:caching-nameserver     ########################################### [100%]

[root@beiku1 soft]# rpm -ivh install kdebindings-devel-3.5.4-6.el5.i386.rpm
error: open of install failed: No such file or directory
warning: kdebindings-devel-3.5.4-6.el5.i386.rpm: Header V3 DSA signature: NOKEY, key ID 37017186
[root@beiku1 soft]# rpm -ivh kdebindings-devel-3.5.4-6.el5.i386.rpm
warning: kdebindings-devel-3.5.4-6.el5.i386.rpm: Header V3 DSA signature: NOKEY, key ID 37017186
Preparing...                ########################################### [100%]
   1:kdebindings-devel      ########################################### [100%]
[root@beiku1 soft]# rpm -ivh bind-sdb-9.3.6-4.P1.el5.i386.rpm
warning: bind-sdb-9.3.6-4.P1.el5.i386.rpm: Header V3 DSA signature: NOKEY, key ID 37017186
Preparing...                ########################################### [100%]
   1:bind-sdb               ########################################### [100%]
[root@beiku1 soft]# rpm -ivh bind-libbind-devel-9.3.6-4.P1.el5.i386.rpm
warning: bind-libbind-devel-9.3.6-4.P1.el5.i386.rpm: Header V3 DSA signature: NOKEY, key ID 37017186
Preparing...                ########################################### [100%]
   1:bind-libbind-devel     ########################################### [100%]
[root@beiku1 soft]# rpm -ivh bind-devel-9.3.6-4.P1.el5.i386.rpm
warning: bind-devel-9.3.6-4.P1.el5.i386.rpm: Header V3 DSA signature: NOKEY, key ID 37017186
Preparing...                ########################################### [100%]
   1:bind-devel             ########################################### [100%]

还要手动安装一个软件包caching-nameserver-9.3.6-4.P1.el5 ,不安装这个软件包named服务不能启动,会报错误信息 例如:

[root@beiku1 ~]# service named start
Locating /var/named/chroot//etc/named.conf failed:
[FAILED]

[root@beiku1 soft]# rpm -ivh caching-nameserver-9.3.6-4.P1.el5.i386.rpm
warning: caching-nameserver-9.3.6-4.P1.el5.i386.rpm: Header V3 DSA signature: NOKEY, key ID 37017186
Preparing...                ########################################### [100%]
   1:caching-nameserver     ########################################### [100%]

[root@beiku1 soft]# service named start
Starting named: [  OK  ]

二.复制模板文件
由于安装了chroot环境,所以我们的DNS主配置文件应该在/var/named/chroot/etc目录下面

[root@beiku1 soft]# cd /var/named/chroot/
[root@beiku1 chroot]# ls
dev  etc  proc  var
[root@beiku1 chroot]# cd etc
[root@beiku1 etc]# ls
localtime  named.caching-nameserver.conf  named.rfc1912.zones  rndc.key
[root@beiku1 etc]#

named.caching-nameserver.conf文件内容如下:

[root@beiku1 etc]# cat named.caching-nameserver.conf
//
// named.caching-nameserver.conf
//
// Provided by Red Hat caching-nameserver 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.
//
// DO NOT EDIT THIS FILE - use system-config-bind or an editor
// to create named.conf - edits to this file will be lost on 
// caching-nameserver package upgrade.
//
options {
        listen-on port 53 { 127.0.0.1; };
        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";

        // Those options should be used carefully because they disable port
        // randomization
        // query-source    port 53;
        // query-source-v6 port 53;

        allow-query     { localhost; };
        allow-query-cache { localhost; };
};
logging {
        channel default_debug {
                file "data/named.run";
                severity dynamic;
        };
};
view localhost_resolver {
        match-clients      { localhost; };
        match-destinations { localhost; };
        recursion yes;
        include "/etc/named.rfc1912.zones";
};

这个文件告诉我们不要直接的编辑这个文件,去创建一个named.conf文件,然后编辑named.conf文件,当有了named.conf,将不在读取这个文件。现在就将named.caching-nameserver.conf文件复制成named.conf文件。

[root@beiku1 etc]# cp -p named.caching-nameserver.conf named.conf
[root@beiku1 etc]# ls
localtime  named.caching-nameserver.conf  named.conf  named.rfc1912.zones  rndc.key

可以看到,named.conf文件就被创建成功了。最好在copy的时候加上-P的参数,保留权限。否则启动服务的时候会报权限拒绝的。

三.编辑named.conf文件

[root@beiku1 etc]# vi named.conf
//
// named.caching-nameserver.conf
//
// Provided by Red Hat caching-nameserver 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.
//
// DO NOT EDIT THIS FILE - use system-config-bind or an editor
// to create named.conf - edits to this file will be lost on
// caching-nameserver package upgrade.
//
options {
        listen-on port 53 { 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";

        // Those options should be used carefully because they disable port
        // randomization
        // query-source    port 53;
        // query-source-v6 port 53;

        allow-query     { 10.138.130.0/24; };
        allow-query-cache { any; };
};
logging {
        channel default_debug {
                file "data/named.run";
                severity dynamic;
        };
};
view localhost_resolver {
        match-clients      { 10.138.130.0/24; };
        match-destinations { any; };
        recursion yes;
        include "/etc/named.rfc1912.zones";
};

解释这些语法参数的意思
options
代表全局配置
listen-on port 53 { any; };
DNS服务监听在所有接口
listen-on-v6 port 53 { ::1; };
ipv6监听在本地回环接口
directory “/var/named”;
zone文件的存放目录,指的是chroot环境下面的/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 { 10.138.130.0/24 };
允许查询的客户端,现在修改成本地网段,
allow-query-cache {any; };
允许那些客户端来查询缓存,any表示允许任何人。
logging {
channel default_debug {
file “data/named.run”;
severity dynamic;
};
定义日志的存放位置在/var/named/chroot/var/named/data/目录下面
};
view localhost_resolver {
match-clients { 10.138.130.0/24; };
match-destinations { any; };
recursion yes;
include “/etc/named.rfc1912.zones”;
};

这里是定义视图的功能,
Match-clients 是指匹配的客户端
Match-destination 是指匹配的目标
到这里,named.conf文件就已经配置成功了,这个视图最后写include “/etc/named.rfc1912.zones”;接下面,就去配置这个文件。当然,我们可以匹配不同的客户端来创建不同的视图。

四.定义zone文件

[root@beiku1 etc]# vi  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
// 
// See /usr/share/doc/bind*/sample/ for example named configuration files.
//
zone "." IN {
        type hint;
        file "named.ca";
};

zone "sbyy.com" IN {
        type master;
        file "sbyy.zone";
        allow-update { none; };
};

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

解释这些语法参数的意思
Zone “.” 根区域
Zone “sbyy.com” 定义正向解析的区域
zone “130.138.10.in-addr.arpa” 定义反向解析的区域
IN Internet记录
type hint 根区域的类型为hint
type master 区域的类型为主要的
file “named.ca” ; 区域文件是named,ca
file “sbyy.zone”; 指定正向解析的区域文件是sbyy.zone
file “named.sbyy”; 指定反向解析的区域文件是named,sbyy
allow-update { none; }; 默认情况下,是否允许客户端自动更新
在named.ca文件中就定义了全球的13台根服务器,
在sbyy.com文件中就定义DNS的正向解析数据库
在named.sbyy文件中就定义DNS反向解析的数据库
定义zone文件就完成了,下面来编辑DNS的数据库文件。

五.使用模板文件来创建数据库文件

[root@beiku1 etc]# cd /var/named/chroot/var/named/
[root@beiku1 named]# ls
data  localdomain.zone  localhost.zone  named.broadcast  named.ca  named.ip6.local  named.local  named.zero  slaves

可以看到,在chroot环境下面的/var/named/有很多模板文件。Named.ca就是根区域的数据库文件,我们将localhost.zone复制成sbyy.zone,这个是正向解析的数据库文件,将named.local复制成named.sbyy,这个是反向解析的数据库文件。数据库文件一定要和/etc/named.rfc1912.zones这个文件里面的匹配。

[root@beiku1 named]# cp -p localhost.zone sbyy.zone
[root@beiku1 named]# cp -p named.local named.sbyy
[root@beiku1 named]# ls 
data              named.broadcast  named.local  sbyy.zone
localdomain.zone  named.ca         named.sbyy   slaves
localhost.zone    named.ip6.local  named.zero

复制成功,正向解析和反向解析的数据库文件就创建完成了。

六.定义数据库文件
1. 定义正向解析数据库文件

[root@beiku1 named]# vi sbyy.zone
$TTL    86400
@               IN SOA  beiku1.sbyy.com.       root.sbyy.com. (
                                        44              ; serial (d. adams)
                                        3H              ; refresh
                                        15M              ; retry
                                        1W              ; expiry
                                        1D )            ; minimum

@              IN NS           beiku1.sbyy.com.


beikuscan      IN A            10.138.130.167
beikuscan      IN A            10.138.130.168
beikuscan      IN A            10.138.130.169
beiku2         IN A            10.138.130.162
beiku1         IN A            10.138.130.161

关于正向解析数据库中每一行参数的解释
$TTL 86400
最小的存活的时间是86400S(24H)

@ IN SOA @ root (
这是一笔SOA记录,只允许存在一个SOA记录
@是代表要解析的这个域本身()
IN是Internet记录。
SOA 是初始授权记录,指定网络中第一台DNS Server。
root是指管理员的邮箱。

44 ; serial (d. adams)
3H ; refresh
15M ; retry
1W ; expiry
1D ) ; minimum

这些部分主要是用来主DNS和辅助DNS做同步用的
44 序列号,当主DNS数据改变时,这个序列号就要被增加1,而辅助DNS通过序列号来和主DNS同步。
3H 刷新,主DNS和辅助DNS每隔三小时同步一次。
15M 重试,3H之内,没有同步,每隔15M在尝试同步
1W 过期,1W之内,还没有同步,就不同步了
1D 生存期,没有这条记录,缓存的时间。
@ IN NS beiku1.sbyy.com.

这是一笔NS记录,指定nameserver为beiku1.sbyy.com至少要有一笔NS记录

beiku1 IN A 10.138.130.161
指定beiku1的ip地址为10.138.130.161

beikuscan IN A 10.138.130.167
指定beikuscan的ip地址为10.138.130.167

beikuscan IN A 10.138.130.168
指定beikuscan的ip地址为10.138.130.168

beikuscan IN A 10.138.130.169
指定beikuscan的ip地址为10.138.130.169
beiku2 IN A 10.138.130.162
指定beiku2的ip地址为10.138.130.162

正向解析的数据库就完成了,下面定义反向解析的数据库。

2. 定义反向解析数据库

[root@beiku1 named]# vi named.sbyy
$TTL    86400
@       IN      SOA     beiku1.sbyy.com. root.sbyy.com.  (
                                      1997022702 ; Serial
                                      120      ; Refresh
                                      120      ; Retry
                                      3600000    ; Expire
                                      86400 )    ; Minimum
@        IN      NS     beiku1.sbyy.com.

167     IN      PTR     beikuscan.sbyy.com.
168     IN      PTR     beikuscan.sbyy.com.
169     IN      PTR     beikuscan.sbyy.com.
162     IN      PTR     beiku2.sbyy.com. 
161     IN      PTR     beiku1.sbyy.com.

其实反向解析的数据库文件的配置和正向解析的差不多,只需要将ip地址和域名换一个位置就可以了,把A换成PTR就ok了。
DNS的基本配置就完成了,在来看看DNS是否能够正常工作。
我们先重启一下DNS服务

[root@beiku1 etc]# service named restart
Stopping named: [  OK  ]
Starting named: [  OK  ]

可以看到,DNS服务启动成功了。
在查询以前,要在客户端来指定DNS Server,在/etc/resolv.conf这个文件中指定。

[root@beiku1 etc]# vi /etc/resolv.conf
search sbyy.com
nameserver       10.138.130.161


[root@beiku1 etc]# service named restart
Stopping named: [  OK  ]
Starting named: [  OK  ]

参数及意义:
nameserver 表明dns 服务器的ip 地址,可以有很多行的nameserver,每一个带一个ip地址。
在查询时就按nameserver 在本文件中的顺序进行,且只有当第一个nameserver 没有反应时才查询下面的nameserver.
domain 声明主机的域名。很多程序用到它,如邮件系统;当为没有域名的主机进行dns 查询时,也要用到。如果没有域名,主机名将被使,用删除所有在第一个点( . )前面的内容。
search 它的多个参数指明域名查询顺序。当要查询没有域名的主机,主机将在由search 声明的域中分别查找。
domain 和search 不能共存;如果同时存在,后面出现的将会被使用。
sortlist 允许将得到域名结果进行特定的排序。它的参数为网络/掩码对,允许任意的排列顺序。

再来使用nslookup工具来查询一下

[root@beiku1 named]# nslookup beiku1.sbyy.com
Server:         10.138.130.161
Address:        10.138.130.161#53

Name:   beiku1.sbyy.com
Address: 10.138.130.161

[root@beiku1 named]# nslookup beiku2.sbyy.com
Server:         10.138.130.161
Address:        10.138.130.161#53

Name:   beiku2.sbyy.com
Address: 10.138.130.162

[root@beiku1 named]# nslookup beikuscan.sbyy.com
Server:         10.138.130.161
Address:        10.138.130.161#53

Name:   beikuscan.sbyy.com
Address: 10.138.130.169
Name:   beikuscan.sbyy.com
Address: 10.138.130.167
Name:   beikuscan.sbyy.com
Address: 10.138.130.168

[root@beiku1 named]# nslookup beiku1
Server:         10.138.130.161
Address:        10.138.130.161#53

Name:   beiku1.sbyy.com
Address: 10.138.130.161

[root@beiku1 named]# nslookup beiku2
Server:         10.138.130.161
Address:        10.138.130.161#53

Name:   beiku2.sbyy.com
Address: 10.138.130.162

[root@beiku1 named]# nslookup beikuscan
Server:         10.138.130.161
Address:        10.138.130.161#53

Name:   beikuscan.sbyy.com
Address: 10.138.130.168
Name:   beikuscan.sbyy.com
Address: 10.138.130.169
Name:   beikuscan.sbyy.com
Address: 10.138.130.167

[root@beiku1 named]# nslookup 10.138.130.161
Server:         10.138.130.161
Address:        10.138.130.161#53

161.130.138.10.in-addr.arpa     name = beiku1.sbyy.com.

[root@beiku1 named]# nslookup 10.138.130.162
Server:         10.138.130.161
Address:        10.138.130.161#53

162.130.138.10.in-addr.arpa     name = beiku2.sbyy.com.

[root@beiku1 named]# nslookup 10.138.130.167
Server:         10.138.130.161
Address:        10.138.130.161#53

167.130.138.10.in-addr.arpa     name = beikuscan.sbyy.com.

[root@beiku1 named]# nslookup 10.138.130.168
Server:         10.138.130.161
Address:        10.138.130.161#53

168.130.138.10.in-addr.arpa     name = beikuscan.sbyy.com.

[root@beiku1 named]# nslookup 10.138.130.169
Server:         10.138.130.161
Address:        10.138.130.161#53

169.130.138.10.in-addr.arpa     name = beikuscan.sbyy.com.

可以看到,DNS解析一切正常,上面只是配置了主DNS服务器,而且主DNS服务器也工作正常,现在我们来配置一个辅助DNS服务器

配置辅助DNS服务器
主DNS的东西和辅助DNS东西其实是相同的
一.安装软件包

 [root@beiku2 soft]# rpm -qa | grep bind
bind-chroot-9.3.6-4.P1.el5
kdebindings-3.5.4-6.el5
system-config-bind-4.0.3-4.el5
ypbind-1.19-12.el5
bind-libs-9.3.6-4.P1.el5
bind-9.3.6-4.P1.el5
bind-utils-9.3.6-4.P1.el5
[root@beiku2 soft]# rpm -ivh kdebindings-devel-3.5.4-6.el5.i386.rpm
warning: kdebindings-devel-3.5.4-6.el5.i386.rpm: Header V3 DSA signature: NOKEY, key ID 37017186
Preparing...                ########################################### [100%]
   1:kdebindings-devel      ########################################### [100%]
[root@beiku2 soft]# rpm -ivh caching-nameserver-9.3.6-4.P1.el5.i386.rpm
warning: caching-nameserver-9.3.6-4.P1.el5.i386.rpm: Header V3 DSA signature: NOKEY, key ID 37017186
Preparing...                ########################################### [100%]
   1:caching-nameserver     ########################################### [100%]
[root@beiku2 soft]# rpm -ivh bind-sdb-9.3.6-4.P1.el5.i386.rpm
warning: bind-sdb-9.3.6-4.P1.el5.i386.rpm: Header V3 DSA signature: NOKEY, key ID 37017186
Preparing...                ########################################### [100%]
   1:bind-sdb               ########################################### [100%]
[root@beiku2 soft]# rpm -ivh bind-libbind-devel-9.3.6-4.P1.el5.i386.rpm
warning: bind-libbind-devel-9.3.6-4.P1.el5.i386.rpm: Header V3 DSA signature: NOKEY, key ID 37017186
Preparing...                ########################################### [100%]
   1:bind-libbind-devel     ########################################### [100%]
[root@beiku2 soft]# rpm -ivh bind-devel-9.3.6-4.P1.el5.i386.rpm
warning: bind-devel-9.3.6-4.P1.el5.i386.rpm: Header V3 DSA signature: NOKEY, key ID 37017186
Preparing...                ########################################### [100%]
   1:bind-devel             ########################################### [100%]

二.复制模板文件

[root@beiku2 /]# cd /var/named/chroot/etc
[root@beiku2 etc]# ls -lrt
total 24
-rw-r--r-- 1 root root  3519 Feb 27  2006 localtime
-rw-r----- 1 root named  955 Jul 30  2009 named.rfc1912.zones
-rw-r----- 1 root named 1230 Jul 30  2009 named.caching-nameserver.conf
-rw-r----- 1 root named  113 Nov 15  2014 rndc.key

[root@beiku2 etc]# cp -p named.caching-nameserver.conf named.conf

三.编辑named.conf文件

[root@beiku2 etc]# vi named.conf
//
// named.caching-nameserver.conf
//
// Provided by Red Hat caching-nameserver 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.
//
// DO NOT EDIT THIS FILE - use system-config-bind or an editor
// to create named.conf - edits to this file will be lost on
// caching-nameserver package upgrade.
//
options {
        listen-on port 53 { 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";

        // Those options should be used carefully because they disable port
        // randomization
        // query-source    port 53;
        // query-source-v6 port 53;

        allow-query     { 10.138.130.0/24; };
        allow-query-cache { any; };
};
logging {
        channel default_debug {
                file "data/named.run";
                severity dynamic;
        };
};
view localhost_resolver {
        match-clients      { 10.138.130.0/24; };
        match-destinations { any; };
        recursion yes;
        include "/etc/named.rfc1912.zones";
};

和主DNS配置一样

四.定义zone文件

[root@beiku2 etc]# vi 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
//
// See /usr/share/doc/bind*/sample/ for example named configuration files.
//

zone "sbyy.com" IN {
        type slave;
        masters {10.138.130.161;};
        file "slaves/sbyy.com";
};

zone "0.138.10.in-addr.arpa" IN {
        type slave;
        masters {10.138.130.161;};
        file "slaves/named.sbyy";
};

辅助DNS在定义zone文件的时候和主DNS有些不同
在辅助DNS里面 type要改为slave
master { 10.138.130.161; }; 而且必须指定主DNS的IP address
file “slaves/sbyy.com”;
file “slaves/named.sbyy”;
为什么要指定数据库文件在slaves目录下面呢,是因为slaves目录是拥有人和拥有组都是named用户,在启动DNS服务的时候,只有named有权限进行操作,所以我们要把数据库放在这个目录下面。

[root@beiku2 etc]# cd /var/named/chroot/var/named/
[root@beiku2 named]# ls -lrt
total 44
drwxrwx--- 2 named named 4096 Jul 27  2004 slaves
drwxrwx--- 2 named named 4096 Aug 26  2004 data
-rw-r----- 1 root  named  427 Jul 30  2009 named.zero
-rw-r----- 1 root  named  426 Jul 30  2009 named.local
-rw-r----- 1 root  named  424 Jul 30  2009 named.ip6.local
-rw-r----- 1 root  named 1892 Jul 30  2009 named.ca
-rw-r----- 1 root  named  427 Jul 30  2009 named.broadcast
-rw-r----- 1 root  named  195 Jul 30  2009 localhost.zone
-rw-r----- 1 root  named  198 Jul 30  2009 localdomain.zone
[root@beiku2 named]# cd slaves
[root@beiku2 slaves]# ls -lrt
total 0

可以看到,slaves目录的拥有人和拥有组是named,并且现在的slaves目录下面是什么东西都没有的。
现在我们重启一下DNS服务

[root@beiku2 slaves]# service named restart
Stopping named: [  OK  ]
Starting named: [  OK  ]

可以看到,服务启动成功了。在启动服务的同时,我们来查看一下日志信息,看看日志里面有什么提示

[root@beiku2 slaves]# tail /var/log/messages
Aug 25 23:41:49 beiku2 named[30421]: the working directory is not writable
Aug 25 23:41:49 beiku2 named[30421]: running
Aug 25 23:41:49 beiku2 named[30421]: zone 0.138.10.in-addr.arpa/IN/localhost_resolver: Transfer started.
Aug 25 23:41:49 beiku2 named[30421]: transfer of '0.138.10.in-addr.arpa/IN' from 10.138.130.161#53: connected using 10.138.130.162#44647
Aug 25 23:41:49 beiku2 named[30421]: zone 0.138.10.in-addr.arpa/IN/localhost_resolver: transferred serial 1997022700
Aug 25 23:41:49 beiku2 named[30421]: transfer of '0.138.10.in-addr.arpa/IN' from 10.138.130.161#53: end of transfer
Aug 25 23:41:49 beiku2 named[30421]: zone sbyy.com/IN/localhost_resolver: Transfer started.
Aug 25 23:41:49 beiku2 named[30421]: transfer of 'sbyy.com/IN' from 10.138.130.161#53: connected using 10.138.130.162#56490
Aug 25 23:41:49 beiku2 named[30421]: zone sbyy.com/IN/localhost_resolver: transferred serial 42
Aug 25 23:41:49 beiku2 named[30421]: transfer of 'sbyy.com/IN' from 10.138.130.161#53: end of transfer

在日志里面可以看到,主DNS与辅助DNS正在同步序列号,同步成功,这个日志里面的信息非常的详细。
接下来,我们在到slaves目录下面去看看

[root@beiku2 slaves]# ls -lrt
total 8
-rw-r--r-- 1 named named 414 Aug 25 23:41 sbyy.com
-rw-r--r-- 1 named named 451 Aug 25 23:41 named.sbyy

刚才slaves目录下面的是什么东西都没有,现在就多了两个文件,example.com和named.example这个两个文件。这个就是我们刚才在定义zone文件的时候在slaves目录下面定义的,文件名是随意写的,这个没有关系,但是里面东西是和主DNS一样的。
我们查看这两个文件的具体内容

[root@beiku2 slaves]# cat sbyy.com
$ORIGIN .
$TTL 86400      ; 1 day
sbyy.com                IN SOA  sbyy.com. root.sbyy.com. (
                                42         ; serial
                                10800      ; refresh (3 hours)
                                900        ; retry (15 minutes)
                                604800     ; expire (1 week)
                                86400      ; minimum (1 day)
                                )
                        NS      sbyy.com.
                        A       127.0.0.1
                        AAAA    ::1
$ORIGIN sbyy.com.
beiku1                  A       10.138.130.161
beikuscan1              A       10.138.130.167
beikuscan2              A       10.138.130.168
beikuscan3              A       10.138.130.169
beiku2                  A       10.138.130.162

[root@beiku2 slaves]# cat named.sbyy
$ORIGIN .
$TTL 86400      ; 1 day
0.138.10.in-addr.arpa   IN SOA  localhost. root.localhost. (
                                1997022700 ; serial
                                28800      ; refresh (8 hours)
                                14400      ; retry (4 hours)
                                3600000    ; expire (5 weeks 6 days 16 hours)
                                86400      ; minimum (1 day)
                                )
                        NS      localhost.
$ORIGIN 0.138.10.in-addr.arpa.
1                       PTR     localhost.
161                     PTR     beiku1.sbyy.com
167                     PTR     beikuscan1.sbyy.com
168                     PTR     beikuscan2.sbyy.com
169                     PTR     beikuscan3.sbyy.com
162                     PTR     beiku2.sbyy.com

这两个文件里面的内容和我们的主DNS的内容都是一样的。而且还帮我们整理的非常的漂亮。这些都是系统自动生成的。
现在我们来测试一下主DNS和辅助DNS可不可以正常的工作

[root@beiku2 slaves]# vi /etc/resolv.conf
search sbyy.com
nameserver 10.138.130.161
nameserver 10.138.130.162

现在我们将主DNS和辅助DNS都设置一下。然后在使用nslookup工具来测试

[root@beiku2 slaves]# nslooup beiku1
-bash: nslooup: command not found
[root@beiku2 slaves]# nslookup beiku1
Server:         10.138.130.161
Address:        10.138.130.161#53

Name:   beiku1.sbyy.com
Address: 10.138.130.161

 [root@beiku2 slaves]# nslookup beiku2
Server:         10.138.130.161
Address:        10.138.130.161#53

Name:   beiku2.sbyy.com
Address: 10.138.130.162

现在解析没有问题,还是有10.138.130.161这台主DNS来解析的。
接下来,我们将10.138.130.161这台主DNS给down,看下10.138.130.162这台辅助DNS能否正常工作。

[root@beiku1 named]# service named stop
Stopping named: [  OK  ]

用nslookup来测试一下

[root@beiku2 slaves]# nslookup beiku1
Server:         10.138.130.162
Address:        10.138.130.162#53

Name:   beiku1.sbyy.com
Address: 10.138.130.161

现在解析照样成功了,现在并不是通过10.138.130.161这台主DNS来解析出来的,而是通过我们的10.138.130.162这台辅助DNS来解析出来的。当我们网络中的主DNSdown掉的时候,我们的辅助DNS照样能够正常的工作。我们还可以实现负载均衡,可以在网络中的一半客户端的主DNS指向10.138.130.161,辅助DNS指向10.138.130.161。将网络中的另一半客户端的主DNS指向10.138.130.162,辅助DNS指向10.138.130.161。这样两台服务器都可以正常的工作,正常的为客户端解析,当其中的一台DNSdown掉后,另一台DNS也会继续的工作,这样就实现了简单的负载均衡。到目前为止,我们的主DNS Server 和我们的辅助DNS Server都已经设置成功了,并且都可以正常的工作了。

接下来,我们在做一个试验,我们在主DNS添加一条记录,看下辅助DNS能否检测试到这条记录,不能够在辅助DNS上面添加记录,这样没有意义,我们的主DNS是检测不到这条记录的。

[root@beiku1 named]# vi sbyy.zone
$TTL    86400
@               IN SOA  @       root (
                                        43              ; serial (d. adams)
                                        2M              ; refresh
                                        2M              ; retry
                                        1W              ; expiry
                                        1D )            ; minimum

                IN NS           @
                IN A            127.0.0.1
                IN AAAA         ::1


beiku1          IN A            10.138.130.161
beikuscan      IN A            10.138.130.167
beikuscan      IN A            10.138.130.168
beikuscan      IN A            10.138.130.169
beiku2          IN A            10.138.130.162
www             IN A            10.138.130.170

增加了www IN A 10.138.130.170记录。在主DNS里面做了新的操作以后,一定要将主DNS的序列号加一。否则辅助DNS是不会来同步我们的主DNS的。我们已经将主DNS的序列号加一了,但是默认情况下,主DNS与辅助DNS的同步时间是3H,这样我们很难看到效果,我们将它改为2M,然后在将重试时间改为2M,这样就代表每隔两分钟主DNS和辅助DNS进行同步,如果同步不成功,在隔两分钟同步一次。接下来我们将反向解析里面的也来修改一下

[root@beiku1 named]# vi named.sbyy
$TTL    86400
@       IN      SOA     beiku1.sbyy.com. root.sbyy.com.  (
                                      1997022703 ; Serial
                                      120      ; Refresh
                                      120      ; Retry
                                      3600000    ; Expire
                                      86400 )    ; Minimum
@        IN      NS     beiku1.sbyy.com.

167     IN      PTR     beikuscan.sbyy.com.
168     IN      PTR     beikuscan.sbyy.com.
169     IN      PTR     beikuscan.sbyy.com.
162     IN      PTR     beiku2.sbyy.com.
161     IN      PTR     beiku1.sbyy.com.
170     IN      PTR     www.sbyy.com.

这样,反向解析里面也已经修改完成了。现在将DNS服务重启

[root@beiku1 named]# service named restart
Stopping named: [  OK  ]
Starting named: [  OK  ]

重启成功,等几分钟之后在来看下效果。现在我们查看辅助DNS的正向解析数据库文件的内容

[root@beiku2 slaves]# cat sbyy.com
$ORIGIN .
$TTL 86400      ; 1 day
sbyy.com                IN SOA  beiku1.sbyy.com. root.sbyy.com. (
                                45         ; serial
                                120        ; refresh (2 minutes)
                                120        ; retry (2 minutes)
                                604800     ; expire (1 week)
                                86400      ; minimum (1 day)
                                )
                        NS      beiku1.sbyy.com.
$ORIGIN sbyy.com.
beiku1                  A       10.138.130.161
beiku2                  A       10.138.130.162
beikuscan               A       10.138.130.167
                        A       10.138.130.168
                        A       10.138.130.169
www                     A       10.138.130.170

OK,可以看到,我们刚才在主DNS里面添加的一条新的记录现在已经被辅助DNS同步过去了,而且辅助DNS的序列号和刷新时间,重试时间都同步了。下来我们查看辅助DNS的反向解析数据库文件的内容

[root@beiku2 slaves]# cat named.sbyy
RIGIN .
$TTL 86400      ; 1 day
0.138.10.in-addr.arpa   IN SOA  localhost. root.localhost. (
                                1997022702 ; serial
                                28800      ; refresh (8 hours)
                                14400      ; retry (4 hours)
                                3600000    ; expire (5 weeks 6 days 16 hours)
                                86400      ; minimum (1 day)
                                )
                        NS      localhost.
$ORIGIN 0.138.10.in-addr.arpa.
1                       PTR     localhost.
161                     PTR     beiku1.sbyy.com
167                     PTR     beikuscan1.sbyy.com
168                     PTR     beikuscan2.sbyy.com
169                     PTR     beikuscan3.sbyy.com
162                     PTR     beiku2.sbyy.com
170                     PTR     www.sbyy.com

OK,也可以看到,辅助DNS也已经同步成功了,到此DNS的配置就完成了。

]]>
http://www.jydba.net/index.php/archives/1646/feed 0
HP服务器控制台输出设置造成的启动故障 http://www.jydba.net/index.php/archives/1535 http://www.jydba.net/index.php/archives/1535#comments Tue, 12 May 2015 07:17:05 +0000 http://www.jydba.net/?p=1535 今天单位的HP数据库容灾服务器在启动时出错,错误信息如下图所示:Warning:multiple console coutput devices are configured.If this message remains on the screen for more than a few miutes,then this is not the device in use by HP-UX as the console output device.If you would like this device to be the one used by HP-UX as the console output device,reboot and use the EFI boot manager or the EFI ‘conconfig’ command to select this device and deconfigure the others.错误信息说这台服务器已经配置了多个控制台输出设备。如果这个提示信息在屏幕上显示超过几分钟,那么这个输出设备没有被HP-UX作为控制输出设备。如果想让HP-UX使用这个设备作为控制台输出设备,重启服务器并使用EFI boot manager或者EFI的’conconfig’命令来选择这个设备并取消其它设备的配置。
IMG_20150507_083709

而这台HP服务器之前是能够正常启动,最近也没人进行设置,很奇怪,根据错误信息的提示重启并进行设置。

首先在启动时进入EFI boot manager设置界面
IMG_20150512_122943

选择Boot Configuration
IMG_20150512_122956

选择Console Configuration
IMG_20150512_123016

从上图中可以看到HP服务器现在主控制台输出配置为Serial Acpi,辅助输出设备为VGA,因为我这里配置的是KVM所以应该主控制台输出要设置为VGA才对,但之前同事说能正常启动,这里不再讨论原因,现在将VGA作为主控制台输出设备。
IMG_20150512_123039

IMG_20150512_123126

保存更改,服务器会自动重启
IMG_20150512_123404

IMG_20150512_123440

IMG_20150512_123452

IMG_20150512_123614
在将控制台输出设置为VGA后服务器可以正常启动了可以做容灾演验了

]]>
http://www.jydba.net/index.php/archives/1535/feed 1
Redhat Linux两台主机之间设置NFS挂载的步骤 http://www.jydba.net/index.php/archives/1413 http://www.jydba.net/index.php/archives/1413#respond Thu, 26 Mar 2015 04:53:17 +0000 http://www.jydba.net/?p=1413 为了测试Oracle RMAN使用PFILE参数文件在异机上执行duplicate命令,需要将辅助实例pfile参数文件通过NFS来让执行RMAN命令的主机应访问,所以需要配置NFS,这里只介绍了最基本的配置方法。
一、安装nfs
一般redhat是默认安装了nfs服务的,如果非默认安装且取消勾选nfs的话,需要挂载iso或下载安装包手动安装来进行安装,这里不再赘述。

二、在被共享目录所在主机配置/etc/exports
nfs允许挂载的目录及权限需在文件/etc/exports中进行定义。例如,我们要将参数文件所在目录/u01/app/oracle/product/10.2.0/db/dbs共享出来,那么我们需要编辑/etc/exports文件,追加一行/u01/app/oracle/product/10.2.0/db/dbs *(rw,sync):

[root@jingyong1 /]# vi /etc/exports


/u01/app/oracle/product/10.2.0/db/dbs *(rw,sync)

其中
/u01/app/oracle/product/10.2.0/db/dbs是要共享的目录;
* 代表允许所有的网络段访问(仅测试中使用,实际使用应该做严格的IP限制);
rw开启共享目录的可读写权限;
sync是资料同步写入内存和硬盘;
其他更多参数说明:
ro 只读访问
rw 读写访问sync 所有数据在请求时写入共享
async nfs在写入数据前可以响应请求
secure nfs通过1024以下的安全TCP/IP端口发送
insecure nfs通过1024以上的端口发送
wdelay 如果多个用户要写入nfs目录,则归组写入(默认)
no_wdelay 如果多个用户要写入nfs目录,则立即写入,当使用async时,无需此设置。
hide 在nfs共享目录中不共享其子目录
no_hide 共享nfs目录的子目录
subtree_check 如果共享/usr/bin之类的子目录时,强制nfs检查父目录的权限(默认)
no_subtree_check 和上面相对,不检查父目录权限
all_squash 共享文件的UID和GID映射匿名用户anonymous,适合公用目录。
no_all_squash 保留共享文件的UID和GID(默认)
root_squash root用户的所有请求映射成如anonymous用户一样的权限(默认)
no_root_squas root用户具有根目录的完全管理访问权限
anonuid=xxx 指定nfs服务器/etc/passwd文件中匿名用户的UID
anongid=xxx 指定nfs服务器/etc/passwd文件中匿名用户的GID

三、启动nfs服务
在启动nfs之前需要先启动portmap服务,否则如下报错:

[root@jingyong1 /]# service nfs start
Starting NFS services:                                     [  OK  ]
Starting NFS quotas: Cannot register service: RPC: Unable to receive; errno = Connection refused
rpc.rquotad: unable to register (RQUOTAPROG, RQUOTAVERS, udp).
                                                           [FAILED]
Starting NFS daemon:

正确方法先启动portmap再启动nfs,如下:
service portmap start
service nfs start

/etc/init.d/portmap start
/etc/init.d/nfs start


[root@jingyong1 /]# service portmap start
Starting portmap: [  OK  ]

[root@jingyong1 /]# service nfs start
Starting NFS services:  [  OK  ]
Starting NFS quotas: [  OK  ]
Starting NFS daemon: [  OK  ]
Starting NFS mountd: [  OK  ]

四、在客户端主机上挂载共享目录
1、挂载之前同样需要先启动portmap服务

[root@oracle11g /]# service portmap start
Starting portmap: [  OK  ]

2、在客户端使用showmount -e IP 查看nfs主机共享情况:

[root@oracle11g /]# showmount -e 192.168.56.11
Export list for 192.168.56.11:
/u01/app/oracle/product/10.2.0/db/dbs *

3、在客户端建立jingyong1文件夹,并使用mount挂载命令:

[root@oracle11g net]# mkdir /jingyong1
[root@oracle11g /]# chown -R oracle:oinstall jingyong1
[root@oracle11g /]# chmod -R 777 jingyong1

[root@oracle11g /]# mount -t nfs 192.168.56.11:/u01/app/oracle/product/10.2.0/db/dbs /jingyong1

4、若无报错,则可使用df -h 查看到挂载情况:

[root@oracle11g /]# df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/sda1              23G   12G  9.6G  55% /
/dev/sdb1             9.9G  5.6G  3.9G  60% /u02
tmpfs                 252M     0  252M   0% /dev/shm
192.168.56.11:/u01/app/oracle/product/10.2.0/db/dbs
                       17G   14G  2.3G  86% /jingyong1

五、在客户端卸载已挂载的目录

[root@oracle11g /]# umount /jingyong1
]]>
http://www.jydba.net/index.php/archives/1413/feed 0
hp rx6600两台oracle双机互备服务器其中一台经常自动关机的故障诊断 http://www.jydba.net/index.php/archives/1290 http://www.jydba.net/index.php/archives/1290#respond Fri, 07 Nov 2014 01:22:06 +0000 http://www.jydba.net/?p=1290 hp rx6600两台oracle数据库双机互备服务器其中一台经常自动关机,刚好在做巡检时遇到了就顺便检查一下原因.检查经常出故障的一台小机日志信息如下:

rx6600-1:[/]#cat /var/adm/syslog/syslog.log
Nov  6 10:40:35 rx6600-1 syslogd: restart
Nov  6 10:40:35 rx6600-1 vmunix: Found adjacent data tr.  Growing size.  0x32a6000 -> 0x72a6000.
Nov  6 10:40:35 rx6600-1 vmunix: Pinned PDK malloc pool: base: 0xe000000100d5a000  size=117400K
Nov  6 10:40:35 rx6600-1 vmunix: Loaded ACPI revision 2.0 tables.
Nov  6 10:40:35 rx6600-1 vmunix: MMIO on this platform supports Write Coalescing.
Nov  6 10:40:35 rx6600-1 vmunix: 
Nov  6 10:40:35 rx6600-1 vmunix: MFS is defined: base= 0xe000000100d5a000  size= 5084 KB
Nov  6 10:40:35 rx6600-1 vmunix: Unpinned PDK malloc pool: base: 0xe000000108000000  size=393216K
Nov  6 10:40:35 rx6600-1 vmunix: NOTICE: cachefs_link(): File system was registered at index 5.
Nov  6 10:40:35 rx6600-1 vmunix: emcp:GPX:Info: GPX emcpgpx_install() success.
Nov  6 10:40:35 rx6600-1 vmunix: 
Nov  6 10:40:35 rx6600-1  above message repeats 2 times
Nov  6 10:40:35 rx6600-1 vmunix: emcp:GPX:Info: DM emcpgpx_dm_install() success.
Nov  6 10:40:35 rx6600-1 vmunix: emcp:GPX:Info: VLUMD emcpgpx_vlumd_install() success.
Nov  6 10:40:35 rx6600-1 vmunix: emcp:GPX:Info: XCRYPT emcpgpx_xcrypt_install() success.
Nov  6 10:40:35 rx6600-1 vmunix: NOTICE: nfs3_link(): File system was registered at index 8.
Nov  6 10:40:35 rx6600-1 vmunix: NOTICE: mod_fs_reg: Cannot retrieve configured loading phase from KRS for module: cifs. Setting to load at INIT
Nov  6 10:40:35 rx6600-1 vmunix: 
Nov  6 10:40:35 rx6600-1 vmunix: 0 sba
Nov  6 10:40:35 rx6600-1 vmunix: 0/0 lba
Nov  6 10:40:35 rx6600-1 vmunix: 0/0/1/0 rmp3f01
Nov  6 10:40:35 rx6600-1 vmunix: 0/0/1/1 rmp3f01
Nov  6 10:40:35 rx6600-1 vmunix: 0/0/1/2 asio0
Nov  6 10:40:35 rx6600-1 vmunix: 0/0/2/0 UsbOhci
Nov  6 10:40:35 rx6600-1 vmunix: NOTICE: USB device attached.  Identification String: 
Nov  6 10:40:35 rx6600-1 vmunix: Devices/Device/USB/Standard/hp/Unknown/0_1
Nov  6 10:40:35 rx6600-1 vmunix:  <2.1.3.10.1008.4390.1>
Nov  6 10:40:35 rx6600-1 vmunix: 0/0/2/0.0 UsbMiniBus
Nov  6 10:40:35 rx6600-1 vmunix: Devices/Keyboard/USB/Boot/hp/Unknown/0_1
Nov  6 10:40:35 rx6600-1 vmunix:  <2.305.3.100.1008.4390.1>
Nov  6 10:40:35 rx6600-1 vmunix: 0/0/2/0.0.0 UsbBootKeyboard
Nov  6 10:40:35 rx6600-1 vmunix: Devices/Mouse/USB/Standard/hp/Unknown/0_1
Nov  6 10:40:35 rx6600-1 vmunix:  <2.307.3.10.1008.4390.1>
Nov  6 10:40:35 rx6600-1 vmunix: 0/0/2/1 UsbOhci
Nov  6 10:40:35 rx6600-1 vmunix: Devices/Device/USB/Standard/hp/Multibay/0_a1
Nov  6 10:40:35 rx6600-1 vmunix:  <2.1.3.10.1008.294.161>
Nov  6 10:40:35 rx6600-1 vmunix: 0/0/2/1.0 UsbMiniBus
Nov  6 10:40:35 rx6600-1 vmunix: Devices/MassStorage-SCSI/USB/BulkOnly/hp/Multibay/0_a1
Nov  6 10:40:35 rx6600-1 vmunix:  <2.310.3.150.1008.294.161>
Nov  6 10:40:35 rx6600-1 vmunix: 0/0/2/1.0.0 UsbBulkOnlyMS
Nov  6 10:40:35 rx6600-1 vmunix: Devices/ScsiControllerAdaptor/USB/BulkOnly/hp/Multibay
Nov  6 10:40:35 rx6600-1 vmunix:  <2.1000.3.150.1008.294>
Nov  6 10:40:35 rx6600-1 vmunix: 0/0/2/1.0.16 UsbScsiAdaptor
Nov  6 10:40:35 rx6600-1 vmunix: NOTICE: USB device attached.  Identification String: 
Nov  6 10:40:36 rx6600-1  above message repeats 5 times
Nov  6 10:40:35 rx6600-1 vmunix: 0/0/2/1.0.16.0 tgt
Nov  6 10:40:35 rx6600-1 vmunix: 0/0/2/1.0.16.0.0 sdisk
Nov  6 10:40:35 rx6600-1 vmunix: 0/0/2/1.0.16.7 tgt
Nov  6 10:40:35 rx6600-1 vmunix: 0/0/2/1.0.16.7.0 sctl
Nov  6 10:40:35 rx6600-1 vmunix: NOTICE: USB device attached.  Identification String: 
Nov  6 10:40:35 rx6600-1 vmunix: Devices/Device/USB/Standard/Avocent/KVMAdaptor/1_0
Nov  6 10:40:35 rx6600-1 vmunix:  <2.1.3.10.1572.833.256>
Nov  6 10:40:35 rx6600-1 vmunix: 0/0/2/1.1 UsbMiniBus
Nov  6 10:40:35 rx6600-1 vmunix: Devices/Keyboard/USB/Boot/Avocent/KVMAdaptor/1_0
Nov  6 10:40:35 rx6600-1 vmunix:  <2.305.3.100.1572.833.256>
Nov  6 10:40:35 rx6600-1 vmunix: 0/0/2/1.1.0 UsbBootKeyboard
Nov  6 10:40:35 rx6600-1 vmunix: Devices/Mouse/USB/Boot/Avocent/KVMAdaptor/1_0
Nov  6 10:40:35 rx6600-1 vmunix:  <2.307.3.100.1572.833.256>
Nov  6 10:40:35 rx6600-1 vmunix: 0/0/2/1.1.1 UsbBootMouse
Nov  6 10:40:35 rx6600-1 vmunix: NOTICE: USB device attached.  Identification String: 
Nov  6 10:40:36 rx6600-1  above message repeats 2 times
Nov  6 10:40:35 rx6600-1 vmunix: 0/0/2/2 UsbEhci
Nov  6 10:40:35 rx6600-1 vmunix: 0/0/4/0 gvid_core
Nov  6 10:40:35 rx6600-1 vmunix: 0/1 lba
Nov  6 10:40:35 rx6600-1 vmunix: 0/2 lba
Nov  6 10:40:35 rx6600-1 vmunix: 0/2/1/0 PCItoPCI
Nov  6 10:40:35 rx6600-1 vmunix: fcd: Claimed HP AD193-60001 4Gb Fibre Channel port at hardware path 0/2/1/0/4/0 (FC Port 1 on HBA)
Nov  6 10:40:35 rx6600-1 vmunix: 0/2/1/0/4/0 fcd
Nov  6 10:40:35 rx6600-1 vmunix: 0/2/1/0/6/0 iether
Nov  6 10:40:35 rx6600-1 vmunix: 0/3 lba
Nov  6 10:40:35 rx6600-1 vmunix: 0/3/1/0 PCItoPCI
Nov  6 10:40:35 rx6600-1 vmunix: fcd: Claimed HP AD193-60001 4Gb Fibre Channel port at hardware path 0/3/1/0/4/0 (FC Port 1 on HBA)
Nov  6 10:40:35 rx6600-1 vmunix: 0/3/1/0/4/0 fcd
Nov  6 10:40:35 rx6600-1 vmunix: 0/3/1/0/6/0 iether
Nov  6 10:40:35 rx6600-1 vmunix: 0/4 lba
Nov  6 10:40:35 rx6600-1 vmunix: sasd: Claimed HP PCI/PCI-X SAS MPT adapter at hardware path 0/4/1/0 
Nov  6 10:40:35 rx6600-1 vmunix: 0/4/1/0 sasd
Nov  6 10:40:35 rx6600-1 vmunix: 0/4/2/0 iether
Nov  6 10:40:35 rx6600-1 vmunix: 0/4/2/1 iether
Nov  6 10:40:35 rx6600-1 vmunix: 0/5 lba
Nov  6 10:40:35 rx6600-1 vmunix: 0/5/1/0 PCItoPCI
Nov  6 10:40:35 rx6600-1 vmunix: fcd: Claimed HP AD193-60001 4Gb Fibre Channel port at hardware path 0/5/1/0/4/0 (FC Port 1 on HBA)
Nov  6 10:40:35 rx6600-1 vmunix: 0/5/1/0/4/0 fcd
Nov  6 10:40:35 rx6600-1 vmunix: 0/5/1/0/6/0 iether
Nov  6 10:40:35 rx6600-1 vmunix: 0/6 lba
Nov  6 10:40:35 rx6600-1 vmunix: 0/6/1/0 PCItoPCI
Nov  6 10:40:35 rx6600-1 vmunix: fcd: Claimed HP AD193-60001 4Gb Fibre Channel port at hardware path 0/6/1/0/4/0 (FC Port 1 on HBA)
Nov  6 10:40:35 rx6600-1 vmunix: 0/6/1/0/4/0 fcd
Nov  6 10:40:35 rx6600-1 vmunix: 0/6/1/0/6/0 iether
Nov  6 10:40:35 rx6600-1 vmunix: 0/7 lba
Nov  6 10:40:35 rx6600-1 vmunix: Initializing the Ultra320 SCSI Controller at 0/7/1/0. Controller firmware version is 01.03.35.70
Nov  6 10:40:35 rx6600-1 vmunix: 0/7/1/0 mpt
Nov  6 10:40:35 rx6600-1 vmunix: Initializing the Ultra320 SCSI Controller at 0/7/1/1. Controller firmware version is 01.03.35.70
Nov  6 10:40:35 rx6600-1 vmunix: 0/7/1/1 mpt
Nov  6 10:40:35 rx6600-1 vmunix: 120 processor
Nov  6 10:40:35 rx6600-1 vmunix: 121 processor
Nov  6 10:40:35 rx6600-1 vmunix: 122 processor
Nov  6 10:40:35 rx6600-1 vmunix: 123 processor
Nov  6 10:40:35 rx6600-1 vmunix: 124 processor
Nov  6 10:40:35 rx6600-1 vmunix: 125 processor
Nov  6 10:40:35 rx6600-1 vmunix: 126 processor
Nov  6 10:40:35 rx6600-1 vmunix: 127 processor
Nov  6 10:40:35 rx6600-1 vmunix: 250 pdh
Nov  6 10:40:35 rx6600-1 vmunix: 250/0 ipmi
Nov  6 10:40:35 rx6600-1 vmunix: 250/1 asio0
Nov  6 10:40:35 rx6600-1 vmunix: 250/2 acpi_node
Nov  6 10:40:35 rx6600-1 vmunix: 0/7/1/0.7 tgt
Nov  6 10:40:35 rx6600-1 vmunix: 0/7/1/0.7.0 sctl
Nov  6 10:40:35 rx6600-1 vmunix: 0/5/1/0/4/0.1 fcd_fcp
Nov  6 10:40:35 rx6600-1 vmunix: 0/5/1/0/4/0.1.9.0.0 fcd_vbus
Nov  6 10:40:35 rx6600-1 vmunix: 0/5/1/0/4/0.1.9.255.0 fcd_vbus
Nov  6 10:40:35 rx6600-1 vmunix: 0/5/1/0/4/0.1.13.255.0 fcd_vbus
Nov  6 10:40:35 rx6600-1 vmunix: 0/5/1/0/4/0.1.13.255.0.0 tgt
Nov  6 10:40:35 rx6600-1 vmunix: 0/5/1/0/4/0.1.13.255.0.0.0 sdisk
Nov  6 10:40:35 rx6600-1 vmunix: 0/5/1/0/4/0.1.9.0.0.0 tgt
Nov  6 10:40:35 rx6600-1 vmunix: 0/5/1/0/4/0.1.9.255.0.0 tgt
Nov  6 10:40:35 rx6600-1 vmunix: 0/5/1/0/4/0.1.9.0.0.0.0 sdisk
Nov  6 10:40:35 rx6600-1 vmunix: 0/5/1/0/4/0.1.9.255.0.0.0 sctl
Nov  6 10:40:35 rx6600-1 vmunix: 0/5/1/0/4/0.1.9.0.0.0.1 sdisk
Nov  6 10:40:35 rx6600-1 vmunix: 0/5/1/0/4/0.1.9.0.0.0.2 sdisk
Nov  6 10:40:35 rx6600-1 vmunix: 0/5/1/0/4/0.1.9.0.0.0.3 sdisk
Nov  6 10:40:35 rx6600-1 vmunix: 0/5/1/0/4/0.1.9.0.0.0.4 sdisk
Nov  6 10:40:35 rx6600-1 vmunix: 0/6/1/0/4/0.1 fcd_fcp
Nov  6 10:40:35 rx6600-1 vmunix: 0/6/1/0/4/0.1.9.0.0 fcd_vbus
Nov  6 10:40:35 rx6600-1 vmunix: 0/6/1/0/4/0.1.9.255.0 fcd_vbus
Nov  6 10:40:35 rx6600-1 vmunix: 0/6/1/0/4/0.1.13.0.0 fcd_vbus
Nov  6 10:40:35 rx6600-1 vmunix: 0/6/1/0/4/0.1.13.255.0 fcd_vbus
Nov  6 10:40:35 rx6600-1 vmunix: 0/6/1/0/4/0.1.13.0.0.0 tgt
Nov  6 10:40:35 rx6600-1 vmunix: 0/6/1/0/4/0.1.13.255.0.0 tgt
Nov  6 10:40:35 rx6600-1 vmunix: 0/6/1/0/4/0.1.9.0.0.0 tgt
Nov  6 10:40:35 rx6600-1 vmunix: 0/6/1/0/4/0.1.13.0.0.0.0 sdisk
Nov  6 10:40:35 rx6600-1 vmunix: 0/6/1/0/4/0.1.9.255.0.0 tgt
Nov  6 10:40:35 rx6600-1 vmunix: 0/6/1/0/4/0.1.13.255.0.0.0 sctl
Nov  6 10:40:35 rx6600-1 vmunix: 0/6/1/0/4/0.1.9.0.0.0.0 sdisk
Nov  6 10:40:35 rx6600-1 vmunix: 0/6/1/0/4/0.1.9.255.0.0.0 sctl
Nov  6 10:40:35 rx6600-1 vmunix: 0/6/1/0/4/0.1.13.0.0.0.1 sdisk
Nov  6 10:40:35 rx6600-1 vmunix: 0/6/1/0/4/0.1.13.0.0.0.2 sdisk
Nov  6 10:40:35 rx6600-1 vmunix: 0/6/1/0/4/0.1.13.0.0.0.3 sdisk
Nov  6 10:40:35 rx6600-1 vmunix: 0/6/1/0/4/0.1.9.0.0.0.1 sdisk
Nov  6 10:40:35 rx6600-1 vmunix: 0/6/1/0/4/0.1.13.0.0.0.4 sdisk
Nov  6 10:40:35 rx6600-1 vmunix: 0/6/1/0/4/0.1.9.0.0.0.2 sdisk
Nov  6 10:40:35 rx6600-1 vmunix: 0/6/1/0/4/0.1.9.0.0.0.3 sdisk
Nov  6 10:40:35 rx6600-1 vmunix: 0/6/1/0/4/0.1.9.0.0.0.4 sdisk
Nov  6 10:40:35 rx6600-1 vmunix: 0/7/1/1.7 tgt
Nov  6 10:40:35 rx6600-1 vmunix: 0/7/1/1.7.0 sctl
Nov  6 10:40:35 rx6600-1 vmunix: 0/4/1/0.0.0 sasd_vbus
Nov  6 10:40:35 rx6600-1 vmunix: 0/4/1/0.0.0.0 tgt
Nov  6 10:40:35 rx6600-1 vmunix: 0/4/1/0.0.0.0.0 sdisk
Nov  6 10:40:35 rx6600-1 vmunix: Boot device's HP-UX HW path is: 0/4/1/0.0.0.0.0
Nov  6 10:40:35 rx6600-1 vmunix: 
Nov  6 10:40:35 rx6600-1 vmunix:     System Console is on the Built-In Serial Interface
Nov  6 10:40:35 rx6600-1 vmunix: iether0: INITIALIZING HP AD193-60001 PCI/PCI-X 1000Base-T 4Gb FC/1000B-T Combo Adapter at hardware path 0/2/1/0/6/0
Nov  6 10:40:35 rx6600-1 vmunix: iether1: INITIALIZING HP AD193-60001 PCI/PCI-X 1000Base-T 4Gb FC/1000B-T Combo Adapter at hardware path 0/3/1/0/6/0
Nov  6 10:40:35 rx6600-1 vmunix: iether2: INITIALIZING HP AB352-60003 PCI/PCI-X 1000Base-T Dual-port Core at hardware path 0/4/2/0
Nov  6 10:40:35 rx6600-1 vmunix: iether4: INITIALIZING HP AD193-60001 PCI/PCI-X 1000Base-T 4Gb FC/1000B-T Combo Adapter at hardware path 0/5/1/0/6/0
Nov  6 10:40:35 rx6600-1 vmunix: iether5: INITIALIZING HP AD193-60001 PCI/PCI-X 1000Base-T 4Gb FC/1000B-T Combo Adapter at hardware path 0/6/1/0/6/0
Nov  6 10:40:35 rx6600-1 vmunix: iether3: INITIALIZING HP AB352-60003 PCI/PCI-X 1000Base-T Dual-port Core at hardware path 0/4/2/1
Nov  6 10:40:35 rx6600-1 vmunix: Logical volume 64, 0x3 configured as ROOT
Nov  6 10:40:35 rx6600-1 vmunix: Logical volume 64, 0x2 configured as SWAP
Nov  6 10:40:35 rx6600-1 vmunix: Logical volume 64, 0x2 configured as DUMP
Nov  6 10:40:35 rx6600-1 vmunix:     Swap device table:  (start & size given in 512-byte blocks)
Nov  6 10:40:35 rx6600-1 vmunix:         entry 0 - major is 64, minor is 0x2; start = 0, size = 16777216
Nov  6 10:40:35 rx6600-1 vmunix:     Dump device table:  (start & size given in 1-Kbyte blocks)
Nov  6 10:40:35 rx6600-1 vmunix:         entry 0000000000000000 - major is 31, minor is 0x30000; start = 2349940, size = 8388604
Nov  6 10:40:35 rx6600-1 vmunix: Starting the STREAMS daemons-phase 1
Nov  6 10:40:35 rx6600-1 vmunix: Create STCP device files
Nov  6 10:40:35 rx6600-1 vmunix: Starting the STREAMS daemons-phase 2
Nov  6 10:40:35 rx6600-1 vmunix:      $Revision: vmunix:    B11.23_LR FLAVOR=perf Fri Aug 29 22:35:38 PDT 2003 $
Nov  6 10:40:35 rx6600-1 vmunix: Memory Information:
Nov  6 10:40:35 rx6600-1 vmunix:     physical page size = 4096 bytes, logical page size = 4096 bytes
Nov  6 10:40:35 rx6600-1 vmunix:     Physical: 25133536 Kbytes, lockable: 18994328 Kbytes, available: 22051156 Kbytes
Nov  6 10:40:35 rx6600-1 vmunix: 
Nov  6 10:40:36 rx6600-1 nettl[832]: nettl starting up.
Nov  6 10:40:48 rx6600-1 sshd[986]: Server listening on :: port 22.
Nov  6 10:40:48 rx6600-1 sshd[986]: Server listening on 0.0.0.0 port 22.
Nov  6 10:40:49 rx6600-1 rpcbind: check_netconfig: Found CLTS loopback transport
Nov  6 10:40:49 rx6600-1 rpcbind: check_netconfig: Found COTS loopback transport
Nov  6 10:40:49 rx6600-1 rpcbind: check_netconfig: Found COTS ORD loopback transport
Nov  6 10:40:49 rx6600-1 rpcbind: init_transport: check binding for udp
Nov  6 10:40:49 rx6600-1 rpcbind: init_transport: check binding for tcp
Nov  6 10:40:49 rx6600-1 rpcbind: init_transport: check binding for ticlts
Nov  6 10:40:49 rx6600-1 rpcbind: init_transport: check binding for ticotsord
Nov  6 10:40:49 rx6600-1 rpcbind: init_transport: check binding for ticots
Nov  6 10:40:50 rx6600-1 inetd[1100]: Reading configuration
Nov  6 10:40:50 rx6600-1 inetd[1100]: ftp/tcp: Added service, server /usr/lbin/ftpd
Nov  6 10:40:50 rx6600-1 inetd[1100]: telnet/tcp: Added service, server /usr/lbin/telnetd
Nov  6 10:40:50 rx6600-1 inetd[1100]: tftp/udp: Added service, server /usr/lbin/tftpd
Nov  6 10:40:50 rx6600-1 inetd[1100]: login/tcp: Added service, server /usr/lbin/rlogind
Nov  6 10:40:50 rx6600-1 inetd[1100]: shell/tcp: Added service, server /usr/lbin/remshd
Nov  6 10:40:50 rx6600-1 inetd[1100]: exec/tcp: Added service, server /usr/lbin/rexecd
Nov  6 10:40:50 rx6600-1 inetd[1100]: ntalk/udp: Added service, server /usr/lbin/ntalkd
Nov  6 10:40:50 rx6600-1 inetd[1100]: auth/tcp: Added service, server /usr/lbin/identd
Nov  6 10:40:50 rx6600-1 inetd[1100]: printer/tcp: Added service, server /usr/sbin/rlpdaemon
Nov  6 10:40:51 rx6600-1 inetd[1100]: daytime/tcp: Added service, server internal
Nov  6 10:40:51 rx6600-1 inetd[1100]: daytime/udp: Added service, server internal
Nov  6 10:40:51 rx6600-1 inetd[1100]: time/tcp: Added service, server internal
Nov  6 10:40:51 rx6600-1 inetd[1100]: echo/tcp: Added service, server internal
Nov  6 10:40:51 rx6600-1 inetd[1100]: echo/udp: Added service, server internal
Nov  6 10:40:51 rx6600-1 inetd[1100]: discard/tcp: Added service, server internal
Nov  6 10:40:51 rx6600-1 inetd[1100]: discard/udp: Added service, server internal
Nov  6 10:40:51 rx6600-1 inetd[1100]: chargen/tcp: Added service, server internal
Nov  6 10:40:51 rx6600-1 inetd[1100]: chargen/udp: Added service, server internal
Nov  6 10:40:51 rx6600-1 inetd[1100]: kshell/tcp: Added service, server /usr/lbin/remshd
Nov  6 10:40:51 rx6600-1 inetd[1100]: klogin/tcp: Added service, server /usr/lbin/rlogind
Nov  6 10:40:51 rx6600-1 inetd[1100]: dtspc/tcp: Added service, server /usr/dt/bin/dtspcd
Nov  6 10:40:51 rx6600-1 inetd[1100]: recserv/tcp: Added service, server /usr/lbin/recserv
Nov  6 10:40:51 rx6600-1 inetd[1100]: swat/tcp: Added service, server /opt/samba/bin/swat
Nov  6 10:40:51 rx6600-1 inetd[1100]: registrar/tcp: Added service, server /etc/opt/resmon/lbin/registrar
Nov  6 10:40:51 rx6600-1 inetd[1100]: hacl-probe/tcp: Added service, server /opt/cmom/lbin/cmomd
Nov  6 10:40:51 rx6600-1 inetd[1100]: hacl-cfg/udp: Added service, server /usr/lbin/cmclconfd
Nov  6 10:40:51 rx6600-1 inetd[1100]: hacl-cfg/tcp: Added service, server /usr/lbin/cmclconfd
Nov  6 10:40:51 rx6600-1 inetd[1100]: instl_boots/udp: Added service, server /opt/ignite/lbin/instl_bootd
Nov  6 10:40:51 rx6600-1 inetd[1100]: omni/tcp: Added service, server /opt/omni/lbin/inet
Nov  6 10:40:51 rx6600-1 inetd[1100]: rpc.cmsd/udp: Added service, server /usr/dt/bin/rpc.cmsd
Nov  6 10:40:51 rx6600-1 inetd[1100]: rpc.ttdbserver/tcp: Added service, server /usr/dt/bin/rpc.ttdbserver
Nov  6 10:40:51 rx6600-1 inetd[1100]: Configuration complete
Nov  6 10:40:53 rx6600-1 EMCPP: emcpAudit: Info: cmd=powermt: restore  (user ID real=0 effective=0)
Nov  6 10:40:53 rx6600-1 EMCPP: emcpAudit: Info: cmd=powermt: config  (user ID real=0 effective=0)
Nov  6 10:40:53 rx6600-1 EMCPP: emcpAudit: Info: cmd=powermt: save  (user ID real=0 effective=0)
Nov  6 10:40:54 rx6600-1 su: + tty?? root-sfmdb
Nov  6 10:41:06 rx6600-1 cimserver[1706]: starting
Nov  6 10:41:29 rx6600-1 cimserver[1707]: PGS10026:  THE CIM SERVER IS LISTENING ON HTTPS PORT 5,989.
Nov  6 10:41:29 rx6600-1 cimserver[1707]: PGS10028: THE CIM SERVER IS LISTENING ON THE LOCAL CONNECTION SOCKET.
Nov  6 10:41:29 rx6600-1 cimserver[1707]: PGS10030:  STARTED HP-UX WBEM Services VERSION A.02.07.
Nov  6 10:41:32 rx6600-1 FontServer[1755]: Warning: Bad font path element: "/usr/lib/X11/fonts/hp_japanese/100dpi/"
Nov  6 10:41:32 rx6600-1 FontServer[1755]: Warning: Bad font path element: "/usr/lib/X11/fonts/hp_japanese/75dpi/"
Nov  6 10:41:32 rx6600-1 FontServer[1755]: Warning: Bad font path element: "/usr/lib/X11/fonts/hp_korean/75dpi/"
Nov  6 10:41:32 rx6600-1 FontServer[1755]: Warning: Cannot initialize font path element: "/usr/lib/X11/fonts/hp_chinese_t/75dpi/"
Nov  6 10:41:32 rx6600-1 FontServer[1755]: Warning: Bad font path element: "/usr/lib/X11/fonts/ttfjpn.st"
Nov  6 10:41:32 rx6600-1 FontServer[1755]: Warning: Bad font path element: "/usr/lib/X11/fonts/ifojpn.st"
Nov  6 10:41:34 rx6600-1 pwgrd: Started at Thu Nov  6 10:41:34 2014, pid = 1798
Nov  6 10:41:34 rx6600-1 diagmond[1833]: started
Nov  6 10:41:34 rx6600-1 /usr/sbin/envd[1837]: VXPBFt6/, 2"6A3vEdVCND< ~
Nov  6 10:41:50 rx6600-1 /usr/sbin/nfsd[2180]: Setting STREAMS-HEAD high water value to 131072.
Nov  6 10:41:50 rx6600-1 /usr/sbin/nfsd[2185]: nfsd do_one mpctl succeeded: ncpus = 8.
Nov  6 10:41:50 rx6600-1 /usr/sbin/nfsd[2185]: nfsd do_one pmap 2
Nov  6 10:41:50 rx6600-1 /usr/sbin/nfsd[2185]: nfsd do_one pmap 3
Nov  6 10:41:50 rx6600-1 /usr/sbin/nfsd[2190]: nfsd do_one bind 0
Nov  6 10:41:50 rx6600-1 /usr/sbin/nfsd[2191]: nfsd do_one bind 1
Nov  6 10:41:50 rx6600-1 /usr/sbin/nfsd[2192]: nfsd do_one bind 2
Nov  6 10:41:50 rx6600-1 /usr/sbin/nfsd[2193]: nfsd do_one bind 3
Nov  6 10:41:50 rx6600-1 /usr/sbin/nfsd[2194]: nfsd do_one bind 4
Nov  6 10:41:50 rx6600-1 /usr/sbin/nfsd[2195]: nfsd do_one bind 5
Nov  6 10:41:50 rx6600-1 /usr/sbin/nfsd[2185]: nfsd do_one bind 7
Nov  6 10:41:50 rx6600-1 /usr/sbin/nfsd[2195]: Return from t_optmgmt(XTI_DISTRIBUTE) 0
Nov  6 10:41:50 rx6600-1 /usr/sbin/nfsd[2195]: nfsd 5 1  sock 4
Nov  6 10:41:50 rx6600-1 /usr/sbin/nfsd[2197]: nfsd 5 0  sock 4
Nov  6 10:41:50 rx6600-1 /usr/sbin/nfsd[2193]: Return from t_optmgmt(XTI_DISTRIBUTE) 0
Nov  6 10:41:50 rx6600-1 /usr/sbin/nfsd[2192]: Return from t_optmgmt(XTI_DISTRIBUTE) 0
Nov  6 10:41:50 rx6600-1 /usr/sbin/nfsd[2193]: nfsd 3 1  sock 4
Nov  6 10:41:50 rx6600-1 /usr/sbin/nfsd[2192]: nfsd 2 1  sock 4
Nov  6 10:41:50 rx6600-1 /usr/sbin/nfsd[2200]: nfsd 2 0  sock 4
Nov  6 10:41:50 rx6600-1 /usr/sbin/nfsd[2191]: Return from t_optmgmt(XTI_DISTRIBUTE) 0
Nov  6 10:41:50 rx6600-1 /usr/sbin/nfsd[2194]: Return from t_optmgmt(XTI_DISTRIBUTE) 0
Nov  6 10:41:50 rx6600-1 /usr/sbin/nfsd[2191]: nfsd 1 1  sock 4
Nov  6 10:41:50 rx6600-1 /usr/sbin/nfsd[2201]: nfsd 1 0  sock 4
Nov  6 10:41:50 rx6600-1 /usr/sbin/nfsd[2199]: nfsd 3 0  sock 4
Nov  6 10:41:50 rx6600-1 /usr/sbin/nfsd[2194]: nfsd 4 1  sock 4
Nov  6 10:41:50 rx6600-1 /usr/sbin/nfsd[2202]: nfsd 4 0  sock 4
Nov  6 10:41:50 rx6600-1 /usr/sbin/nfsd[2185]: Return from t_optmgmt(XTI_DISTRIBUTE) 0
Nov  6 10:41:50 rx6600-1 /usr/sbin/nfsd[2185]: nfsd 7 1  sock 4
Nov  6 10:41:50 rx6600-1 /usr/sbin/nfsd[2219]: nfsd 7 0  sock 4
Nov  6 10:41:50 rx6600-1 /usr/sbin/nfsd[2196]: nfsd do_one bind 6
Nov  6 10:41:50 rx6600-1 /usr/sbin/nfsd[2190]: Return from t_optmgmt(XTI_DISTRIBUTE) 0
Nov  6 10:41:50 rx6600-1 /usr/sbin/nfsd[2196]: Return from t_optmgmt(XTI_DISTRIBUTE) 0
Nov  6 10:41:50 rx6600-1 /usr/sbin/nfsd[2190]: nfsd 0 1  sock 4
Nov  6 10:41:50 rx6600-1 /usr/sbin/nfsd[2220]: nfsd 0 0  sock 4
Nov  6 10:41:50 rx6600-1 /usr/sbin/nfsd[2196]: nfsd 6 1  sock 4
Nov  6 10:41:50 rx6600-1 /usr/sbin/nfsd[2221]: nfsd 6 0  sock 4
Nov  6 10:41:53 rx6600-1 krsd[2300]: Delay time is 300 seconds
Nov  6 10:41:53 rx6600-1 sfd[2301]: daemon already running.
Nov  6 10:41:54 rx6600-1 sfd[2314]: starting the daemon.
Nov  6 10:41:54 rx6600-1 emcp_mond: PP daemon: Info: New event pair [0] (2,4,60)
Nov  6 10:41:54 rx6600-1 emcp_mond: PP daemon: Info: New event pair [1] (20,40,300)
Nov  6 10:41:54 rx6600-1 emcp_mond: PP daemon: Info: SetLogMask:: EventLogMask set to 0x66 
Nov  6 10:41:54 rx6600-1 emcp_mond: PP daemon: Info: Using hostname localhost community public debug 0
Nov  6 10:41:54 rx6600-1 emcp_mond: PP daemon: Info: Daemon created successfully.  Starting it now
Nov  6 10:41:54 rx6600-1 emcp_mond: PP daemon: Info: SNMP trap processing disabled.
Nov  6 10:41:54 rx6600-1 emcp_mond: PP daemon: Info: PP Remote Management disabled.
Nov  6 10:45:17 rx6600-1 vmunix: emcp:Mpx:Info: PowerPath Auto Host Registration on VNX-FCN00125000137 is unavailable: incompatible initiator information received from the array
Nov  6 10:45:42 rx6600-1 /usr/sbin/envd[1837]: ***** 9} HH AY =g >/ 8f *****
Nov  6 10:45:42 rx6600-1 /usr/sbin/envd[1837]: NB6H3,9}U}3#9$WwAY=gV5, P^U}9}HHLu< ~!#
Nov  6 10:45:42 rx6600-1 EMS [2970]: ------ EMS Event Notification ------   Value: "MAJORWARNING (3)" for Resource: "/system/events/ia64_corehw/core_hw"     (Threshold:  >= " 3")   
 Execute the following command to obtain event details:   /opt/resmon/bin/resdata -R 194641922 -r /system/events/ia64_corehw/core_hw -n 194641921 -a 
Nov  6 10:49:14 rx6600-1 EMS [2928]: ------ EMS Event Notification ------   Value: "CRITICAL (5)" for Resource: "/system/events/ipmi_fpl/ipmi_fpl"     (Threshold:  >= " 3")    
Execute the following command to obtain event details:   /opt/resmon/bin/resdata -R 191889410 -r /system/events/ipmi_fpl/ipmi_fpl -n 191889409 -a 
Nov  6 18:48:12 rx6600-1 EMS [2970]: ------ EMS Event Notification ------   Value: "CRITICAL (5)" for Resource: "/system/events/ia64_corehw/core_hw"     (Threshold:  >= " 3")    
Execute the following command to obtain event details:   /opt/resmon/bin/resdata -R 194641922 -r /system/events/ia64_corehw/core_hw -n 194641922 -a 
Nov  6 19:00:00 rx6600-1 su: + tty?? root-oracle
Nov  7 08:00:00 rx6600-1 su: + tty?? root-root

从如下信息看到服务器已经出问题了,且信息已经指出可以执行
/opt/resmon/bin/resdata -R 194641922 -r /system/events/ia64_corehw/core_hw -n 194641921 -a 命令来查看详细信息

Nov  6 10:41:54 rx6600-1 emcp_mond: PP daemon: Info: SNMP trap processing disabled.
Nov  6 10:41:54 rx6600-1 emcp_mond: PP daemon: Info: PP Remote Management disabled.
Nov  6 10:45:17 rx6600-1 vmunix: emcp:Mpx:Info: PowerPath Auto Host Registration on VNX-FCN00125000137 is unavailable: incompatible initiator information received from the array
Nov  6 10:45:42 rx6600-1 /usr/sbin/envd[1837]: ***** 9} HH AY =g >/ 8f *****
Nov  6 10:45:42 rx6600-1 /usr/sbin/envd[1837]: NB6H3,9}U}3#9$WwAY=gV5, P^U}9}HHLu< ~!#
Nov  6 10:45:42 rx6600-1 EMS [2970]: ------ EMS Event Notification ------   Value: "MAJORWARNING (3)" for Resource: "/system/events/ia64_corehw/core_hw"     (Threshold:  >= " 3")   
Execute the following command to obtain event details:   /opt/resmon/bin/resdata -R 194641922 -r /system/events/ia64_corehw/core_hw -n 194641921 -a 

执行/opt/resmon/bin/resdata -R 194641922 -r /system/events/ia64_corehw/core_hw -n 194641921 -a 命令来查看详细信息

rx6600-1:[/]#/opt/resmon/bin/resdata -R 194641922 -r /system/events/ia64_corehw/core_hw -n 194641921 -a 

ARCHIVED MONITOR DATA:

Event Time..........: Thu Nov  6 10:45:42 2014
Severity............: MAJORWARNING
Monitor.............: ia64_corehw
Event #.............: 101011              
System..............: rx6600-1

Summary:
     System temperature is out of normal range. 


Description of Error:

     The system temperature is not within normal operating range. It is higher
     than required operating range.

这个错误描述是说系统的温度超出了正常范围,下面信息说明了可能的原因

Probable Cause / Recommended Action:

     Something may be blocking the cooling intakes of the fans. Check for
     obstruction.
     One or more fans may be operating at lower speed than normal. Check the
     fan performance.

     Check for problems with the room air conditioning.

     If the problem is not fixed, the operating temperature may become
     non-recoverable, in which case there are chances that the hardware may be
     damaged.  At that temperature level, on Integrity servers, the firmware
     will shutdown the system automatically. However on HP 9000 servers, the
     action specified in the envd config file will be taken - which may be to
     shutdown the system automatically.

     For information on the sensor that generated this event, refer to FRU ID
     in Event Details section.

上面的信息是说,可能需要清理一下风机,或者风机性能出现问题,或者检查空调情况,如果不是这些原因造成那么可能是硬件出现问题了。下面的论断事件的数据:

Additional Event Data: 
     System IP Address...: 10.138.129.5
     Event Id............: 0x545ae0d600000000
     Monitor Version.....: B.01.00
     Event Class.........: System
     Client Configuration File...........:
     /var/stm/config/tools/monitor/default_ia64_corehw.clcfg 
     Client Configuration File Version...: A.01.00 
          Qualification criteria met.
               Number of events..: 1 
     Associated OS error log entry id(s): 
          None
     Additional System Data:
          System Model Number.............: ia64 hp server rx6600 
          EMS Version.....................: A.04.20 
          STM Version.....................: C.58.00 
          System Serial Number............: SGH48045VY 
     Latest information on this event:
          http://docs.hp.com/hpux/content/hardware/ems/ia64_corehw.htm#101011

v-v-v-v-v-v-v-v-v-v-v-v-v    D  E  T  A  I  L  S    v-v-v-v-v-v-v-v-v-v-v-v-v


Event Details :

     Event Date .............: Thu Nov  6 10:44:08 2014
     Sensor Number ..........: 0xdb
     Sensor Type ............: Temperature
     Sensor Class ...........: Threshold based
     Sensor Reading/Offset...: 0x07 (Offset)
     Event  Type.............: Assertion
     Entity ID ..............: 3
     Generic Message.........: 
       Temperature :  Upper non-critical - going high 
     Entity FRU Id Info......: 
       processor (Sensor ID: Processor 2)

从上面的Event Details信息可以看到,传感器类型是温度方面的问题,传感器类别是基于阈值,事件类型是断言,是说2号cpu的温度已经超过了阈值.经过检查不是机房空调,通风口堵塞问题,需要联系小机厂商来进行一步检查是什么原因造成cpu温度超过阈值,平时cpu使用率只有10%。

]]>
http://www.jydba.net/index.php/archives/1290/feed 0
linux系统中的调度周期任务:cron http://www.jydba.net/index.php/archives/642 http://www.jydba.net/index.php/archives/642#respond Fri, 23 Aug 2013 11:49:57 +0000 http://www.jydba.net/?p=642 linux系统中的调度周期任务:cron
主要概念
cron工具用来调度经常重复的任务
crontab命令是编辑crontab文件的一个前端程序
crontab文件使用5个字段来规定计时信息
cron作业中的标准输出会作为邮件寄给用户

执行周期任务
人们经常发现自己会定期执行一些任务.在系统管理中,这些任务包括从/tmp目录下删除旧的,不使用的文件,或者经常
检查记录登录信息的文件以确保其不会变得过大.其他用户可能会有自己的任务,如检查不再使用的大型文件,或者查看
网站上是否公布了新的信息.

cron工具允许用户配置要定期运行的命令,如每隔十分钟,每周四一次,或每月两次.用户用crontab命令配置自己的任务
计划(cron table),指定何种命令在何时运行.这些任务由传统的linux(和unix)守护进程,即crond守护进程管理.

cron服务
crond守护进程是代表系统或个人用户执行周期任务的守护进程.通常这个守护进程随着系统的启动而启动,因此大多数
用户都不会注意到.通过列出所有进程且搜索crond,你可以确定crond守护进程有没有在运行.

[root@sidatabase /]# ps aux | grep crond
root      3204  0.0  0.0 117204  1368 ?        Ss   Aug09   0:11 crond
root      4687  0.0  0.0 103244   872 pts/0    S+   14:52   0:00 grep crond

如果crond守护进程没有在运行,系统管理员需要以根用户身份来启动crond守护进程.

crontab语法
用户通过配置一个称为”cron table”(经常缩写成”crontab”)的文件指定要运行哪些作业以及何时运行.下面列出了一个
crontab文件的例子.

30 23 * * 6  su - sybx -c "/sydata/app/db/bin/rman target / msglog=/sybak/bak0.log  cmdfile=/sybak/sybx_rman_script/bak0"
30 23 * * 0,1,2,3,4,5  su - sybx -c "/sydata/app/db/bin/rman target / msglog=/sybak/bak1.log  cmdfile=/sybak/sybx_rman_script/bak1"
30 2 * * 0,1,2,3,4,5,6  su - sybx -c "/sydata/app/db/bin/rman target / msglog=/sybak/bakarch.log  cmdfile=/sybak/sybx_rman_script/bakarch"
30 3 * * 0,1,2,3,4,5,6  su - sybx -c "/sydata/app/db/bin/rman target / msglog=/sybak/delbackup.log  cmdfile=/sybak/sybx_rman_script/delbackup"

crontab文件是一个以行为运行单位的配置文件,每行执行三种功能中的一种:
注释
首字符(非空格)是一个#的行被认为是注释,可忽略.

环境变量
具有name=value格式的所有行被用来定义环境变量

cron命令
其他的任何(非空)行被认为是cron命令,由下面描述的六个字段组成.
cron命令行包括六个用空白分隔的字段.前五个字段用来指定何时运行命令,剩余的第六个字段(包括所有在第五个字
段后的部分)指定要运行的命令.前五个字段指定下列时间信息:

minute      hour   day of month    month(1=January,....)   day of week (0=Sunday,....)    command to run

25          04     1               *                       *                              echo "HI"

前五种字段的每一种都必须含有一个使用下列语法的标记
crontab时间表示语法标记
标记 含义 例子 解释(如果用在第一个字段中)
* 每次 * 每分钟
n 在指定时间 10 在每小时过10分时
n,n,… 在任何指定时间 22,52 在每小时过22分和每小时过52分时
*/n 每隔n次 */15 每隔15分钟(在每个整点,一刻钟,半点,或差一刻整点时)

使用crontab命令
用户很少直接管理自己的crontab文件(甚至不知道crontab文件被保存在哪里),而是使用crontab命令来编辑,列出或者
删除它.
crontab {[-e] | [-l] | [-r]}
crontab file
编辑,列出或删除当胶crontab文件,或者用file取代当前crontab文件.crontab命令行选项释义如下
crontab命令行选项
选项 作用
-e 编辑当前文件
-l 列出当前文件
-r 删除当前文件

直接编辑crontab文件
用户经常用crontab -e 直接编辑自己的crontab文件.crontab命令将把当前crontab配置打开到用户默认的编辑器中.
当用户编辑完文件并退出编辑器时,修改过的文件内容作为新的crontab配置被添加.

默认的编辑器是/bin/vi,然而crontab像其他许多命令一样,检查editor环境变量.如果变理已经被设置,它将会被用来
替代默认编辑器.

环境变量与cron
配置cron作业时,用户应该知道一个微妙的细节.当crond守护进程启动用户命令时,它没有从shell中运行命令,而是
直接对这个命令派生和执行(fork和exec).这有一个重要的含义:启动时被shell配置的任何环境变量或别名(alias),
例如在/etc/profile或.bash_profile中被定义的任何环境变量,不会在cron执行命令时出现.

如果用户想定义一个环境变量,需要在自己的crontab配置中定义该变量.

]]>
http://www.jydba.net/index.php/archives/642/feed 0
linux系统中的调度延迟任务:at 命令 http://www.jydba.net/index.php/archives/640 http://www.jydba.net/index.php/archives/640#respond Fri, 23 Aug 2013 11:47:50 +0000 http://www.jydba.net/?p=640 linux系统中的调度延迟任务:at 命令
主要概念
at命令可以使命令稍后运行
batch命令可以让命令在机器负载较低的情况下运行
可以直接进入命令,或者以脚本形式提交命令
作业中的标准输出用邮件发送给用户
atq命令和atrm命令用来查看和删除当前的计划任务

linux的守护进程是那些在后台运行的进程,脱离控制终端,执行通常成键盘输入无关的任务.守护进程经常与
网络服务相关联,例如网页服务器(httpd)或ftp服务器(vsftpd).其他守护进程处理系统任务,例如日志守护进程(
syslogd)和电源管理守护进程(apmd).这个主要解释说明两个守护进程:一个允许用户延迟任务(atd);另一个允许
用户在固定间隔时间运行命令(crond).

守护进程像其他任何进程一样,通常作为系统启动序列的一部分被启动,或者由根用户启动.因此,除非你特意寻找
它们,否则可能一直不知道它们的存在.

[root@sidatabase /]# ps aux | grep crond
root      3204  0.0  0.0 117204  1368 ?        Ss   Aug09   0:11 crond
root     21399  0.0  0.0 103244   868 pts/0    S+   14:07   0:00 grep crond
[root@sidatabase /]# ps aux | grep atd
rpcuser   2800  0.0  0.0  23340  1204 ?        Ss   Aug09   0:00 rpc.statd
root      3215  0.0  0.0  21448   464 ?        Ss   Aug09   0:00 /usr/sbin/atd
root     21405  0.0  0.0 103244   872 pts/0    S+   14:07   0:00 grep atd

有些守护进程作为根用户运行,而有些守护进程为了安全起见,则以一个系统用户的身份运行.在上面,crond守护进程
作为根用户运行,而ntpd守护进程则作为系统用户运行,如下所示.

[root@sidatabase /]# ps aux | grep ntpd
root     26538  0.0  0.0 103240   868 ?        14:22   0:00 ntpd -u ntp:ntp -p

atd守护进程
atd守护进程允许用户提交稍后运行的作业,如”at 14:13 “.atd守护进程必须在运行时才能使用,用户可以通过查看
运行的进程列表来确定atd是否在运行.

root@sidatabase /]# ps aux | grep atd
rpcuser   2800  0.0  0.0  23340  1204 ?        Ss   Aug09   0:00 rpc.statd
root      3215  0.0  0.0  21448   548 ?        Ss   Aug09   0:00 /usr/sbin/atd
root     28604  0.0  0.0 103244   872 pts/0    S+   14:24   0:00 grep atd

在上面的输出中第七列指出了与进程相关联的终端.对用户root的grep命令而言,终端是pts/2,这可甬指的网络shell
或X会话中的图形终端.注意,atd守护进程没有相关联的终端.守护进程的一个定义特征是,它结束与启动它的终端之
间的联系.

用at命令提交作业
at命令用来向atd守护进程提交需要在特定时间运行的作业.要运行的命令可以作为脚本提交(用-f命令行选项),也可以
通过标准输入直接输入.命令的标准输出将用电子邮件的形式寄给用户
at [[-f filename] | [-m]] time

规定一天中的时间可以用HH:MM格式,后面附加”am”或”pm”,也可以用”midnight”,”noon”和”teatime”待词语.日期也可以
用好几种格式规定,其中mm/dd/yy

例如要在14:13这个时间生成一个名叫at.txt的文件并在文件中写入”hello I am JingYong”信息

[root@sidatabase /]# echo "hello I am JingYong " > at.txt | at 14:13
job 1 at 2013-08-23 14:13

查看作业

[root@sidatabase /]# atq
1       2013-08-23 14:13 a root

删除作业

[root@sidatabase /]# atrm 1

用batch延迟任务
batch命令与at命令一样,用来延迟任务.与at命令不同的是,batch命令不在特定时间运行,而是等到系统不忙于别的
任务时运行.如果提交作业时机器不繁忙,可以立即运行作业.batch守护进程会监控系统的平均负载(load average)
等待它降到0.8以下,然后开始运行作业任务.

batch命令的语法与at命令的语法一模一样,可以用标准输入规定作业,也可以用-f命令行选项把作业作为batch文件
来提交.如果规定了时间,batch会延迟到指定的时间开始观察机器,那时,atd将开始监控系统的平均负载,并且在系统
不繁忙时运行作业.

]]>
http://www.jydba.net/index.php/archives/640/feed 0
在linux系统中在后台以作业形式运行命令 http://www.jydba.net/index.php/archives/638 http://www.jydba.net/index.php/archives/638#respond Fri, 23 Aug 2013 11:45:58 +0000 http://www.jydba.net/?p=638 在linux系统中在后台以作业形式运行命令
通过给命令行附加一个”&”字符,任何指定的命令也可以在后台运行.通常,只有那些不需要键盘输入而且不
会生成大量输出的长时间运行的命令才适合在后台运行.当bash shell在后台运行命令时,该命令被称为作
业(job),被分配一个作业号码.

[root@sidatabase oradata]# cp system20130708.dmp / > cp.txt 2> /dev/null &
[1] 20629

在后台启动作业后,bash shell向用户报告了两条信息:第一条是作业号码,出现在方括号中;
第二条是后台作业的进程id.上面的信息说明该作业的作业号码为1,cp命令的进程id为20629

用jobs命令列出当前作业

[root@sidatabase /]# jobs
[1]+  Running                 cp -i system20130708.dmp / > cp.txt 2> /dev/null &  (wd: /oracle/oradata)

他的每个后台作业都和作业号码一起列出.最新操作的作业被作为当前作业,在jobs命令输出中用一个”+”修饰.

用fg命令把作业置于前台
可以用fg内置命令把后台作业置于前台运行.fg命令用作业号作为参数,如果没有提供任何作业号码,将在前台运行当前
作业.

[root@sidatabase oradata]# fg 1
cp -i system20130708.dmp / > cp.txt 2> /dev/null

cp -i system20130708.dmp / > cp.txt 2> /dev/null正在前台运行,因此,当进程仍在运行时,shell不会发送打印提示
符.

用ctrl+z挂起前台作业
ctrl+z控制组合键是挂起进程的一种方法.当用户挂起前台命令时,仔细观察bash shell的输出,会发现bash shell把任何
挂起的前台进程都看成作业.

[root@sidatabase oradata]# fg 1
cp -i system20130708.dmp / > cp.txt 2> /dev/null
^Z
[1]+  Stopped                 cp -i system20130708.dmp / > cp.txt 2> /dev/null
[root@sidatabase oradata]# jobs
[1]+  Stopped                 cp -i system20130708.dmp / > cp.txt 2> /dev/null

[root@sidatabase oradata]# ps u
USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
root      3297  0.0  0.0   4056   544 tty2     Ss+  Aug09   0:00 /sbin/mingetty
root      3299  0.0  0.0   4056   540 tty3     Ss+  Aug09   0:00 /sbin/mingetty
root      3301  0.0  0.0   4056   540 tty4     Ss+  Aug09   0:00 /sbin/mingetty
root      3303  0.0  0.0   4056   540 tty5     Ss+  Aug09   0:00 /sbin/mingetty
root      3305  0.0  0.0   4056   544 tty6     Ss+  Aug09   0:00 /sbin/mingetty
root      3345  0.0  0.0 129680 25964 tty1     Ss+  Aug09   5:39 /usr/bin/Xorg :
root      6828  0.0  0.0 108452  1932 pts/0    Ss   08:46   0:00 -bash
root     25925 37.0  0.0 113636   896 pts/0    T    11:12   1:36 cp -i system201
root     27324 12.0  0.0 110232  1168 pts/0    R+   11:16   0:00 ps u

当进程被挂起(即被停止)时,被分配给一个作业号码(如果没有的话),并被置于后台.jobs命令把该作业报告成”停止的”
作业.ps命令确定进程处于停止(挂起)状态.

重新启动挂起在后台的作业
挂起在后台的作业可以用bg内置命令重新启动.像fg命令一样,bg命令把作业号码作为参数,或者,如果没有提供任何
作业号码,就使用当前作业

[root@sidatabase oradata]# bg 1
[1]+ cp -i system20130708.dmp / > cp.txt 2> /dev/null &
[root@sidatabase oradata]# jobs
[1]+  Running                 cp -i system20130708.dmp / > cp.txt 2> /dev/null &
[root@sidatabase oradata]#

作业号码1现在再次处于运行状态

]]>
http://www.jydba.net/index.php/archives/638/feed 0
Linux系统下挂载NTFS移动硬盘的一个例子 http://www.jydba.net/index.php/archives/294 http://www.jydba.net/index.php/archives/294#comments Wed, 05 Jun 2013 02:02:16 +0000 http://www.jydba.net/?p=294 先要下载ntfs-3g

下载地址:http://www.tuxera.com/community/ntfs-3g-download/
步骤一:解压安装NTFS-3G。

tar -xvzf ntfs-3g_ntfsprogs-2013.1.13.tgz

cd ntfs-3g_ntfsprogs-2013.1.13
执行安装过程如下所示:
  ./configure
  make
  make install
  之后系统会提示安装成功,下面就可以用ntfs-3g来实现对NTFS分区的读写了
步骤二:配置挂载NTFS格式的移动硬盘

1. 首先得到NTFS分区的信息

  sudo fdisk -l | grep NTFS
[[root@node6 ~]# sudo fdisk -l | grep NTFS
/dev/sdd1   *           1      601099   312571136    7  HPFS/NTFS
[root@node6 ~]#

2. 设置挂载点,用如下命令实现挂载

[root@node6 ~]# mkdir -p /jybackup
  mount -t ntfs-3g  

[root@node6 fuse-2.7.4]# mount -t ntfs-3g /dev/sdd1 /jybackup
可能会报错
FATAL: Module fuse not found.
ntfs-3g-mount: fuse device is missing, try 'modprobe fuse' as root

意思是没找到fuse模块,下载

http://jaist.dl.sourceforge.net/sourceforge/fuse/fuse-2.7.4.tar.gz


#tar zxvf fuse-2.7.4.tar.gz

#cd fuse-2.7.4

#./configure --prefix=/usr

#make

#make install

#make clean

注意:执行./configure别忘了加参数–prefix=/usr,否则默认安装在/usr/local/lib,这样有需要编辑/etc /ld.so.conf把/usr/local/lib加进去,再执行/sbin/ldconfig,不然安装ntfs-3g会有错误。

然后再进行挂载

[root@node6 fuse-2.7.4]# mount -t ntfs-3g /dev/sdd1 /jybackup
[root@node6 fuse-2.7.4]# df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/sda2             125G   13G  106G  11% /
/dev/sda1              99M   18M   76M  20% /boot
tmpfs                  28G     0   28G   0% /dev/shm
/dev/sdc1             111G  104M  105G   1% /backup
/dev/sdd1             299G   95G  204G  32% /jybackup

从输出结果可以看到/dev/sdd1已经被mount到系统中了

3. 如果想实现开机自动挂载,可以在/etc/fstab里面添加如下格式语句
   ntfs-3g silent,umask=0,locale=zh_CN.utf8 0 0
  这样可以实现NTFS分区里中文文件名的显示。

4. 卸载分区可以用umount实现,用
  umount   或者   umount

]]>
http://www.jydba.net/index.php/archives/294/feed 1
采用scp命令在Linux系统之间copy文件 http://www.jydba.net/index.php/archives/195 http://www.jydba.net/index.php/archives/195#respond Wed, 05 Jun 2013 01:26:28 +0000 http://www.jydba.net/?p=195 复制文件或目录命令:

  复制文件:
  (1)将本地文件拷贝到 远程
  scp 文件名 –用户名 @计 算机IP或者计算机名称 :远程路径
        scp /home/test.ora root@10.138.130.29:/home/root
  (2)从远程将文件拷回本地
  scp –用户名 @计算机IP或者计算机名称 :文件名 本地路径
       scp root@10.138.130.29:/home/root     /home/test.ora
  复制目录:
  (1)将本地目录拷贝到远程
  scp -r 目录名 用 户名 @计算机IP或者计算机名称 :远程路径
        scp -r  /home/test.ora root@10.138.130.29:/home/root
  (2)从远程将目录拷回 本地
  scp -r 用户名 @计 算机IP或者计算机名称 :目录名 本地路径
       scp -r  root@10.138.130.29:/home/root     /home/
]]>
http://www.jydba.net/index.php/archives/195/feed 0
主机可以访问虚拟机的网络设置 http://www.jydba.net/index.php/archives/170 http://www.jydba.net/index.php/archives/170#comments Wed, 05 Jun 2013 01:17:09 +0000 http://www.jydba.net/?p=170 NAT方式

 右键单击主机任务栏上的网络连接图标,选择打开网络连接页面
 启动”VMware Network Adapter VMnet8” 和 “VMware Network Adapter VMnet1”这两个连接
 右键单击“本地连接”,选择属性,打开”本地连接属性”对话框,选择”高级”标签,打开高级标签页面,选中选项”允许其它网络用户通过此计算机的internet连接来连接”,然后在”家庭网络连接”下拉列表中选择VMware Network Adapter VMnet8。
 在虚拟机上右键单击你要设置的虚拟机选“setting”(因为有的不止虚拟一台),打开”Hardware”标签页,单击”device”下的ethernet,此时在右边选中NAT:Used to share the host’s IP address. 然后点击确定。
 打开虚拟机上的Edit菜单,选择virtual network settings打开virtual network editor页面,先打开automatic bridging标签页,关闭automagic bridging,点击应用;再打开DHCP标签页,启动DHCP服务,然后点击应用;最后打开NAT标签页,启动NAT服务,然后点击应用;点击确定后退出
 启动虚拟机中的系统。
 设置虚拟机中的系统的IP地址为192.168.100.200,默认网关为192.168.100.1 (VMware Network Adapter VMnet8的IP地址),DNS服务器设置和主机中的DNS服务器一致。
 重新加载网络参数或者重新启动虚拟机中的系统。
设置静态IP地址.
命令行设置(该方式只是临时设置,系统重启后失效)
设置IP和掩码
ifconfig 接口名(如eth0) IP地址 netmask 子网掩码
设置网关
route add default gw 默认网关
实例:假设设置eth0的IP:192.168.1.100,DNS:192.168.1.12
ifconfig eth0 192.168.100.200 netmask 255.255.255.0
route add default gw 192.168.100.1
修改文件来实现配置网络(需要重启网络接口重启后IP不会改变)
修改IP地址,文件:/etc/sysconfig/network-scripts/ifcfg-接口名
这里假设网络接口名为eth0.
vi /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0 (注:这里填的是网络接口名)
BOOTPROTO=static
ONBOOT=yes (注:是否随系统启动)
IPADDR=192.168.100.200(注:这里填写的是IP地址)
PREFIX=24 (注:这里填写的是掩码的长度)
NETMASK=255.255.255.0
GATEWAY=192.168.100.1( 注:这里写的是网关)就是VMware Network Adapter VMnet8的IP地址
保存退出
  #/sbin/service network restart
  如果网卡启动是OK的话就说明IP地址设定成功了。另外我们可以用ifconfig eth0来显示当前的IP来确认是否设置正确。
  利用以下命令:
  /etc/init.d/network reload 命令或service network [命令]
  重新导入该文件,实现网络启动。
关闭linux防火墙
(1) 重启后永久性生效:
开启:chkconfig iptables on
关闭:chkconfig iptables off
(2) 即时生效,重启后失效:
开启:service iptables start
关闭:service iptables stop
其实可以在虚拟机中安装系统时进行设置
]]>
http://www.jydba.net/index.php/archives/170/feed 1
linux下配置裸设备 http://www.jydba.net/index.php/archives/168 http://www.jydba.net/index.php/archives/168#respond Wed, 05 Jun 2013 01:16:32 +0000 http://www.jydba.net/?p=168 检查在机器中是否可以看到刚刚添加的虚拟盘:

[root@jyrac1 ~]# fdisk -l

Disk /dev/sda: 21.4 GB, 21474836480 bytes
255 heads, 63 sectors/track, 2610 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1          13      104391   83  Linux
/dev/sda2              14        2610    20860402+  8e  Linux LVM

Disk /dev/sdb: 1073 MB, 1073741824 bytes
255 heads, 63 sectors/track, 130 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System

Disk /dev/sdc: 1073 MB, 1073741824 bytes
255 heads, 63 sectors/track, 130 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System

Disk /dev/sdd: 32.2 GB, 32212254720 bytes
255 heads, 63 sectors/track, 3916 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System

Disk /dev/sde: 32.2 GB, 32212254720 bytes
255 heads, 63 sectors/track, 3916 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System

通过fdisk -l可以看看所有磁盘的状态,如果前期裸设备规划正确的话,在诸如/dev/sdb、/dev/sdc、/dev/sdd、/dev/sde下面是看不到任何分区信息的,这也表明这些磁盘都是干净的磁盘,不像/dev/sda那样不干净(有了文件系统)。下面我们要对/dev/sdb到/dev/sde的四块磁盘进行分区,分区过程如下图所示(这里以/dev/sdb为例,其他磁盘操作类似):

磁盘分区
需要你输入的依次是”n/p/1/回车/回车/w”。

[root@jyrac1 ~]# fdisk /dev/sdb

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

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

Calling ioctl() to re-read partition table.
Syncing disks.
[root@jyrac1 ~]#

所有磁盘分区完后

[root@jyrac1 ~]# fdisk -l

Disk /dev/sda: 21.4 GB, 21474836480 bytes
255 heads, 63 sectors/track, 2610 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1          13      104391   83  Linux
/dev/sda2              14        2610    20860402+  8e  Linux LVM

Disk /dev/sdb: 1073 MB, 1073741824 bytes
255 heads, 63 sectors/track, 130 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1         130     1044193+  83  Linux

Disk /dev/sdc: 1073 MB, 1073741824 bytes
255 heads, 63 sectors/track, 130 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sdc1               1         130     1044193+  83  Linux

Disk /dev/sdd: 32.2 GB, 32212254720 bytes
255 heads, 63 sectors/track, 3916 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sdd1               1        3916    31455238+  83  Linux

Disk /dev/sde: 32.2 GB, 32212254720 bytes
255 heads, 63 sectors/track, 3916 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sde1               1        3916    31455238+  83  Linux
[root@jyrac1 ~]#

检查分区的结果:

[root@jyrac1 linux_5.4_asmlib]# cat /proc/partitions
major minor  #blocks  name

   8     0   20971520 sda
   8     1     104391 sda1
   8     2   20860402 sda2
   8    16    1048576 sdb
   8    17    1044193 sdb1
   8    32    1048576 sdc
   8    33    1044193 sdc1
   8    48   31457280 sdd
   8    49   31455238 sdd1
   8    64   31457280 sde
   8    65   31455238 sde1
 253     0   18743296 dm-0
 253     1    2097152 dm-10
[root@racnode1 root]#

编辑/etc/udev/rules.d/60-raw.rules配置文件
#vi /etc/udev/rules.d/60-raw.rules
加载裸设备,添加以下内容
1)设置分区与RAW对应关系

ACTION=="add", KERNEL=="/dev/sdb1",RUN+="/bin/raw /dev/raw/raw1 %N"
ACTION=="add", ENV{MAJOR}=="8",ENV{MINOR}=="17",RUN+="/bin/raw /dev/raw/raw1 %M %m"
ACTION=="add", KERNEL=="/dev/sdc1",RUN+="/bin/raw /dev/raw/raw2 %N"
ACTION=="add", ENV{MAJOR}=="8",ENV{MINOR}=="33",RUN+="/bin/raw /dev/raw/raw2 %M %m"
ACTION=="add", KERNEL=="/dev/sdd1",RUN+="/bin/raw /dev/raw/raw3 %N"
ACTION=="add", ENV{MAJOR}=="8",ENV{MINOR}=="49",RUN+="/bin/raw /dev/raw/raw3 %M %m"
ACTION=="add", KERNEL=="/dev/sde1",RUN+="/bin/raw /dev/raw/raw4 %N"
ACTION=="add", ENV{MAJOR}=="8",ENV{MINOR}=="65",RUN+="/bin/raw /dev/raw/raw4 %M %m"
KERNEL=="raw[1-4]", WNER="oracle", GROUP="oinstall", MODE="640"

2)设置RAW的权限

ACTION=="add", KERNEL=="raw1", WNER="root", GROUP="oinstall", MODE="640"
ACTION=="add", KERNEL=="raw2", WNER="oracle", GROUP="oinstall", MODE="660"

如果多个RAW的权限相同可以做以下设置,如raw1,raw2权限相同:

ACTION=="add", KERNEL=="raw[1-2]", WNER="oracle", GROUP="oinstall", MODE="660"

3.重启服务
#start_udev

[root@jyrac1 ~]# start_udev
Starting udev:   [  OK  ]

4.查看raw设备
ls /dev/raw/ -l

#ls -lrt /dev/raw 或者
#raw -aq

[root@jyrac1 ~]# ls /dev/raw/ -l
total 0
crw-r----- 1 oracle oinstall 162, 1 Nov  8 15:41 raw1
crw-r----- 1 oracle oinstall 162, 2 Nov  8 15:41 raw2
crw-r----- 1 oracle oinstall 162, 3 Nov  8 15:41 raw3
crw-r----- 1 oracle oinstall 162, 4 Nov  8 15:41 raw4
[root@jyrac1 ~]# ls -lrt /dev/raw
total 0
crw-r----- 1 oracle oinstall 162, 4 Nov  8 15:41 raw4
crw-r----- 1 oracle oinstall 162, 3 Nov  8 15:41 raw3
crw-r----- 1 oracle oinstall 162, 1 Nov  8 15:41 raw1
crw-r----- 1 oracle oinstall 162, 2 Nov  8 15:41 raw2
[root@jyrac1 ~]# raw -aq
/dev/raw/raw1:  bound to major 8, minor 17
/dev/raw/raw2:  bound to major 8, minor 33
/dev/raw/raw3:  bound to major 8, minor 49
/dev/raw/raw4:  bound to major 8, minor 65
[root@jyrac1 ~]#
]]>
http://www.jydba.net/index.php/archives/168/feed 0
aix里面怎么查看实际的磁盘空间 http://www.jydba.net/index.php/archives/122 http://www.jydba.net/index.php/archives/122#respond Wed, 05 Jun 2013 00:55:48 +0000 http://www.jydba.net/?p=122 查看空间

lspv :查看系统硬盘
lspv hdisk# :查看硬盘hdisk#的空间分配情况
lsvg :查看系统VG
lsvg vg_name : 查看VG的空间分配情况
lsvg -l vg_name: 查看VG中LV分配情况以及对应的文件系统
df -k :查看文件系统使用情况。
综合这些,可以大致算出系统硬盘已分配了多少空间,实际已经使用了多少空间。
增加空间分区
AIX使用smit chfs,就会出现相应的图形界面。选择Change / Show Characteristics of an Enhanced Journaled File System,在启动选择你所需要增加的空间分区即可进行操作即可。
aix df如何查看磁盘空间 —————————-
使用df命令可以显示文件系统的大小和现在可以使用的空间大小
#df
Filesystem 512-blocks Free %Used Iused %Iused Mounted   on
//dev/hd1 540672 523240 4% 42 1% /home
/dev/SOSDBlv 35454976 7932224 78% 7608 1% /dbback
显示所有被mount上的文件系统的名称和在系统中的连接目录,文件系统的大小以512字节为单位显示在512-blocks列中,文件系统的剩余空间显示在free列中,%Used表示文件系统的当前利用率,如果接近100%系统管理员应该考虑是否增大其的空间或删除某些不需要的文件.Iuse表示文件系统索引节点的使用数量,%Iused表示索引节点的使用率,如果该值到达100%表示该文件系统没有剩余的索引节点,这时系统不能在该文件系统中再创建任何文件了.
我们可以使用
df -I命令显示文件系统已使用空间大小,
df -K可以在显示时以1024字节(K)为单位显示文件系统的大小.
df -M可以在显示时以M为单位显示文件系统的大小.
df -G可以在显示时以G为单位显示文件系统的大小.
SSYLDB.CHD.HN:/#df -g
Filesystem    GB blocks      Free %Used    Iused %Iused Mounted on
/dev/hd4           5.00      4.38   13%     5778     1% /
/dev/hd2           3.00      1.13   63%    39353    13% /usr
/dev/hd9var        5.00      4.78    5%     4455     1% /var
/dev/hd3           5.00      4.48   11%      363     1% /tmp
/dev/hd1           2.00      2.00    1%        5     1% /home
/proc                 –         –    –         –     –  /proc
/dev/hd10opt       5.00      4.89    3%     3218     1% /opt
/dev/oraclelv     20.00      9.68   52%    71346     4% /oracle
/dev/data01lv    200.00     72.98   64%       28     1% /data01
/dev/data02lv    200.00     68.81   66%       28     1% /data02
/dev/data03lv    200.00    117.80   42%       24     1% /data03
/dev/data04lv    198.00    122.00   39%       15     1% /data04
/dev/backlv      277.50     28.22   90%       25     1% /back
/dev/redolv      121.50     58.96   52%       29     1% /redo
———数据恢复 oracle数据库恢复专家 13352468096 QQ:9417901 网站:http://www.sosdb.com—–
在unix/linux下查看磁盘空间
rx6600-1:[/]#bdf
Filesystem          kbytes    used   avail %used Mounted on
/dev/vg00/lvol3     983040  300264  677848   31% /
/dev/vg00/lvol1    1835008  128520 1693256    7% /stand
/dev/vg00/lvol8    8912896 7241592 1658304   81% /var
/dev/vg00/lvol7    7962624 2848000 5074688   36% /usr
/dev/vg00/lvol4     524288  114280  407072   22% /tmp
/dev/vg00/tmplv    2064384   94121 1847371    5% /oratmp
/dev/vg00/orasoft  8192000 1325345 6437546   17% /orasoft
/dev/vg00/oracle   20480000 10857345 9021286   55% /oracle
/dev/vg00/lvol6    9076736 5783528 3267552   64% /opt
/dev/vg00/lvol5     131072  106280   24632   81% /home
/dev/datavg1/datavg1lv
                   1024000000 477848087 512017566   48% /u01
/dev/datavg2/datavg2lv
                   307200000 292627160 13662092   96% /u02
rx6600-1:[/]#
du 查看目录大小
   -m 以兆为单位显示各级目录的大小
   -s 只显示第一级目录的大小
   –max-depth=n 显示目录的深度 n为数字 du -s 和du –max-depth=0 效果是一样的
df -h 统计磁盘的使用率
fdisk -l 查看分区情况
free 查看内存和交换分区的使用情况
]]>
http://www.jydba.net/index.php/archives/122/feed 0