LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 03-10-2014, 11:18 PM   #1
xenner
Member
 
Registered: Jul 2009
Location: Brisbane
Distribution: RHEL 6.5
Posts: 39

Rep: Reputation: 0
Two RHEL servers sharing one Virtual IP - How to...?


Hi,

This should be incredibly easy, but I can't seem to find the easiest and most elegant way to do it online.

Basically, I'm after a very simple method to share one IP across two machines.

ie.
Primary - 192.168.0.1 - 192.168.0.3
Secondary - 192.168.0.2

So, when Primary goes down, Secondary starts up an eth0:1 with the IP of 192.168.0.3, and serves content, but when Primary comes back, Secondary shuts down the eth0:1.

I have googled, and searched here, but either my criteria is incorrect, or there's no 'easy' method with the least amount of config out there.

I appreciate your time!

Xen.
 
Old 03-11-2014, 01:55 AM   #2
kirukan
Senior Member
 
Registered: Jun 2008
Location: Eelam
Distribution: Redhat, Solaris, Suse
Posts: 1,278

Rep: Reputation: 148Reputation: 148
Hi Xenner,
You can go through the corosync/pacemaker to setup Linux cluster. OR if you have licensed RHEL you can try RHEL cluster suite also
http://www.linuxquestions.org/questi...er-4175425129/
 
1 members found this post helpful.
Old 03-11-2014, 05:18 PM   #3
xenner
Member
 
Registered: Jul 2009
Location: Brisbane
Distribution: RHEL 6.5
Posts: 39

Original Poster
Rep: Reputation: 0
Thanks Kirukan,

I'll check it out.

Xen.
 
Old 03-12-2014, 05:42 PM   #4
xenner
Member
 
Registered: Jul 2009
Location: Brisbane
Distribution: RHEL 6.5
Posts: 39

Original Poster
Rep: Reputation: 0
Hi,

I got this working very simply. Thanks for the assist.

I used 'cman', which includes corosync. And I added pacemaker also.

I only added the two nodes into the /etc/cluster.conf file:

<clusternode name="rhel6-01.business.com" nodeid="1">
and
<clusternode name="rhel6-02.business.com" nodeid="2">

I ran these, where the ip on line one is the shared ip between the two nodes:
Code:
pcs resource create livefrontendIP0 ocf:heartbeat:IPaddr2 ip=192.168.0.70 cidr_netmask=32 op monitor interval=30s
pcs constraint location livefronendIP0 prefers rhel6-01.business.com=INFINITY
pcs constraint location livefrontendIP0 prefers rhel6-02.business.com=INFINITY
pcs property set no-quorum-policy=ignore
pcs property set stonith-enabled=false
And I changed /etc/corosync/corosync.conf slightly, as in, I added the bindnetaddr: to the network I was on... So, if you're doing this, and you have an ip of 192.168.0.55/24 You would change your bindnetaddr to 192.168.0.0 on both machines.
I also hashed out the "mcastport" and placed a new line "broadcast: yes". I'm not sure that's required, I saw it in the man page.

Once everything was configured, I ran "ccs_config_validate" and all the settings were 'okay'.

I replicated the config to the secondary node, then started cman and pacemaker.

Code:
service cman start
service pacemaker start
Then, ensure they started at logon, 'chkconfig <bothservices> on'.

Once everything's running, you can check it all out using.
Code:
cman_tool status
or
Code:
cman_tool nodes
I hope that helps anyone in the future. And if I've missed anything, feel free to add it in anyone!

Xen.
 
  


Reply

Tags
cluster, redhat


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
can not ping from host (RHEL 6) to RHEL 5 in (virtual)? manalisharmabe Linux - Newbie 1 05-01-2011 12:55 PM
Possible to have virtual machine in RHEL 5.1 run RHEL 4.0-1 ES (64-bit) maryjane Linux - Newbie 1 10-20-2008 12:04 PM
Sharing passwords across servers fstab Linux - Networking 2 10-17-2006 09:45 AM
Email Servers and File Sharing ddelao Linux - Software 1 08-31-2005 08:42 PM
Sharing load between two Squid Servers chamkila Linux - Networking 1 02-22-2003 11:15 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 07:37 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration