In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
Chapter I basic Environment deployment 1.1, Environment
Operating system: SuSE Linux Enterprise Server 11SP3
Database: Oracle 11gR2 (112040)
Node 1
Hostname: jason1
Ip address:
10.18.199.209 jason1
10.0.0.1 jason1-priv
10.18.199.221 jason1-vip
ORACLE_SID:ORACLE1
SCANIP: 10.18.199.223
Node 2
Hostname: jason2
Ip address:
10.18.199.210 jason2
10.0.0.2 jason2-priv
10.18.199.222 jason2-vip
ORACLE_SID:ORACLE2
SCANIP: 10.18.199.223
Shared storage:
Device name
Size
Action
/ dev/sdb
2g
OCR_VOTE
/ dev/sdc
5g
Database archive log
/ dev/sdd
15g
Database file
1.2. Create an account
Create the following accounts on both servers.
Groupadd-g 1000 oinstall
Groupadd-g 1200asmadmin
Groupadd-g 1201asmdba
Groupadd-g 1202asmoper
Useradd-m-u 1100-goinstall-G asmadmin,asmdba,asmoper-d / home/grid-s / bin/bash grid
Groupadd-g 1300 dba
Groupadd-g 1301oper
Useradd-m-u 1101-goinstall-G dba,oper,asmdba-d / home/oracle-s / bin/bash oracle
Mkdir-p / u01/app/grid
Mkdir-p / u01/app/11.2.0/grid
Chown-R grid:oinstall/u01
Mkdir-p / u01/app/oracle
Chown-R oracle:oinstall/u01/app/oracle
Chmod-R 775 / U01
Passwd oracle
1.3.Configuring hosts files
Configure two server hosts files.
# vi / etc/hosts
10.18.199.209 jason1
10.0.0.1 jason1-priv
10.18.199.221 jason1-vip
10.18.199.210 jason2
10.0.0.2 jason2-priv
10.18.199.222 jason2-vip
10.18.199.223 jason-cluster jason-cluster-scan
1.4.Install required rpm packages
Both nodes view the required rpm packages and install the required rpm packages.
# rpm-q binutils gcc gcc-32bit gcc-c++ glibc glibc-32bitglibc-devel glibc-devel-32bit ksh libaio libaio-32bit libaio-devellibaio-devel-32bit libstdc++33 libstdc++33-32bitlibstdc++43 libstdc++43- 32bitlibstdc++43-devel libstdc++43-devel-32bit libgcc43 libstdc++-devel make sysstatunixODBC unixODBC-devel unixODBC-32bit unixODBC-devel-32bit libcap1
Binutils-2.23.1-0.17.18
Gcc-4.3-62.198
Gcc-32bit-4.3-62.198
Gcc-c++-4.3-62.198
Glibc-2.11.3-17.54.1
Glibc-32bit-2.11.3-17.54.1
Glibc-devel-2.11.3-17.54.1
Glibc-devel-32bit-2.11.3-17.54.1
Ksh-93u-0.18.1
Libaio-0.3.109-0.1.46
Libaio-32bit-0.3.109-0.1.46
Libaio-devel-0.3.109-0.1.46
Libaio-devel-32bit-0.3.109-0.1.46
Libstdc++33-3.3.3-11.9
Libstdc++33-32bit-3.3.3-11.9
Libstdc++43-4.6.9-0.11.38
Libstdc++43-32bit-4.6.9-0.11.38
Libstdc++43-devel-4.3.4_20091019-0.37.30
Libstdc++43-devel-32bit-4.3.4_20091019-0.37.30
Libgcc43-4.6.9-0.11.38
Libstdc++-devel-4.3-62.198
Make-3.81-128.20
Sysstat-8.1.5-7.45.24
UnixODBC-2.2.12-198.17
UnixODBC-devel-2.2.12-198.17
UnixODBC-32bit-2.2.12-198.17
UnixODBC-devel-32bit-2.2.12-198.17
Libcap1-1.10-6.10
1.5. Modify kernel parameters
Set kernel parameters for two servers
# vi / etc/sysctl.conf
Net.ipv4.icmp_echo_ignore_broadcasts = 1
Net.ipv4.conf.all.rp_filter = 1
Fs.inotify.max_user_watches = 65536
Net.ipv4.conf.default.promote_secondaries = 1
Net.ipv4.conf.all.promote_secondaries = 1
Fs.aio-max-nr = 1048576
Fs.file-max = 6815744
Kernel.shmall = 2097152
Kernel.shmmax = 978288640
Kernel.shmmni = 4096
Kernel.sem = 250 32000 100 128
Net.ipv4.ip_local_port_range = 9000 65500
Net.core.rmem_default = 262144
Net.core.rmem_max = 4194304
Net.core.wmem_default = 262144
Net.core.wmem_max = 1048576
Vm.hugetlb_shm_group= 1000 # here is oinstall group number
1.6. set Shell restrictions on Oracle and grid users
# vi / etc/security/limits.conf
Oracle soft nproc 2047
Oracle hard nproc 16384
Oracle soft nofile 1024
Oracle hard nofile 65536
Grid soft nproc 2047
Grid hard nproc 16384
Grid soft nofile 1024
Grid hard nofile 65536
Edit / etc/pam.d/login and add the following:
Vi / etc/pam.d/login
Session required pam_limits.so
1.7. disable the NTP service
Disable NTP services on both servers
Service ntp stop
Chkconfig ntp off
Mv / etc/ntp.conf / etc/ntp.conf.bak
1.8user environment variables of grid
Node 1
Export ORACLE_SID=+ASM1
Export ORACLE_BASE=/u01/app/grid
Export ORACLE_HOME=/u01/app/11.2.0/grid
Export PATH=$ORACLE_HOME/bin:$ORACLE_HOME/OPatch:$PATH
Export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib
Export CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib
Export ORACLE_TERM=xterm
Export NLS_DATE_FORMAT= "YYYY-MM-DD HH24:MI:SS"
Export NLS_LANG=AMERICAN_AMERICA.ZHS16GBK
Export TEMP=/tmp
Export TMPDIR=/tmp
Umask 022
If [$USER = "oracle"] | | [$USER = "grid"]; then
If [$SHELL = "/ bin/ksh"]; then
Ulimit-p16384
Ulimit-n65536
Else
Ulimit-u 16384-n65536
Fi
Umask 022
Fi
Node 2
Export ORACLE_SID=+ASM2
Export ORACLE_BASE=/u01/app/grid
Export ORACLE_HOME=/u01/app/11.2.0/grid
Export PATH=$ORACLE_HOME/bin:$ORACLE_HOME/OPatch:$PATH
Export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib
ExportCLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib
Export ORACLE_TERM=xterm
Export NLS_DATE_FORMAT= "YYYY-MM-DD HH24:MI:SS"
Export NLS_LANG=AMERICAN_AMERICA.ZHS16GBK
Export TEMP=/tmp
Export TMPDIR=/tmp
Umask 022
If [$USER = "oracle"] | | [$USER = "grid"]; then
If [$SHELL = "/ bin/ksh"]; then
Ulimit-p16384
Ulimit-n65536
Else
Ulimit-u 16384-n 65536
Fi
Umask 022
Fi
1.9. Oracle user environment variables
Node 1
Export ORACLE_SID=ORACLE1
Export ORACLE_BASE=/u01/app/oracle
Export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/dbhome_1
Export PATH=$ORACLE_HOME/bin:$ORACLE_HOME/OPatch:$PATH
Export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib
ExportCLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib
Export ORACLE_TERM=xterm
Export NLS_DATE_FORMAT= "YYYY-MM-DD HH24:MI:SS"
Export NLS_LANG=AMERICAN_AMERICA.ZHS16GBK
Export TEMP=/tmp
Export TMPDIR=/tmp
Umask 022
If [$USER = "oracle"] | | [$USER = "grid"]; then
If [$SHELL = "/ bin/ksh"]; then
Ulimit-p16384
Ulimit-n65536
Else
Ulimit-u 16384-n65536
Fi
Umask 022
Fi
Node 2
Export ORACLE_SID=ORACLE2
Export ORACLE_BASE=/u01/app/oracle
Export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/dbhome_1
Export PATH=$ORACLE_HOME/bin:$ORACLE_HOME/OPatch:$PATH
Export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib
ExportCLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib
Export ORACLE_TERM=xterm
Export NLS_DATE_FORMAT= "YYYY-MM-DD HH24:MI:SS"
Export NLS_LANG=AMERICAN_AMERICA.ZHS16GBK
Export TEMP=/tmp
Export TMPDIR=/tmp
Umask 022
If [$USER = "oracle"] | | [$USER = "grid"]; then
If [$SHELL = "/ bin/ksh"]; then
Ulimit-p16384
Ulimit-n65536
Else
Ulimit-u 16384-n65536
Fi
Umask 022
Fi
1.10. Configure asm disks using multipath
Both node 1 and node 2 are configured.
Jason1:~# fdisk-l
Disk/dev/sda: 42.9 GB, 42949672960 bytes
255heads, 63 sectors/track, 5221 cylinders, total 83886080 sectors
Units= sectors of 1 * 512 = 512 bytes
Sectorsize (logical/physical): 512 bytes / 512 bytes
I/Osize (minimum/optimal): 512 bytes / 512 bytes
Diskidentifier: 0x0005e0f3
Device Boot Start End Blocks Id System
/ dev/sda1 * 2048 208895 103424 83 Linux
/ dev/sda2 208896 8595455 4193280 82 Linux swap / Solaris
/ dev/sda3 8595456 83886079 37645312 83 Linux
Disk/dev/sdb: 5242 MB, 5242880000 bytes
162heads, 62 sectors/track, 1019 cylinders, total 10240000 sectors
Units= sectors of 1 * 512 = 512 bytes
Sectorsize (logical/physical): 512 bytes / 512 bytes
I/Osize (minimum/optimal): 512 bytes / 512 bytes
Diskidentifier: 0x00000000
Disk/dev/sdb doesn't contain a valid partition table
Disk/dev/sdc: 2147 MB, 2147483648 bytes
67heads, 62 sectors/track, 1009 cylinders, total 4194304 sectors
Units= sectors of 1 * 512 = 512 bytes
Sectorsize (logical/physical): 512 bytes / 512 bytes
I/Osize (minimum/optimal): 512 bytes / 512 bytes
Diskidentifier: 0x00000000
Disk/dev/sdc doesn't contain a valid partition table
Disk/dev/sdd: 15.7 GB, 15728640000 bytes
64heads, 32 sectors/track, 15000 cylinders, total 30720000 sectors
Units= sectors of 1 * 512 = 512 bytes
Sectorsize (logical/physical): 512 bytes / 512 bytes
I/Osize (minimum/optimal): 512 bytes / 512 bytes
Diskidentifier: 0x00000000
Disk/dev/sdd doesn't contain a valid partition table
Jason1:~#
Edit the / etc/multipath.conf file to configure multipathing software.
Defaults {
Polling_interval 5
Path_selector "round-robin 0"
Path_grouping_policy failover
Uid_attribute "ID_SERIAL"
Getuid_callout "/ lib/udev/scsi_id-- whitelisted-- device=/dev/%n"
Path_checker directio
Rr_weight uniform
Failback immediate
Queue_without_daemon yes
Mode 0644
Uid 1100
Gid 1200
Checker_timeout 30
}
Blacklist {
Devnode "^ sda"
Devnode "ofsctl"
}
Multipaths {
Multipath {
Wwid 24d3963ec66158aac
Alias ASMOCR
Path_grouping_policy failover
User_friendly_names yes
Path_selector "round-robin 0"
Failback immediate
Rr_weight uniform
}
Multipath {
Wwid 2a188df0f367ec9ad
Alias ASMFRA
Path_grouping_policy failover
User_friendly_names yes
Path_selector "round-robin 0"
Failback immediate
Rr_weight uniform
}
Multipath {
Wwid 291bbf9b896a0f503
Alias ASMDATA
Path_grouping_policy failover
User_friendly_names yes
Path_selector "round-robin 0"
Failback immediate
Rr_weight uniform
}
}
Add / etc/udev/rules.d/99-oracle-asmdevices.rules file and modify device file permissions.
Use the following command to query
For i in 1 2 3
Do
Echo "KERNEL==\" dm-*\ ", SUBSYSTEM==\" block\ ", PROGRAM==\" / sbin/scsi_id-- whitelisted-- replace-whitespace-- device=/dev/\ $name\ ", RESULT==\" `/ sbin/scsi_id-- whitelisted-- replace-whitespace-- device=/dev/dm-$ i` ", OWNER=\" grid\ ", GROUP=\" asmadmin\ ", MODE=\" 0660\ "
Done
Jason1:~ # cd / etc/udev/rules.d/
Jason1:/etc/udev/rules.d # vi 99-oracle-asmdevices.rules
KERNEL== "dm-*", SUBSYSTEM== "block", PROGRAM== "/ sbin/scsi_id-whitelisted-replace-whitespace-device=/dev/$name", RESULT== "24d3963ec66158aac", OWNER= "grid", GROUP= "asmadmin", MODE= "0660"
KERNEL== "dm-*", SUBSYSTEM== "block", PROGRAM== "/ sbin/scsi_id-whitelisted-replace-whitespace-device=/dev/$name", RESULT== "2a188df0f367ec9ad", OWNER= "grid", GROUP= "asmadmin", MODE= "0660"
KERNEL== "dm-*", SUBSYSTEM== "block", PROGRAM== "/ sbin/scsi_id-whitelisted-replace-whitespace-device=/dev/$name", RESULT== "291bbf9b896a0f503", OWNER= "grid", GROUP= "asmadmin", MODE= "0660"
Jason1:/etc/udev/rules.d #
View the generated device name
Jason1:/dev/mapper# ll
Total0
Lrwxrwxrwx1 root root 7 Jan 20 12:37 ASMDATA- >.. / dm-2
Lrwxrwxrwx1 root root 7 Jan 20 12:33 ASMFRA- >.. / dm-0
Lrwxrwxrwx1 root root 7 Jan 20 12:37 ASMOCR- >.. / dm-1
Crw-rw----1 root root 10, 236 Jan 20 12:27 control
Jason1:/dev/mapper#
Jason1:/dev# ll dm-*
Brw-rw----1 grid asmadmin 253, 0 Jan 20 12:40 dm-0
Brw-rw----1 grid asmadmin 253, 1 Jan 20 12:40 dm-1
Brw-rw----1 grid asmadmin 253, 2 Jan 20 12:40 dm-2
Jason1:/dev#
1.11. Enable mutilipath service
Chkconfigboot.multipath on
Chkconfigmultipathd on
At this point, the RAC initialization environment has been built, and then the grid software is installed.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.