Orcale RAC Part III – Clone RAC1 to RAC2 and User Equivalency

This is fourth post on step by step building Oracle RAC Database on your desktop / laptop using VMWare (Virtual Machine)

For previous three posts visit

Try installing Orcale RAC on your laptop
RAC Part I – Install Virtual Machine and Linux
RAC Part II – Install Virtual Disk and Network Card

In this post you will

–Clone RAC1 to RAC2 and change IP address of RAc2
–Configure User equivalency for Orale Clusterware installation
Clone RAC1 to RAC2
——————————-

– Make sure virtual linux machine is shutdown
-Copy folder rac1 to folder rac2 in c:\Atul\VMWARE (This is on windows laptop/machine)

–In both RAC1 and RAC2 folder open “Red Hat Enterprise Linux 3.vmx” (This is virtual machine configuration file) using notepad or wordpad

–Add following lines (This will avoid locking for shared files and two linux machines RAC1 and RAC2 can start together using shared files votingdisk, crs and asm)


disk.locking = “FALSE”
diskLib.dataCacheMaxSize = “0”
diskLib.dataCacheMaxReadAheadSize = “0”
diskLib.dataCacheMinReadAheadSize = “0”
diskLib.dataCachePageSize = “4096”
diskLib.maxUnsyncedWrites = “0”

–Now on vmx file of RAC2 “Red Hat Enterprise Linux 3.vmx” change following lines from displayName = “RAC1” to displayName = “RAC2”

–On VMWare Server Console, Click on File and Open or “Ctrl + O”

–Click on Browse and select “red hat enterprise linux 3.vmx” from RAC2 directory

Now you should see two linux machines RAC1 and RAC2 on VMWare Console

Start RAC1 and RAC2 and when you get below warning on RAC2, select create and click OK

Make sure you can start both machine at same time, if you get message like unable to lock files, check you have added following lines in both machines vmx files mentioned above (regarding disk locking)

Change Network Settings (IP) on RAC2
————————————————-

Login as ROOT user in RAC2 machine and click System Setting -> Network

Select eth0 and click on Edit

Change Address from 192.168.1.101 to 192.168.1.102

Click on Hardware Device Tab and Click on Probe button

Repeat steps for second network card eth1 and change its IP from 192.168.0.101 to 192.168.0.102

Make sure you clicked probe on eth1 as well as shown above

Activate both network cards by clicking on Activate as shown below

If you get error message that eth0 has different MAC address expected as shown below; make sure you have clicked on probe on “Bind to Mac Address” on “Hardware Device” mentioned above.

Make sure both network cards are active now, as shown below

Add following entry in /etc/hosts file of both RAC1 and RAC2

####

127.0.0.1 loalhost.localdomain localhost
192.168.1.102 rac2.focusthread.com rac2 rac2-vip.focusthread.com rac2-vip
192.168.0.102 rac2-priv.focusthread.com rac2-priv
192.168.1.101 rac1.focusthread.com rac1 rac1-vip.focusthread.com rac1-vip
192.168.0.101 rac1-priv.focusthread.com rac1-priv

###

Now trying to ping RAC2 machine from RAC1 and RAC1 machine from RAC2

Change Host Name of newly cloned RAC2

————————————————-

Follow below step on how to change hostname on RAC2 (newly cloned) Linux machine

Open file /etc/sysconfig/network and edit line like : HOSTNAME=XXXXX i.e. from

HOSTNAME rac1.focusthread.com To HOSTNAME rac2.focusthread.com

Configure User Equivalency

———————————–

User equivalency for user oracle is required so that user oracle from RAC1 can communicate to user oracle on RAC2 machine without prompting for password for clusterware to work properly.

–Login as user oracle in machine RAC1

–Make sure sshd daemon is running (pgrep sshd), If not start it from root user like “service start sshd

–Create RSA and DSA key on each node

-From oracle user go to user home directory by “cd $HOME” or type cd and press enter
-mkdir .ssh (note that there is dot before ssh which means this is hidden directory)
-chmod 700 .ssh
-ssh-keygen –t rsa
-ssh-keygen –t dsa

press enter when prompted for file to save the key and passphrase (check screenshot for more information)

Repeat this on both the nodes i.e. RAC1 and RAC2Add keys to authorized key file (authorized_keys)

————————————————————

-cd .ssh

-touch authorized_keys
-ls (You should see authorized_keys, id_dsa, id_dsa.pub, id_rsa, id_rsa.pub. Here pub files are dsa and rsa public key file and id_dsa and id_rsa are private key files)

