Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

CentOS 6.8system virtual based on vCenter/ESXi platform

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

Environmental preparation

Node 1: CentOS 6.8x86-64

CPU:4C memory: 8GB SWAP:8GB

Hostname: rac01 Business ip:192.168.50.21 Private Network ip:10.98.50.21 Virtual ip:192.168.50.23

Node 2: CentOS 6.8x86-64

CPU:4C memory: 8GB SWAP:8GB

Hostname: rac02 Business ip:192.168.50.22 Private Network ip:10.98.50.22 Virtual ip:192.168.50.24

SCANip:192.168.50.25 192.168.50.26 192.168.50.27

Database and cluster software:

Linuxamd64_12102_grid_1of2.zip

Linuxamd64_12102_grid_2of2.zip

Linuxamd64_12102_database_1of2.zip

Linuxamd64_12102_database_2of2.zip

Shared disk:

Here OCRVOTING, DATA and FRA use Normal. At least three disks are required, and each disk is at least 800MB.

At least one disk is required for External, and each disk is at least 400MB

High requires at least five disks, each with at least 1.2GB.

For more information, please see the RAC installation document and storage configuration section on the Oracle official website. Http://docs.oracle.com/database/121/CWLIN/storage.htm#CWLIN287

Create a virtual machine:

Use the tool VMware vSphere Client or VMware vSphere Web Client to connect to the vCenter or ESXi host, select an ESXi host, and click "create a new virtual machine" on the getting started tab

Create type customization

Name the virtual machine

Determine where the virtual machine stores the datastore

The virtual machine version can be kept by default, and if there is a need to migrate other version platforms later, you need to consider the compatibility of the version here.

Virtual machine operating system and version

The number of virtual machine CPU is configured according to the specification

Memory capacity according to specifications

Configure two virtual network cards

Scsi controller type remains default

Virtual disk Type Select "create New Virtual disk"

Set the disk capacity of the virtual machine system. In order to minimize the performance impact of the database host, it is recommended that the disk be set to "thick setting zero" and specify the data storage location.

Virtual machine device node remains default

View the virtual machine summary information, and check "Edit virtual machine configuration before you finish", and click continue.

Click add

Select hard disk for device type

Select create New Virtual disk

Create a disk with a capacity of 10GB, set thickness to zero, and specify the data storage location.

Virtual machine device node select "SCSI (1:0)"

Confirm that the summary information is correct and click finish.

According to this process, the second virtual disk and the third virtual disk are added successively, and the parameters are the same, but the differences are as follows: the virtual device nodes are "SCSI (1:1)" and "SCSI (1:2)" respectively.

Finally, the virtual machine configuration is edited, and the new SCSI controller, that is, the second SCSI controller, is changed to physical, that is, the last three virtual disks are added to achieve shared access with other virtual machines.

Finish and start to create the first virtual machine, and follow this process to create a new virtual machine. The process is similar to the above, but name the virtual machine in different places.

Finally, add three disks and select "use existing virtual disks" here.

Click to browse

Navigate to the data storage location of the three disks of the first virtual machine

Open the folder named by the first virtual machine

The three virtual disks with 10GB capacity are the three disks used by the first virtual machine.

Add the first disk to the second virtual machine in order to achieve sharing.

Here, the virtual device node is still selected in the order of "SCSI (1:0) to SCSI (1:2)", adding three disks to the second virtual machine.

Finally, the second SCSI controller bus sharing type is changed to "physical" to complete the creation of the second virtual machine.

As an Oracle RAC dual-node two virtual machines are created, then use the CentOS official ISO system image to install the CentOS 6.8with graphical environment system for both hosts at the same time. Here the installation process is brief, see Internet search. After the system installation is complete, install VMware Tools for the virtual machine.

Configure node-hostname

Modify the network configuration file / etc/sysconfig/network using the vi editor

Configure network parameters

Modify the network configuration file / etc/sysconfig/network-scripts/ifcfg-eth0 using the vi editor

Modify the network configuration file / etc/sysconfig/network-scripts/ifcfg-eth2 using the vi editor

Note: every parameter in the network configuration file, including MAC address, UUID, IP parameters, etc., should not be misconfigured, otherwise it will lead to later network failure and affect the performance of the cluster!

Stop the NetworkManager service and set boot not to start, restart the network service.

/ etc/init.d/NetworkManager stop

Chkconfig NetworkManager off

/ etc/init.d/network restart

Configure Node two Hostname

Modify the network configuration file / etc/sysconfig/network using the vi editor

Configure Node 2 Network parameters

Modify the network configuration file / etc/sysconfig/network-scripts/ifcfg-eth0 using the vi editor

Modify the network configuration file / etc/sysconfig/network-scripts/ifcfg-eth2 using the vi editor

