Operating System - HP-UX
1827981 Members
2379 Online
109973 Solutions
New Discussion

SG pkg control script for prod. on primary node and dev. on failover node

 
Hanry Zhou
Super Advisor

SG pkg control script for prod. on primary node and dev. on failover node

We are going to setup 2 nodes cluster, and the production will be running on the primary node, and meanwhile the development will be on the failover node.

1. Can anybody please provide me any considerations or threads about how to create the control script for such environment? The script will shutdown the development on the failover node before production failover, and start the dev when the prod. is switched back.

2. should I create 2 packages, one of prod, and another for dev? or just script all steps in one pkg control file. what are these advantages or disadvantages?

Thanks
none
7 REPLIES 7
Patrick Wallek
Honored Contributor

Re: SG pkg control script for prod. on primary node and dev. on failover node

If you want production running on one machine and development running on the other then you will definitely need to create 2 SG packages.

You can't have one package easily control things on 2 machines. That is really not the way SG was designed.

You should have your PROD package set up to run on the primary node by default and the DEVE package to run on the secondary node.

Now in the PROD package control script you can build in logic so that if the package is starting up on the secondary node, then it shuts down DEVE before starting up PROD.
Hanry Zhou
Super Advisor

Re: SG pkg control script for prod. on primary node and dev. on failover node

You don't have to use 2 packages. You can add logics into the package script file, to shutdown Dev. on the failoover node while Prod is moving over, and also startup Dev. while the package is moving back to Primary node. In this way, you can only create one package on the cluster...

My questions which method is better?
none
Sp4admin
Trusted Contributor

Re: SG pkg control script for prod. on primary node and dev. on failover node

Hi Hanry,

I'm still new with SG, but i am running a two node cluster. I created two packages one to run on production with one application. and another package on our other production server with yet another application. So I'm sure you can do ether one but I pick to create 2 packages.


Just my $0.02
sp,
Patrick Wallek
Honored Contributor

Re: SG pkg control script for prod. on primary node and dev. on failover node

My opinion --

Having 1 package per machine is better. That way if you need to change either the PROD or the DEVE package, then you can make the change without worrying about how it might effect the other instance.

I don't think you would want to make a change to DEVE, and discover that you accidentally changed PROD instead. I think that could be a risk if you have only 1 package.
Hanry Zhou
Super Advisor

Re: SG pkg control script for prod. on primary node and dev. on failover node

I am going to create two packages, PROD and DEV packages, with PROD package, it can be failed over to the adoptive node, wthh DEV. package, it only stay on the failover node, without failover, is there any threads, or script examples that you can show me? Thanks,
none
A. Clay Stephenson
Acclaimed Contributor

Re: SG pkg control script for prod. on primary node and dev. on failover node

Before you pursue this very far, you need to think very carefully about the wisdom of installing the test environment on what will ever potentially be the production evvironment. If you fall under any sort of of security audits (e.g. SOX-related), you have just made your audits more involved and complicated --- which could exceed the cost of an additional test environment. It's not enough to say that the test and production envirments can never be mingled (or that test users can't access production), you have to be able to prove this. Completely separate machines make this task easy and documentable. Combined-use machines make this task much more difficult. I suspect that find another box on the used-equipment market will prove to be a far less expensive options than having to substantiate your claims year after year to auditors.
If it ain't broke, I can fix that.
Rita C Workman
Honored Contributor

Re: SG pkg control script for prod. on primary node and dev. on failover node

We run a large cluster, so our packages have to be able to fail multiple times to anyone of a number of servers. Inside the cluster are both prod and dev packages.

One way we do this is....at the start of the production control script we put this entry:

/usr/sbin/cmhaltpkg -n $(/usr/bin/uname -n) dev-pkg-name

What this line does is says...if on THIS server (uname -n) the dev-pkg-name is running...shut it down. If it's not running, it will ignore the line and continue...

Now...we keep our Dev pkgs with very limited failover, they can only fail to one other server...and that is the final failover node (it's the 3rd node in line for prod-failover) for production too...So production would always win in the end.

On that point about restarting the Dev pkg when the Prod pkg is back up...We NEVER enable failing back. They can fail forward, but putting packages back is strictly done MANUALLY. Otherwise, you would quickly lose control.

Just how we do it,
Rgrds,
Rita