ssh rac1 cat /home/oracle/.ssh/id_rsa.pub >> authorized_keys
ssh rac1 cat /home/oracle/.ssh/id_dsa.pub >> authorized_keys
ssh rac2 cat /home/oracle/.ssh/id_rsa.pub >> authorized_keys
ssh rac2 cat /home/oracle/.ssh/id_dsa.pub >> authorized_keys

Send authorized_keys from RAC1 to RAC2

scp authorized_keys rac2:/home/oracle/.ssh

From RAC1 machine as user oracle
exec /usr/bin/ssh-agent $SHELL
/usr/bin/ssh-add

Test User Equivalency (User oracle can login to other machine without password prompt)

—————————-

ssh rac1 date

ssh rac2 date

Test this from both nodes RAC1 and RAC2 (You should not be prompted for oracle user password)For more information on User Equivalency visit chapter 2 (Page 51 to 53) of clusterware and rac installation guide

Coming Next :

Installing clusterware on RAC1 and RAC2

Installing RAC database on RAC1 and RAC2 linux machines using ASM

About the Author Masroof Ahmad

Leave a Comment:

22 comments
Steve says July 20, 2007

Great series. I am looking forward to the completion, as I have configured my 2 nodes and am ready for the next step. I am going to take a stab at installing clusterware myself (it has been a while now).

Thanks for the great site.

Reply
Atul Kumar says July 20, 2007

Hi Steve, I’ll post remaining RAC install parts as soon as I find some time.

Reply
Anonymous says July 26, 2007

I followed all the four series, brilliant compilation.
Kudos!!

Sam
http://appsdbablog.com

Reply
Atul Kumar says July 26, 2007

Thanks Sam

Reply
Arman says August 21, 2007

Hi … first of thanks for the tremendous ifnormation and so easy setup … my doubt is that i have Oracle 9.0.2 i …. Can i use it as RAC … will it be the same.

Reply
MANJUNATH says April 19, 2008

Somehow ssh rac2 date and rac1 date are prompting me for password..Stuck there

Reply
MANJUNATH says April 19, 2008

Hey Guys got the soution .May sound wierd but authorized_keys permission was set to 644 and it worked

Reply
S Govindarajan says September 27, 2008

Hi,
I shared a folder in windows & vmware machine settings. I could not map it with Linux. How do i do it ? Please help me.
Thanks
Rajan

Reply
Atul says September 27, 2008

Rajan,
What r u trying to do ?

Is this related to above doc or something else ?

http://onlineappsdba.com/index.php/2008/09/07/share-filesfolders-from-windows-to-linux-on-vmware/

Reply
younus.appsdba says October 29, 2008

Manjunath remove the password for ssh since this will speak to one another on RAC through ssh

Reply
Anil says January 11, 2009

hi Atul
I am struck at user equivalency…when I am trying to get the date its asking for the password…what to do????

Reply
Geetha says January 16, 2009

Hi Atul
I am struck at user equivalency…when I am trying to get the date its asking for the password…what to do????

Rgds
Geetha M

Reply
Anil says January 16, 2009

Hello Geetha…. please change the chmod setting for .ssh to 700. I resolved the problem

Anil

Reply
JET says February 2, 2009

SSH errors debug routine

Guys i have been getting the passwords for ssh user equivalency.

1. Debug ssh using ssh -v rac1 date
2. Login in as root and stop/start sshd using the following command
/usr/sbin/sshd -dd -e on both rac1 and rac2
3. Login as oracle and it should work.

Good Luck
JET

Reply
syed says April 19, 2009

Hi Atul

Greetings!!

I have started installation of RAC on my laptop.
Post installation of User equivalence, its still asking me for passwords of cluster.
Could you please let me know the possible errors occur at the time of user-equivalence.
Thanks in Advance.
Rgds
DBA

Hi Atul

Greetings!!

Hope you are doing fine with your health. First of all thanks for such a tremendous effort for making us known about installation of RAC on laptop/dektop.

I have started installation of RAC on my desktop and i have done with cloning part but i am facing a problem in user equivalence. While sending authorized_keys from RAC1 to RAC2 it is asking me to type the password, which i did and there i am getting an error as “Permission denied. Please try again later”.

One more thing i want to clarify about that password, are we using a passphrase password which we have giving while configuring the keys??

Could you please let me know the possible errors occur at the time of user-equivalence and which password we have to use while connecting to rac2 from rac1 for sending authorized_keys.

I will be waiting for your reply.

Thanks in Advance.
Regards
Syed

Reply
syed says April 19, 2009

Hi Atul

Greetings!!