Stop the NetworkManager service and set boot not to start, restart the network service.

/ etc/init.d/NetworkManager stop

Chkconfig NetworkManager off

/ etc/init.d/network restart

Configure the DNS server, configuration file / etc/resolv.conf, on node one and node two at the same time. (configure according to the dns server provided by the actual operator)

In the node-graphics environment, use the Firefox browser that comes with the system, visit the Oracle official website http://www.oracle.com, and click download-Database-Oracle Database.

Oracle Database 12c-64 bit Linux system-View all

Agree to the agreement to download the database and cluster installation package.

You can start downloading after logging into your Oracle account (you can register for free)

After downloading the four compressed packages, use the cksum command to obtain the CRC check code and compare it with the official website to confirm whether the downloaded file is complete.

System configuration:

Node 1 and node 2 configure the host file / etc/hosts to be added at the same time. The ooa.com here is an example domain name, depending on the actual environment domain name.

# Oracle RAC Public IP

192.168.50.21 rac01.ooa.com rac01

192.168.50.22 rac02.ooa.com rac02

# Oracle RAC Private IP

10.98.50.21 rac01pri.ooa.com rac01pri

10.98.50.22 rac02pri.ooa.com rac02pri

# Oracle RAC Virtual IP

192.168.50.23 rac01vip.ooa.com rac01vip

192.168.50.24 rac02vip.ooa.com rac02vip

# Oracle RAC SCAN IP

192.168.50.25 scan.ooa.com

192.168.50.26 scan.ooa.com

192.168.50.27 scan.ooa.com

Node one and node two stop the NTP service and uninstall its software package at the same time, and use the ctss service that comes with the Oracle cluster to synchronize the node system time.

/ etc/init.d/ntpd stop

Yum erase ntp-y

Use ntpdate to synchronize the system time with the NTP server and write the hardware clock, and the ntpdate service starts automatically.

Ntpdate 0.centos.pool.ntp.org

Hwclock-w

Chkconfig ntpdate on

Stop the firewall and selinux services

/ etc/init.d/iptables stop

Chkconfig iptables off

Setenforce 0

The selinux service needs to be modified to permanently disable the configuration file / etc/sysconfig/selinux.

Create users and groups for the Oracle cluster, as well as data directories. It is recommended that a data disk be specially divided and mounted to / U01 to store Oracle data files.

Groupadd-g 54321 oinstall

Groupadd-g 54322 dba

Groupadd-g 54323 oper

Groupadd-g 54324 backupdba

Groupadd-g 54325 asmdba

Groupadd-g 54326 dgdba

Groupadd-g 54327 kmdba

Groupadd-g 54328 asmadmin

Groupadd-g 54329 asmoper

Useradd-u 54322-g oinstall-G dba,asmdba,oper oracle

Useradd-u 54321-g oinstall-G asmadmin,asmdba,asmoper grid

Mkdir-p / u01/app/12.1.0/grid

Mkdir-p / u01/app/grid

Mkdir-p / u01/app/oracle

Chown-R grid:oinstall / U01

Chown oracle:oinstall / u01/app/oracle

Chmod-R 775 / u01 /

Set the system login password for grid and oracle users

Kernel parameter optimization, modify configuration file / etc/sysctl.conf add

# Oracle RAC Optimized parameters

Fs.file-max = 6815744

Kernel.sem = 250 32000 100 128

Kernel.shmmni = 4096

Kernel.shmall = 1073741824

Kernel.shmmax = 4398046511104

Net.core.rmem_default = 262144

Net.core.rmem_max = 4194304

Net.core.wmem_default = 262144

Net.core.wmem_max = 1048576

Fs.aio-max-nr = 1048576

Net.ipv4.ip_local_port_range = 9000 65500

Execute the command sysctl-p configuration to take effect immediately

Soft and hard restriction policy, edit profile / etc/secrity/limits.conf add

Grid soft nproc 2047

Grid hard nproc 32768

Grid soft nofile 1024

Grid hard nofile 250000

Oralce soft nproc 2047

Oracle hard nproc 32768

Oracle soft nofile 1024

Oracle hard nofile 250000

Edit profile / etc/pam.d/login add

Session required pam_limits.so

Edit profile / etc/profile add

If [$USER = = "oracle"] | | [$USER = = "grid"]; then

If [$SHELL = "/ bin/ksh"]; then

Ulimit-p 16384

Ulimit-n 65536

Else

Ulimit-u 16384-n 65536

Fi

Umask 022

Fi

If the added three disks are recognized as / dev/sdb, / dev/sdc, / dev/sdd in the system, generate the asm-named disk using the following command

For i in b c d

Do

