文章标题
转载: Introduction NFS is an abbreviation of Network File System,a platform independent technology created by Sun Microsystems that allows shared access to files stored on computers via an interface called the Virtual File System (VFS) that runs on top of TCP/IP. Computers that share files are considered NFS servers,while those that access shared files are considered NFS clients. An individual computer can be either an NFS server,a NFS client or both. We can use NFS to provide shared storage for a RAC installation. In a production environment we would expect the NFS server to be a NAS,but for testing it can just as easily be another server,or even one of the RAC nodes itself. To cut costs,this articles uses one of the RAC nodes as the source of the shared storage. Obviously,this means if that node goes down the whole database is lost,so it’s not a sensible idea to do this if you are testing high availability. If you have access to a NAS or a third server you can easily use that for the shared storage,making the whole solution much more resilient. Whichever route you take,the fundamentals of the installation are the same. The Single Client Access Name (SCAN) should really be defined in the DNS or GNS and round-robin between one of 3 addresses,which are on the same subnet as the public and virtual IPs. In this article I’ve defined it as a single IP address in the “/etc/hosts” file,which is wrong and will cause the cluster verification to fail,but it allows me to complete the install without the presence of a DNS. This article was inspired by the blog postings of Kevin Closson. Assumptions. You need two machines available to act as your two RAC nodes. They can be physical or virtual. In this case I’m using two virtual machines called “rac1” and “rac2”. If you want a different naming convention or different IP addresses that’s fine,but make sure you stay consistent with how they are used. Download the following software. Oracle Enterprise Linux 5.4 This article uses Oracle Enterprise Linux 5.4. A general pictorial guide to the operating system installation can be found here. More specifically,it should be a server installation with a minimum of 2G swap (preferably 3-4G),firewall and secure Linux disabled. Oracle recommend a default server installation,but if you perform a custom installation include the following package groups: GNOME Desktop Environment RAC1. hostname: ol5-112-rac1.localdomain hostname: ol5-112-rac2.localdomain Oracle Installation Prerequisites Perform either the Automatic Setup or the Manual Setup to complete the basic prerequisites. The Additional Setup is required for all installations. Automatic Setup If you plan to use the “oracle-validated” package to perform all your prerequisite setup,follow the instructions at http://public-yum.oracle.com to setup the yum repository for OL,then perform the following command. yum install oracle-validatedAll necessary prerequisites will be performed automatically. It is probably worth doing a full update as well,but this is not strictly speaking necessary. yum updateManual Setup If you have not used the “oracle-validated” package to perform all prerequisites,you will need to manually perform the following setup tasks. In addition to the basic OS installation,the following packages must be installed whilst logged in as the root user. This includes the 64-bit and 32-bit versions of some packages. From Oracle Linux 5 DVDcd /media/cdrom/Server cd / fs.aio-max-nr = 1048576 semaphores: semmsl,semmns,semopm,semmnikernel.sem = 250 32000 100 128 /sbin/sysctl -p oracle soft nproc 2047 session required pam_limits.so groupadd -g 1000 oinstall mkdir -p /u01/app/11.2.0/grid Perform the following steps whilst logged into the “rac1” virtual machine as the root user. Set the password for the “oracle” user. passwd oracle cd /your/path/to/grid/rpm 127.0.0.1 localhost.localdomain localhost Public192.168.0.101 ol5-112-rac1.localdomain ol5-112-rac1 Private192.168.1.101 ol5-112-rac1-priv.localdomain ol5-112-rac1-priv Virtual192.168.0.103 ol5-112-rac1-vip.localdomain ol5-112-rac1-vip SCAN192.168.0.105 ol5-112-scan.localdomain ol5-112-scan Change the setting of SELinux to permissive by editing the “/etc/selinux/config” file,making sure the SELINUX flag is set as follows. SELINUX=permissive If you have the Linux firewall enabled,you will need to disable or configure it,as shown here or here. The following is an example of disabling the firewall. service iptables stopchkconfig iptables offEither configure NTP,or make sure it is not configured so the Oracle Cluster Time Synchronization Service (ctssd) can synchronize the times of the RAC nodes. If you want to deconfigure NTP do the following. service ntpd stopShutting down ntpd: [ OK ] chkconfig ntpd offmv /etc/ntp.conf /etc/ntp.conf.origrm /var/run/ntpd.pidIf you want to use NTP,you must add the “-x” option into the following line in the “/etc/sysconfig/ntpd” file. OPTIONS=”-x -u ntp:ntp -p /var/run/ntpd.pid” service ntpd restartCreate the directories in which the Oracle software will be installed. mkdir -p /u01/app/11.2.0/grid Oracle SettingsTMP=/tmp; export TMP ORACLE_HOSTNAME=ol5-112-rac1.localdomain; export ORACLE_HOSTNAME LD_LIBRARY_PATH=
alias grid_env=’. /home/oracle/grid_env’ ORACLE_HOME=
LD_LIBRARY_PATH=
ORACLE_SID=RAC1; export ORACLE_SID LD_LIBRARY_PATH=
We’ve made a lot of changes,so it’s worth doing a reboot of the servers at this point to make sure all the changes have taken effect. shutdown -r nowCreate Shared Disks First we need to set up some NFS shares. In this case we will do this on the ol5-112-rac1 node,but you can do the on a NAS or a third server if you have one available. On the ol5-112-rac1 node create the following directories. mkdir /shared_config /shared_config *(rw,sync,no_wdelay,insecure_locks,no_root_squash) chkconfig nfs on mkdir -p /u01/app/11.2.0/grid nas1:/shared_config /u01/shared_config nfs rw,bg,hard,nointr,tcp,vers=3,timeo=600,rsize=32768,wsize=32768,actimeo=0 0 0 mount /u01/shared_config chown -R oracle:oinstall /u01/shared_config Start both RAC nodes,login to ol5-112-rac1 as the oracle user and start the Oracle installer. ./runInstaller Grid - Select Installation Option Select the “Advanced Installation” option,then click the “Next” button. Grid - Select Installation Type Select the the required language support,then click the “Next” button. Grid - Select Product Languages Enter cluster information and uncheck the “Configure GNS” option,then click the “Next” button. Grid - Grid Plug and Play Information On the “Specify Node Information” screen,click the “Add” button. Grid - Cluster Node Information Enter the details of the second node in the cluster,then click the “OK” button. Grid - Add Cluster Node Information Click the “SSH Connectivity…” button and enter the password for the “oracle” user. Click the “Setup” button to to configure SSH connectivity,and the “Test” button to test it once it is complete. Click the “Next” button. Grid - SSH Connectivity Check the public and private networks are specified correctly,then click the “Next” button. Grid - Specify Network Interface Usage Select the “Shared File System” option,then click the “Next” button. Grid - Storage Option Information Select the required level of redundancy and enter the OCR File Location(s),then click the “Next” button. Grid - OCR Storage Option Select the required level of redundancy and enter the Voting Disk File Location(s),then click the “Next” button. Grid - Voting Disk Storage Option Accept the default failure isolation support by clicking the “Next” button. Grid - Failure Isolation Support Select the preferred OS groups for each option,then click the “Next” button. Click the “Yes” button on the subsequent message dialog. Grid - Privileged Operating System Groups Enter “/u01/app/oracle” as the Oracle Base and “/u01/app/11.2.0/grid” as the software location,then click the “Next” button. Grid - Specify Install Location Accept the default inventory directory by clicking the “Next” button. Grid - Create Inventory Wait while the prerequisite checks complete. If you have any issues,either fix them or check the “Ignore All” checkbox and click the “Next” button. If there are no issues,you will move directly to the summary screen. If you are happy with the summary information,click the “Finish” button. Grid - Summary Wait while the setup takes place. Grid - Setup When prompted,run the configuration scripts on each node. Grid - Execute Configuration Scripts The output from the “orainstRoot.sh” file should look something like that listed below. cd /u01/app/oraInventory./orainstRoot.shChanging permissions of /u01/app/oraInventory. Changing groupname of /u01/app/oraInventory to oinstall. Once the scripts have completed,return to the “Execute Configuration Scripts” screen on ol5-112-rac1 and click the “OK” button. Grid - Execute Configuration Scripts Wait for the configuration assistants to complete. Grid - Configuration Assistants We expect the verification phase to fail with an error relating to the SCAN,assuming you are not using DNS. INFO: Checking Single Client Access Name (SCAN)… Click the “Close” button to exit the installer. Grid - Finish The grid infrastructure installation is now complete. Install the Database Start all the RAC nodes,login to ol5-112-rac1 as the oracle user and start the Oracle installer. ./runInstaller DB - Configure Security Updates Accept the “Create and configure a database” option by clicking the “Next” button. DB - Select Installation Option Accept the “Server Class” option by clicking the “Next” button. DB - System Class Make sure both nodes are selected,then click the “Next” button. DB - Node Selection Accept the “Typical install” option by clicking the “Next” button. DB - Select Istall Type Enter “/u01/app/oracle/product/11.2.0/db_1” for the software location. The storage type should be set to “File System” with the file location set to “/u01/oradata”. Enter the appropriate passwords and database name,in this case “RAC.localdomain”. DB - Typical Install Configuration Wait for the prerequisite check to complete. If there are any problems either fix them,or check the “Ignore All” checkbox and click the “Next” button. DB - Perform Prerequisite Checks If you are happy with the summary information,click the “Finish” button. DB - Summary Wait while the installation takes place. DB - Install Product Once the software installation is complete the Database Configuration Assistant (DBCA) will start automatically. DB - DBCA Once the Database Configuration Assistant (DBCA) has finished,click the “OK” button. DB - DBCA Complete When prompted,run the configuration scripts on each node. When the scripts have been run on each node,click the “OK” button. DB - Execute Configuration Scripts Click the “Close” button to exit the installer. DB - Finish The RAC database creation is now complete. Check the Status of the RAC There are several ways to check the status of the RAC. The srvctl utility shows the current configuration and status of the RAC database.
$ sqlplus / as sysdba SQL*Plus: Release 11.2.0.1.0 Production on Sat Sep 26 19:04:19 2009 Copyright (c) 1982,2009,Oracle. All rights reserved. Connected to: SQL> SELECT inst_name FROM v$active_instances; INST_NAMErac1.localdomain:rac1 SQL> OEM Direct NFS Client The Direct NFS Client should be used for CRS-related files,so it is important to have separate NFS mounts for the different types of files,rather than trying to compact them into a single NFS share. $ORACLE_HOME/dbs/oranfstab For the client to work we need to switch the “libodm11.so” library for the “libnfsodm11.so” library,which can be done manually or via the “make” command. srvctl stop database -d rac manual methodcd $ORACLE_HOME/lib make method
srvctl start database -d rac v
SQL> SELECT svrname,dirname FROM v$dnfs_servers; SVRNAME DIRNAME nas1 /shared_data SQL> For more information see: Grid Infrastructure Installation Guide for Linux Back to the Top. (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |