本篇共分为以下几个部分
- 介绍Oracle Validated Configurations
- 安装Oracle Validated Configurations
- 配置虚拟机1操作系统
- 克隆虚拟机,并配置虚拟机2
1.介绍Oracle Validated Configurations
Oracle Validated Configurations致力于为企业提供更简易、更快捷、成本更低的基于Linux和Oracle
VM的解决方案。该计划向我们提供经过测试和验证的体系架构,其附带的文档揭示了相关硬件、软件、存储、网络原件的最佳配置实践,以帮助系统提升性能和可收缩性并降低成本。从行业角度来说Oracle
Validated Configurations所验证的配置及提供的最佳实践文档受到Oracle合作伙伴的接受和认可,Oracle Validated
Configurations提供了推荐使用的软硬件组合的部署方案细节,这些方案已被证明是十分有益的。
Oracle Validated Configurations提供了那些好处?
Oracle Validated
Configurations是对系统底层组件在高负载下良好工作的有力保证,同时这些推荐配置也在实践中被证明是易于快速部署的。其有助于:
- 实现标准化的、具有可扩展性、高可用的且成本低廉的解决方案
- 加速并简化在Linux上部署Oracle软件(自动选择需要的包,自动对kernel进行相关配置,创建oracle用户等)
- 为最终用户降低了测试系统所要花费的昂贵成本
- 转嫁了用户的风险
那么Oracle Validated Configurations和最早推出的Oracle Product
Certification有什么区别?
传统的Oracle Product
Certification在认证某个操作系统平台后,可以确认Oracle的相关产品完全支持该系统平台。而Oracle Validated
Configurations则通过测试验证更进一步提供了完整的组件组合信息,这些信息包括针对软硬件、存储的版本、设置、补丁的推荐值,而这些推荐值来源于Oracle及其合作伙伴的Linux测试实验室中高压测试的经验。
2.安装Oracle Validated Configurations
Oracle Enterprise Linux中提供了oracle-validated RPM软件包,通过使用OEL
DVD介质上的该包我们可以更简单地部署安装Oracle产品所需要的软件包环境,特别是对于Oracle
Database的安装来说有了以上特性后显得特别简单。
通过安装DVD介质使用oracle-validate软件包的步骤如下:
1.创建介质装载目录/media/disk: mkdir /media/disk
2.插入OEL DVD光盘
3.装载目录:
[root@vrh1 ~]# mkdir
/media/disk
[root@vrh1 ~]# mount -o loop /dev/cdrom
/media/disk
4.创建yum源
[root@vrh1 ~]# touch
/etc/yum.repos.d/public-yum-el5.repo
[root@vrh1 ~]# vi
/etc/yum.repos.d/public-yum-el5.repo
[oel5]name = Enterprise Linux 5.5 DVD
baseurl=file:///media/disk/Server/
gpgcheck=0
enabled=1
5.正式安装oracle-validated软件包环境,使用yum install oracle-validated 命令:
[root@vrh1 ~]# yum install
oracle-validated
Loaded plugins: rhnplugin,
security
This system is not registered with
ULN.
ULN support will be
disabled.
oel5 | 1.1
kB 00:00
oel5/primary | 1.4
MB 00:00
oel5 3275/3275
Setting up Install Process
Resolving
Dependencies
-->
Running transaction check
---> Package oracle-validated.x86_64 0:1.1.0-14.el5 set to be
updated
oel5/filelists | 3.1
MB 00:00
--> Processing
Dependency: gdb for
package: oracle-validated
--> Processing Dependency:
sysstat for package: oracle-validated
--> Processing
Dependency: /usr/lib/libaio.so for package: oracle-validated
--> Processing Dependency:
glibc-headers for
package: oracle-validated
--> Processing Dependency:
unixODBC-devel for
package: oracle-validated
--> Processing Dependency:
/usr/lib64/libodbccr.so for
package: oracle-validated
--> Processing Dependency:
gcc-c++ for package: oracle-validated
--> Processing Dependency:
libaio-devel for
package: oracle-validated
--> Processing Dependency: gcc
for package:
oracle-validated
--> Processing
Dependency: elfutils-libelf-devel for package: oracle-validated
--> Processing Dependency:
compat-gcc-34-c++ for package: oracle-validated
--> Processing
Dependency: /usr/lib/gcc/x86_64-redhat-linux/4.1.1/libstdc++.a for package: oracle-validated
--> Processing
Dependency: /usr/lib/libodbc.so.1 for package: oracle-validated
--> Processing
Dependency: compat-gcc-34 for package: oracle-validated
--> Processing
Dependency: /usr/lib/libc.so for package: oracle-validated
--> Processing Dependency:
/usr/lib64/libaio.so for
package: oracle-validated
--> Processing Dependency:
/usr/lib64/libc.so for package: oracle-validated
--> Processing
Dependency: /usr/lib/libodbccr.so for package: oracle-validated
--> Processing Dependency:
kernel-headers for
package: oracle-validated
--> Processing Dependency:
libXp.so.6 for
package: oracle-validated
--> Processing Dependency:
libdb-4.2.so()(64bit) for package: oracle-validated
--> Processing Dependency:
libodbc.so.1()(64bit)
for package:
oracle-validated
--> Running transaction
check
---> Package compat-db.x86_64
0:4.2.52-5.1 set to be updated
---> Package compat-gcc-34.x86_64 0:3.4.6-4.1 set to be updated
---> Package compat-gcc-34-c++.x86_64 0:3.4.6-4.1 set to be updated
---> Package elfutils-libelf-devel.x86_64 0:0.137-3.el5 set to be
updated
-->
Processing Dependency: elfutils-libelf-devel-static-x86_64 = 0.137-3.el5 for package: elfutils-libelf-devel
---> Package gcc.x86_64 0:4.1.2-51.el5 set to be updated
---> Package gcc-c++.x86_64 0:4.1.2-51.el5 set to be
updated
---> Package gdb.x86_64 0:7.0.1-37.el5 set to be
updated
---> Package glibc-devel.i386
0:2.5-65 set to be updated
---> Package glibc-devel.x86_64
0:2.5-65 set to be updated
---> Package glibc-headers.x86_64 0:2.5-65
set to be updated
---> Package kernel-uek-headers.x86_64 0:2.6.32-200.13.1.el5uek set to be updated
---> Package libXp.i386 0:1.0.0-8.1.el5 set to be updated
---> Package libaio-devel.i386
0:0.3.106-5
set to be updated
---> Package libaio-devel.x86_64 0:0.3.106-5 set to be updated
---> Package libstdc++-devel.x86_64 0:4.1.2-51.el5 set to be
updated
---> Package sysstat.x86_64 0:7.0.2-11.el5 set to be updated
---> Package unixODBC.i386 0:2.2.11-7.1 set to be updated
---> Package unixODBC.x86_64 0:2.2.11-7.1 set to be updated
---> Package unixODBC-devel.i386
0:2.2.11-7.1 set to be updated
---> Package unixODBC-devel.x86_64 0:2.2.11-7.1
set to be updated
--> Running transaction check
---> Package elfutils-libelf-devel-static.x86_64 0:0.137-3.el5 set to be updated
--> Finished Dependency
Resolution
Dependencies Resolved
================================================================================
Package Arch Version Repository
Size
================================================================================
Installing:
oracle-validated x86_64 1.1.0-14.el5 oel5 24
k
Installing for dependencies:
compat-db x86_64 4.2.52-5.1 oel5 1.6 M
compat-gcc-34 x86_64 3.4.6-4.1 oel5 4.3 M
compat-gcc-34-c++ x86_64 3.4.6-4.1 oel5 13
M
elfutils-libelf-devel x86_64 0.137-3.el5 oel5 24
k
elfutils-libelf-devel-static x86_64 0.137-3.el5 oel5 64
k
gcc x86_64 4.1.2-51.el5 oel5 5.3 M
gcc-c++ x86_64 4.1.2-51.el5 oel5 3.8
M
gdb x86_64 7.0.1-37.el5 oel5 2.4 M
glibc-devel i386 2.5-65 oel5 2.0 M
glibc-devel x86_64 2.5-65 oel5 2.4 M
glibc-headers x86_64 2.5-65 oel5 594
k
kernel-uek-headers x86_64 2.6.32-200.13.1.el5uek oel5 724
k
libXp i386 1.0.0-8.1.el5 oel5 22
k
libaio-devel i386 0.3.106-5 oel5 12
k
libaio-devel x86_64 0.3.106-5 oel5 11
k
libstdc++-devel x86_64 4.1.2-51.el5 oel5 2.8
M
sysstat x86_64 7.0.2-11.el5 oel5 187
k
unixODBC i386 2.2.11-7.1 oel5 830
k
unixODBC x86_64 2.2.11-7.1 oel5 835
k
unixODBC-devel i386 2.2.11-7.1 oel5 743 k
unixODBC-devel x86_64 2.2.11-7.1 oel5 799 k
Transaction Summary
================================================================================
Install 22 Package(s)
Upgrade 0
Package(s)
Total download size: 42 M
Is this ok [y/N]: y
Downloading Packages:
--------------------------------------------------------------------------------
Total 1.2 GB/s | 42 MB 00:00
Running
rpm_check_debug
Running Transaction Test
Finished Transaction
Test
Transaction Test Succeeded
Running
Transaction
Installing :
unixODBC 1/22
Installing :
gdb 2/22
Installing :
compat-db 3/22
Installing :
sysstat 4/22
Installing :
kernel-uek-headers 5/22
Installing :
glibc-headers 6/22
Installing :
glibc-devel 7/22
Installing :
compat-gcc-34 8/22
Installing :
libstdc++-devel 9/22
Installing :
glibc-devel 10/22
Installing :
unixODBC-devel 11/22
Installing :
libaio-devel 12/22
Installing :
libaio-devel 13/22
Installing :
unixODBC 14/22
Installing :
libXp 15/22
Installing :
gcc 16/22
Installing :
gcc-c++ 17/22
Installing :
compat-gcc-34-c++ 18/22
Installing :
unixODBC-devel 19/22
Installing :
elfutils-libelf-devel 20/22
Installing :
oracle-validated 21/22
Installing :
elfutils-libelf-devel-static 22/22
Installed:
oracle-validated.x86_64
0:1.1.0-14.el5
Dependency
Installed:
compat-db.x86_64 0:4.2.52-5.1
compat-gcc-34.x86_64 0:3.4.6-4.1
compat-gcc-34-c++.x86_64 0:3.4.6-4.1
elfutils-libelf-devel.x86_64 0:0.137-3.el5
elfutils-libelf-devel-static.x86_64 0:0.137-3.el5
gcc.x86_64 0:4.1.2-51.el5
gcc-c++.x86_64 0:4.1.2-51.el5
gdb.x86_64
0:7.0.1-37.el5
glibc-devel.i386 0:2.5-65
glibc-devel.x86_64 0:2.5-65
glibc-headers.x86_64 0:2.5-65
kernel-uek-headers.x86_64 0:2.6.32-200.13.1.el5uek
libXp.i386 0:1.0.0-8.1.el5
libaio-devel.i386 0:0.3.106-5
libaio-devel.x86_64 0:0.3.106-5
libstdc++-devel.x86_64 0:4.1.2-51.el5
sysstat.x86_64
0:7.0.2-11.el5
unixODBC.i386
0:2.2.11-7.1
unixODBC.x86_64
0:2.2.11-7.1
unixODBC-devel.i386 0:2.2.11-7.1
unixODBC-devel.x86_64 0:2.2.11-7.1
Complete!
完成对oracle-validated的安装后操作系统软件包环境也就水道渠成了,此外该oracle-validated包还会帮助我们设置必要的Linux内核参数,具体来说它会修改/etc/sysctl.conf配置文件中的参数到Oracle推荐的值,以下为完成oracle-validated安装后的sysctl.conf,供参考:
[root@vrh1 ~]# cat
/etc/sys
sysconfig/ sysctl.conf.orabackup
sysctl.conf syslog.conf
[root@vrh1
~]# cat
/etc/sysctl.conf
# Kernel sysctl configuration
file for Oracle Enterprise Linux
#
# For binary values, 0 is disabled, 1 is enabled. See sysctl(8)
and
# sysctl.conf(5) for more
details.
# Controls IP packet
forwarding
net.ipv4.ip_forward = 0
# Controls source route
verification
# See
/usr/share/doc/kernel-doc-*/Documentation/networking/ip-sysctl.txt
net.ipv4.conf.default.rp_filter
= 2
# Do not accept source
routing
net.ipv4.conf.default.accept_source_route = 0
# Controls the System Request debugging functionality of the
kernel
# Controls whether core dumps will
append the PID to the core filename
# Useful for
debugging multi-threaded applications
kernel.core_uses_pid = 1
# Controls the use of TCP
syncookies
net.ipv4.tcp_syncookies = 1
# Controls the maximum size
of a message, in bytes
# Controls the default
maxmimum size of a mesage queue
# Controls
the maximum shared segment size, in bytes
#
Controls the maximum number of shared memory segments, in
pages
# For 11g, Oracle-Validated setting for
fs.file-max is 6815744
# For 10g, uncomment
'fs.file-max = 327679', and comment 'fs.file-max = 6553600' entry and re-run
sysctl -p
# fs.file-max =
327679
fs.file-max = 6815744
# Oracle-Validated setting for kernel.msgmni is
2878
kernel.msgmni = 2878
# Oracle-Validated setting
for kernel.msgmax is 8192
kernel.msgmax =
8192
# Oracle-Validated
setting for kernel.msgmnb is 65536
kernel.msgmnb = 65536
# Oracle-Validated setting for kernel.sem is '250 32000 100
142'
kernel.sem = 250 32000 100 142
# Oracle-Validated setting for kernel.shmmni is
4096
kernel.shmmni = 4096
# Oracle-Validated setting
for kernel.shmall is 1073741824
kernel.shmall = 1073741824
# Oracle-Validated setting for kernel.shmmax is 4398046511104 on
x86_64 and 4294967295 on i386 architecture. Refer Note id
567506.1
kernel.shmmax = 4398046511104
#
Oracle-Validated setting for kernel.sysrq is 1
kernel.sysrq = 1
# Oracle-Validated setting for net.core.rmem_default is
262144
net.core.rmem_default = 262144
# For 11g,
Oracle-Validated setting for net.core.rmem_max is 4194304
# For 10g, uncomment 'net.core.rmem_max = 2097152', comment
'net.core.rmem_max = 4194304' entry and re-run sysctl -p
# net.core.rmem_max = 2097152
net.core.rmem_max = 4194304
# Oracle-Validated setting for net.core.wmem_default is
262144
net.core.wmem_default = 262144
# For 11g,
Oracle-Validated setting for net.core.wmem_max is 1048576
# For 10g, uncomment 'net.core.wmem_max = 262144', comment
'net.core.wmem_max = 1048576' entry for this parameter and re-run sysctl
-p
# net.core.wmem_max =
262144
net.core.wmem_max = 1048576
# Oracle-Validated
setting for fs.aio-max-nr is 3145728
fs.aio-max-nr = 3145728
# For 11g, Oracle-Validated setting for
net.ipv4.ip_local_port_range is 9000 65500
# For
10g, uncomment 'net.ipv4.ip_local_port_range = 1024 65000', comment
'net.ipv4.ip_local_port_range = 9000 65500' entry and re-run sysctl
-p
# net.ipv4.ip_local_port_range = 1024
65000
net.ipv4.ip_local_port_range = 9000 65500
# Oracle-Validated setting for vm.min_free_kbytes is 51200 to
avoid OOM killer
vm.min_free_kbytes = 51200
oracle-validated包还会帮助我们修改/etc/security/limits.conf配置以获得合理的shell
limit:
[root@vrh1 ~]# ulimit
-a
core file size (blocks, -c)
0
data seg size (kbytes, -d) unlimited
scheduling priority (-e) 0
file
size (blocks, -f) unlimited
pending
signals (-i) 15977
max locked memory (kbytes, -l) 64
max memory
size (kbytes, -m) unlimited
open
files (-n) 1024
pipe size (512 bytes, -p) 8
POSIX message queues (bytes, -q) 819200
real-time priority (-r)
0
stack size (kbytes, -s) 8192
cpu
time (seconds, -t) unlimited
max
user processes (-u) 15977
virtual memory (kbytes, -v) unlimited
file locks (-x) unlimited
[root@vrh1 ~]# cat
/etc/security/limits.conf
#
/etc/security/limits.conf
#
#Each line describes a limit for a user in the
form.:
# -
#Where:
# can
be:
# - an user name
# - a group name, with @group syntax
# - the wildcard *, for default entry
# - the wildcard %, can be also used with %group
syntax,
# for maxlogin
limit
# can have the two
values:
# - "soft" for enforcing the soft
limits
# - "hard" for enforcing hard
limits
#- can be one of the
following:
# - core - limits the core file
size (KB)
# - data - max data size
(KB)
# - fsize - maximum filesize
(KB)
# - memlock - max locked-in-memory
address space (KB)
# - nofile - max number
of open files
# - rss - max resident set
size (KB)
# - stack - max stack size
(KB)
# - cpu - max CPU time
(MIN)
# - nproc - max number of
processes
# - as - address space
limit
# - maxlogins - max number of logins
for this user
# - maxsyslogins - max number
of logins on the system
# - priority - the
priority to run user process with
# - locks
- max number of file locks the user can hold
# - sigpending - max number of pending
signals
# - msgqueue - max memory used by
POSIX message queues (bytes)
# - nice - max
nice priority allowed to raise to
# -
rtprio - max realtime priority
# -
#* soft core 0
#* hard rss 10000
#@student hard nproc 20
#@faculty soft nproc 20
#@faculty hard nproc 50
#ftp hard nproc 0
#@student - maxlogins 4
# End of file
#
Oracle-Validated setting for nofile soft limit is
131072
oracle soft nofile 131072
# Oracle-Validated
setting for nofile hard limit is
131072
oracle hard nofile 131072
# Oracle-Validated
setting for nproc soft limit is 131072
oracle soft nproc 131072
# Oracle-Validated
setting for nproc hard limit is 131072
oracle hard nproc 131072
# Oracle-Validated
setting for core soft limit is
unlimited
oracle soft core unlimited
# Oracle-Validated setting for core hard limit is
unlimited
oracle hard core unlimited
# Oracle-Validated setting for memlock soft limit is
50000000
oracle soft memlock 50000000
# Oracle-Validated
setting for memlock hard limit is
50000000
oracle hard memlock 50000000
3.配置Oracle Enterprise Linux
1.创建安装目录(最佳实践)
[root@vrh1 ~]# mkdir
/s01
[root@vrh1 ~]#
chown oracle:oinstall /s01/
2.修改oracle用户密码
oracle-validated帮助我们创建了oracle用户和oinstall组,我们需要对其进行修改密码
[root@vrh1 ~]# id
oracle
uid=54321(oracle) gid=54321(oinstall) groups=54321(oinstall),54322(dba)
[root@vrh1 ~]# passwd oracle
Changing password for user oracle.
New UNIX password:
BAD PASSWORD: it is based
on a dictionary word
Retype new UNIX password:
passwd: all authentication
tokens updated successfully.
3.修改主机名和配置对应的DNS
[root@vrh1 ~]# vi /etc/hosts
# Do not remove the
following line, or various programs
# that require network functionality will
fail.
127.0.0.1 vrh1.oracle.com vrh1 localhost.localdomain
localhost
::1 localhost6.localdomain6
localhost6
以上默认配置127.0.0.1是不标准的,需要修改为以下格式
# Do not remove the following line, or various
programs
# that require network functionality will
fail.
127.0.0.1 localhost.localdomain localhost
::1 localhost6.localdomain6
localhost6
192.168.1.101 vrh1 vrh1.oracle.com
192.168.1.102 vrh1-vip
192.168.1.103 vrh2 vrh2.oracle.com
192.168.1.104 vrh2-vip
172.168.1.201 vrh1-priv
172.168.1.202 vrh2-priv
连通性测试
[root@vrh1 ~]# ifconfig
-a
eth0 Link encap:Ethernet HWaddr
08:00:27:C6:B1:91
inet addr:192.168.1.101 Bcast:192.168.1.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:3735 errors:0 dropped:0 overruns:0 frame:0
TX packets:4319 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:367951 (359.3 KiB) TX bytes:779549 (761.2
KiB)
eth1 Link encap:Ethernet HWaddr
08:00:27:E3:B0:28
inet addr:172.168.1.201 Bcast:172.168.1.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:20 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 b) TX bytes:2537 (2.4 KiB)
lo Link
encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK
RUNNING MTU:16436 Metric:1
RX packets:1402 errors:0 dropped:0 overruns:0 frame:0
TX packets:1402 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:3388768 (3.2 MiB) TX bytes:3388768 (3.2 MiB)
[root@vrh1 ~]# ping vrh1
PING vrh1 (192.168.1.101) 56(84) bytes of data.
64 bytes from vrh1 (192.168.1.101): icmp_seq=1 ttl=64 time=0.043 ms
64 bytes from vrh1
(192.168.1.101): icmp_seq=2 ttl=64 time=0.053 ms
[root@vrh1 ~]# ping vrh1-priv
PING
vrh1-priv (172.168.1.201) 56(84) bytes of data.
64 bytes
from vrh1-priv (172.168.1.201): icmp_seq=1 ttl=64 time=0.054 ms
64 bytes from
vrh1-priv (172.168.1.201): icmp_seq=2 ttl=64 time=0.369 ms
这样第一台虚拟机就配置好了,下面我们将克隆该虚拟机。
4.克隆虚拟机,并配置虚拟机主机2
记得要重新初始化MAC地址
完全克隆
复制完成后可以检查下物理硬件配置(网卡、cpu、内存)与虚拟机1的配置是一样的,接下来我们需要对虚拟机2进行修改主机名和网卡的使用
取消掉设备中的ISO 镜像
重启系统
删除掉系统中bak的网卡,并激活没有bak的网卡
修改网卡IP地址
修改主机名
网络测试
[root@vrh2 ~]# ping
vrh2
PING vrh2 (192.168.1.103) 56(84) bytes of data.
64 bytes
from vrh2 (192.168.1.103): icmp_seq=1 ttl=64 time=0.046 ms
64 bytes from vrh2 (192.168.1.103): icmp_seq=2 ttl=64 time=0.053 ms
^C
--- vrh2 ping statistics ---
2 packets transmitted, 2
received, 0% packet loss,
time 999ms
rtt min/avg/max/mdev = 0.046/0.049/0.053/0.007 ms
[root@vrh2 ~]# ping vrh2-priv
PING vrh2-priv (172.168.1.202) 56(84) bytes of data.
64 bytes
from vrh2-priv (172.168.1.202): icmp_seq=1 ttl=64 time=0.050 ms
64 bytes from
vrh2-priv (172.168.1.202): icmp_seq=2 ttl=64 time=0.053 ms
^C
--- vrh2-priv ping statistics ---
2 packets transmitted,
2 received, 0% packet loss, time 999ms
rtt
min/avg/max/mdev = 0.050/0.051/0.053/0.007 ms
修改启动模式为文本模式
[root@vrh2 ~]# vi
/etc/inittab
id:3:initdefault:
这样就完成本节的学习了。关闭虚拟机2
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/15693674/viewspace-767285/
,如需转载,请注明出处,否则将追究法律责任。