Echo "KERNEL==\" sd*\ ", BUS==\" scsi\ ", PROGRAM==\" / sbin/scsi_id-g-u / dev/\ $name\ ", RESULT==\" `/ sbin/scsi_id-g-u / dev/sd$ i`\ ", NAME=\" asm-disk$i\ ", OWNER=\" grid\ ", GROUP=\" asmadmin\ ", MODE=\" 0660\ "> > / etc/udev/rules.d/99-oracle-asmdevices.rules

Done

View the generated udev naming rules file

Restart udev to view the generated device file

Start_udev

Note: both Node 1 and Node 2 need to participate in the above configuration!

Node one installs and configures vncserver to access the CentOS host and install the cluster database in the remote graphics environment.

Yum install tigervnc-server-y

Edit vncserver profile / etc/sysconfig/vncservers add

VNCSERVERS= "1:grid 2:oracle"

VNCSERVERARGS [1] = "- geometry 1024x768"

VNCSERVERARGS [2] = "- geometry 1024x768"

Switch to the grid and oracle user environments, and use the vncpasswd command to set the vncserver login password.

Start the vncserver service / etc/init.d/vncserver start

Check the service port startup status netstat-antpl | grep Xvnc contains both port 5901 and port 5902 listening status, which is normal.

Node 1 and node 2 operate and switch to grid user environment at the same time.

Ssh-keygen-t rsa

Ssh-keygen-t dsa

Node one is executed again.

Cat ~ / .ssh/id_rsa.pub > > ~ / .ssh/authorized_keys

Cat ~ / .ssh/id_dsa.pub > > ~ / .ssh/authorized_keys

Scp / .ssh/authorized_keys rac02:~/.ssh/authorized_keys

Then type the login password of the grid system and pass the respective authentication public key to each other.

Node 2 executes again

Cat ~ / .ssh/id_rsa.pub > > ~ / .ssh/authorized_keys

Cat ~ / .ssh/id_dsa.pub > > ~ / .ssh/authorized_keys

Scp / .ssh/authorized_keys rac01:~/.ssh/authorized_keys

Node one modifies the configuration file ~ / .bash_profile, comments the last two lines and adds

Export ORACLE_BASE=/u01/app/grid

Export ORACLE_HOME=/u01/app/12.1.0/grid

Export ORACLE_SID=+ASM1

Export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib

Export CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib

PATH=$PATH:$HOME/bin:$ORACLE_HOME/bin:/usr/sbin

Export PATH

Node 2 modifies the configuration file ~ / .bash_profile, comments the last two lines and adds

Export ORACLE_BASE=/u01/app/grid

Export ORACLE_HOME=/u01/app/12.1.0/grid

Export ORACLE_SID=+ASM2

Export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib

Export CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib

PATH=$PATH:$HOME/bin:$ORACLE_HOME/bin:/usr/sbin

Export PATH

Node 1 and node 2 switch to oracle user environment at the same time to execute

Ssh-keygen-t rsa

Ssh-keygen-t dsa

Node one is executed again.

Cat ~ / .ssh/id_rsa.pub > > ~ / .ssh/authorized_keys

Cat ~ / .ssh/id_dsa.pub > > ~ / .ssh/authorized_keys

Scp / .ssh/authorized_keys rac02:~/.ssh/authorized_keys

Node 2 executes again

Cat ~ / .ssh/id_rsa.pub > > ~ / .ssh/authorized_keys

Cat ~ / .ssh/id_dsa.pub > > ~ / .ssh/authorized_keys

Scp / .ssh/authorized_keys rac01:~/.ssh/authorized_keys

Node one modifies the configuration file ~ / .bash_profile, comments the last two lines and adds

Export ORACLE_BASE=/u01/app/oracle

Export ORACLE_HOME=/u01/app/oracle/product/12.1.0/db_1

Export ORACLE_SID=racdb1

Export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib

Export CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib

PATH=$PATH:$HOME/bin:$ORACLE_HOME/bin:/usr/sbin

Export PATH

Node 2 modifies the configuration file ~ / .bash_profile, comments the last two lines and adds

Export ORACLE_BASE=/u01/app/oracle

Export ORACLE_HOME=/u01/app/oracle/product/12.1.0/db_1

Export ORACLE_SID=racdb2

Export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib

Export CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib

PATH=$PATH:$HOME/bin:$ORACLE_HOME/bin:/usr/sbin

Export PATH

Installation of Grid

The official documentation describes that Grid can be installed through graphical installation wizards and configuration files. The former is described here, and the latter is suitable for batch deployment. See http://docs.oracle.com/database/121/CWLIN/toc.htm

Use the vnc client (which can be downloaded in the attachment, 32-bit software for 32-bit systems and 64-bit software for 64-bit systems) to connect to a host of nodes, type the full domain name or ip address of the host, and attach the port number.

Click to continue

Type the vncserver login password

Root permission is not available for the time being. Cancel root user authentication.

