On Thu, Sep 16, 2010 at 05:18:10PM +0200, Holger Teutsch wrote: > -----Ursprüngliche Nachricht----- > Von: Dejan Muhamedagic <deja...@fastmail.fm> > Gesendet: Sep 16, 2010 4:30:37 PM > An: High-Availability Linux Development List <linux-ha-dev@lists.linux-ha.org> > Betreff: Re: [Linux-ha-dev] Patch for db2 Resource agent > > >Hi, > > > >On Thu, Sep 16, 2010 at 03:32:43PM +0200, Holger Teutsch wrote: > >> -----Ursprüngliche Nachricht----- > >> > >> >On Thu, Sep 16, 2010 at 10:07:49AM +0200, Holger Teutsch wrote: > >> >> Hi, > >> >> find attached a patch for the db2 resource agent > >> >> - holger > >> >> > >> >> High: Replace call to db2_local_ps with db2nps (Thanx to Evgeny > >> >> Nifontov) > >> >> > >> >> db2nodes.cfg typically contains a cluster service address and > >> >> db2_local_ps never works > >> >> in this case. > >> > > >> >Is there any documentation or source to support this? Looking at > >> >the source, db2_local_ps should recover the right node number > >> >from db2nodes.cfg in case that file exists, then invoke db2nps > >> >with that node number. If it doesn't work, then it is a bug in > >> >db2_local_ps. > >> > > >> >Cheers, > >> > > >> >Dejan > >> > >> Dejan, > >> the background is: > >> > >> db2nodes.cfg maps "partition numbers" to "node names" > >> Normally this is the physical hostname. > >> > >> Most db2 utilities (e.g. db2start etc) map the node number to the "node > >> name". > >> If "node name" == "uname -n" call locally, else invoke the > >> command on the remote host via rsh or something you set via > >> > >> db2set DB2RSHCMD=xxx > >> . > >> > >> On a cluster the file ~/sqllib/db2nodes.cfg is on a shared FS. > >> > >> If this file contains a physical hostname this will definitely be wrong > >> after a resource migration. > >> > >> Therefore per best practice (IBM Redbooks etc.) you put the DNS > >> name of the cluster service into db2nodes.cfg. > >> > >> You then have to take care that the instance owner has rsh access to > >> itself via the service address. > >> Else you can map DB2RSHCMD to a script like > >> > >> --- > >> #!/bin/sh > >> # > >> # Emulate inter partition call for ACC by simply do it locally > >> # Install with > >> # > >> # db2set DB2RSHCMD=$INSTHOME/db2_acc_rsh > >> # > >> # HT Dec 2007 > >> > >> # Is called rsh like as > >> # c36db.hg.fresenius.de -n -l db2c36 ARGS > >> > >> # remove 4 first args > >> shift > >> shift > >> shift > >> shift > >> eval "$@" > >> ---- > >> > >> Other methods for working with db2nodes.cfg are > >> - make links to node local files (problems with permissions) > >> - edit db2nodes.cfg with the resource agent prior to an (something a IBM > >> povide lib does/tries) > >> > >> You see we are veterans with 100+ db2 databases. 8-) or 8-( > >> > >> I agree that the logic of db2_local_ps is to simple to deal with this > >> setup. > >> On the other hand I'm not confident that IBM will implement a > >> comprehensive way to detect "locality" for a general multi partition setup. > >> This would require checking IP interfaces etc... > >> > >> I checked that db2nps works on DB2 8.2, 9.5 and 9.7. > >> > >> Any concerns let me know. > > > >My only concern is that 0 may not be the right node number for > >the local node. On failover or failback or whenever. That's why > >I'd expect db2_local_ps to be the right way to go. Of course, I > >do understand that things don't always work as advertised and in > >particular with products such as db2 :) At any rate, if you're > >sure that "db2nps 0" is always going to refer to the local node, > >then we can go ahead with this change. > > > >Cheers, > > > >Dejan > > > > Dejan, > in a single partition database the single partition is always "0". > > db2nps NN looks on the *local* node for processes of partition "NN" > > i.e. db2nps 0 does the required work. > > So I think that's OK.
Fine. I pushed the patch. Many thanks for the contribution and taking time to explain this. Cheers, Dejan > Regards > Holger > ___________________________________________________________ > GRATIS: Spider-Man 1-3 sowie 300 weitere Videos! > Jetzt kostenlose Movie-FLAT freischalten! http://movieflat.web.de > _______________________________________________________ > Linux-HA-Dev: Linux-HA-Dev@lists.linux-ha.org > http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev > Home Page: http://linux-ha.org/ _______________________________________________________ Linux-HA-Dev: Linux-HA-Dev@lists.linux-ha.org http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev Home Page: http://linux-ha.org/