Hope you are doing fine with your health. First of all thanks for such a tremendous effort for making us known about installation of RAC on laptop/dektop.

I have started installation of RAC on my desktop and i have done with cloning part but i am facing a problem in user equivalence. While sending authorized_keys from RAC1 to RAC2 it is asking me to type the password, which i did and there i am getting an error as “Permission denied. Please try again later”.

One more thing i want to clarify about that password, are we using a passphrase password which we have giving while configuring the keys??

Could you please let me know the possible errors occur at the time of user-equivalence and which password we have to use while connecting to rac2 from rac1 for sending authorized_keys.

I will be waiting for your reply.

Thanks in Advance.
Regards
Syed

Reply
mamta says June 9, 2009

Hi Atul,

I’m doing 10g RAC installation on Oracle enterprise linux using vmware.

I’m trying to do below command from RAC1:
rac1-> ssh rac2 cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys

receiving below error.

ssh:connect to host rac2 port22: connection refused.

Kindly provide your suggestions to overcome this.

I’m able to ping from rac1 to rac2 and vice versa.

Thanks
Mamta

Reply
Atul Kumar says June 9, 2009

@ Mamta,
It seems SSH is not installed/running on rac2

as root user on rac2 , check if ssh is listening on port 22

netstat -an | grep 22

If not start SSH

If ssh is listening then check if there is firewall (iptables) between rac1 and rac2
on RAC2

service iptables status

Reply
mamta says July 1, 2009

Thanks Atul..

I have installed RAC now.But have a new issue.

After installation I have checked crs_stat -t in rac1 and everything was showing online.

But after rebooting rac1 and rac2.When I do it get the below result.
rac1-> crs_stat -t
Name Type Target State Host
————————————————————
ora.devdb.db application ONLINE ONLINE rac2
ora….b1.inst application ONLINE ONLINE rac1
ora….b2.inst application ONLINE OFFLINE
ora….SM1.asm application ONLINE ONLINE rac1
ora….C1.lsnr application ONLINE UNKNOWN rac1
ora.rac1.gsd application ONLINE UNKNOWN rac1
ora.rac1.ons application ONLINE ONLINE rac1
ora.rac1.vip application ONLINE ONLINE rac1
ora….SM2.asm application ONLINE UNKNOWN rac2
ora….C2.lsnr application ONLINE UNKNOWN rac2
ora.rac2.gsd application ONLINE UNKNOWN rac2
ora.rac2.ons application ONLINE UNKNOWN rac2
ora.rac2.vip application ONLINE ONLINE rac2

rac1-> srvctl status nodeapps -n rac1
VIP is running on node: rac1
GSD is not running on node: rac1
Listener is not running on node: rac1
ONS daemon is running on node: rac1

rac1-> srvctl status nodeapps -n rac2
VIP is running on node: rac2
GSD is not running on node: rac2
Listener is not running on node: rac2
ONS daemon is not running on node: rac2

rac1-> srvctl status asm -n rac1
ASM instance +ASM1 is running on node rac1.

rac1-> srvctl status asm -n rac2
ASM instance +ASM2 is not running on node rac2.

rac1-> srvctl status database -d devdb
Instance devdb1 is running on node rac1
Instance devdb2 is not running on node rac2

when I tried manually up the database in rac2 I receive below error:

SQL> startup
ORA-01078: failure in processing system parameters
ORA-01565: error in identifying file ‘+DG1/devdb/spfiledevdb.ora’
ORA-17503: ksfdopn:2 Failed to open file +DG1/devdb/spfiledevdb.or
ORA-15077: could not locate ASM instance serving a required diskgroup.

I’m new RAC please suggest me what needs to be done.

Thanks,
Mamta

Reply
Atul Kumar says July 1, 2009

@ Mamta

It seems either your ASM instance is not running or RAC database is unable to find startup file (spfile) which is on ASM Disk Group DB1

1) If ASM is down start it , check this link on how to start ASM instance
http://download.oracle.com/docs/cd/B19306_01/server.102/b14231/storeman.htm#i1013975

2) If ASM is up then check Disk assigned to disk group (ensure that you connect to ASM instance)
SQL> select name, header_status, path from v$asm_disk;

Reply
mamta says July 2, 2009

Hi Atul..

Thanks for your prompt response..ASM was not up on rac2.

now everything is fine…

Reply
vineetnehra says October 2, 2010

Hi Manjunath,

Thanks for the suggestion.
I was facing same problem of ssh asking for password. But after I changed the permission of authorized_keys to 644, it worked fine without asking for password.

Thanks,
Vineet

Reply
Add Your Reply