Right-click on the desktop to open a terminal

Change to the directory where the package is installed and extract the grid package

Unzip linuxamd64_12102_grid_1of2.zip

Unzip linuxamd64_12102_grid_2of2.zip

After the decompression is complete, install the cvuqdisk package as the root user

Transfer the cvudisk package to Node 2 and root the user to install it.

Continue in the node-graphical environment, change to the grid directory, and. / runInstaller executes the installer to start the installation of the cluster software.

Open the drawing installation wizard

Standard cluster

Advanced installation

Default English language

Cluster name, SCAN name should be consistent with the settings in the hosts file, can be resolved successfully, SCAN port number.

Correct the node information to keep each name consistent with the hosts file, which can be parsed successfully.

Note the consistency of virtual host names

Add information for Node 2

Maintain name consistency

You don't have to type the login password of the grid user system here. Under normal circumstances, you can directly click the next step to pass the authentication. (note: if you cannot successfully pass the authentication, please test each other on the command line ssh rac02 and ssh rac01 to see if you can have secret-free access to each other, and then log out of the graphics environment and log in again to re-execute the installer! Through the graphical environment accessed by vnc, restart the vncserver service to log out of the graphical environment to which the current user is logged in.)

Configure eth2 network card through private network data.

Storage options use standard asm storage

Here the disk group parameters are kept by default. Click modify disk search path.

Find path / dev/asm*

Check three disks

Configure the same password for all accounts

No need to configure IPMI

No EM configuration required

Configure ASM groups

Configure oracle base and home directories

Inventory directory configuration

Automatic script configuration, where you can configure the root system login password to allow subsequent scripts to be executed automatically. Otherwise, manually execute the installation script on each node later.

Perform an environmental check to find out some problems. Click repair and check again

Prompt to automatically execute the repair script, click OK to confirm.

After re-inspection, it is found that there are still some software packages missing.

You can install these packages using yum in the root user environment (Note: node 2 also needs to execute yum to install these packages)

Yum install compat-libcap1-1.10 compat-libstdc++-33-3.2.3 libstdc++-devel-4.4.4 gcc gcc-c++ ksh libaio-devel-0.3.107-y

After the installation of the package is complete, check again.

Finally, for more information on dns and domain name resolution, please see.

Because the hosts file is used to parse here, the dns server is not used, and these two issues are directly ignored.

The warning message prompts you to continue.

Check the installation summary information and confirm that the installation can be carried out.

A prompt will appear during installation to automatically execute the configuration script. Click Yes to confirm the action.

Quietly waiting for the whole installation process

Finally, an error was reported and verification failed. The log query is due to the problem that the SCAN name cannot be resolved through the dns server, but the actual access through ip can be ignored.

Click yes to continue

Complete the installation of Grid

Use the command crsctl stat res-t to view dual-node status information

Use the command crsctl check ctss to view the status of two-node ctss service synchronizing system time

Install the Oracle database

Use the vnc client to access Node 1, port number 5902, that is, log in through the oracle user.

Change to the database package directory and extract the file.

Unzip linuxamd64_12102_database_1of2.zip

Unzip linuxamd64_12102_database_2of2.zip

After the decompression is completed, change to the database directory to execute the installer

Open the oracle graphical interface installation wizard to configure security updates. If you have a registered Oracle account here, please type the email address and password to update automatically, or you don't have to configure it.

Only install database software

RAC cluster database installation

Select all nodes to install

Default English language

Install Enterprise Edition by default, which requires disk space for 6.4GB.

Determine the oracle base and home directories

Oracle related groups

Requirements check, there are still dns server and domain name resolution problems, here the use of hosts files for resolution, so ignore these errors.

Confirm that the summary information is correct and you can start the installation.

Prompts during installation to manually execute root.sh scripts on each node as root user

It can be executed on each node in turn.

When you are finished, click OK to continue.

Database installed successfully

Create a database

Type the dbca command directly under the Oracle user environment to start the database creation wizard and select create database

Advanced mode

For general affairs processing

Configuration database name, optional container database.

Create a new server pool

Management options can be kept by default

Configure the same password for all accounts

Set the location of the data storage and edit the archive mode parameters, where the data is selected to be stored in the ASM disk group, so the storage type is ASM.

Note: here you need to authorize the oracle in the grid_home directory, otherwise you will not find the ASM disk! (required by each node)

Chmod + s / u01/app/12.1.0/grid/bin/oracle

Set the archive location

Sample schemas does not need to be set

Initialization parameters can be kept by default

Create Type-create Database

The requirement check indicates that the problem is still that the scan name cannot be resolved by the dns server, which is ignored here.

Confirm that the summary information is correct and click finish to start creating the database.

Attachment: http://down.51cto.com/data/2367890

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.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report