Re: [Resin-interest] Linux startup issue

2010-01-07 Thread Scott Ferguson
Matt Pangaro wrote:
 I'm trying to set up a server with multiple instances of Resin to start 
 those instances on system boot. I've configured the runlevels with 
 chkboot, but I'm running into a problem...

 When the two instances try to start up at runlevel 3, they're both 
 trying to start the Watchdog, and the second one fails because it can't 
 bind the port, so the instance doesn't start.

 I'm on FC8, which doesn't seem to support the richer chkconfig 
 dependencies that are stubbed out in the resin startup script. Does 
 anybody know a good way to reliably get the second instance to start 
 without colliding with the first?
   
The second instance should attach to the first watchdog (assuming you're 
working from the same configuration file.) The start flow looks like:

  1. try to contact and existing watchdog at the watchdog port
   a. if that succeeds, send a BAM/HMTP command to start the new Resin 
instance
  2. otherwise start a new watchdog instance

The watchdog does use the configuration file for authentication. If you 
have different AdminAuthenticator users, the start/stop will fail 
authentication. So if you need isolated instances, you'll need to start 
separate watchdogs.

The watchdog-port in the server block can be used to create separate 
watchdog instances.

-- Scott
 Thanks in advance,
 --Matt


 ___
 resin-interest mailing list
 resin-interest@caucho.com
 http://maillist.caucho.com/mailman/listinfo/resin-interest

   



___
resin-interest mailing list
resin-interest@caucho.com
http://maillist.caucho.com/mailman/listinfo/resin-interest


Re: [Resin-interest] Linux startup issue

2010-01-07 Thread Matt Pangaro
On 1/7/2010 11:39 AM, Scott Ferguson wrote:
 The second instance should attach to the first watchdog (assuming you're
 working from the same configuration file.) The start flow looks like:

1. try to contact and existing watchdog at the watchdog port
 a. if that succeeds, send a BAM/HMTP command to start the new Resin
 instance
2. otherwise start a new watchdog instance

Right, I think what's happening, though, is something like this:

1. linux starts instance a (/etc/rc3.d/S86resin-a start)
1a. that script returns control.
- At this point the script has completed, but resin isn't done 
starting, but watchdog isn't up, running, and ready to respond to the 
command.
2. linux starts instance b (/etc/rc3.d/S95resin-b start)
2a. this tries to connect to watchdog and can't so it initiates that

3. by now the a instance has completed starting its watchdog, so the 
instance b attempt collides

 The watchdog does use the configuration file for authentication. If you
 have different AdminAuthenticator users, the start/stop will fail
 authentication. So if you need isolated instances, you'll need to start
 separate watchdogs.

All the config is shared.

 Thewatchdog-port  in theserver  block can be used to create separate
 watchdog instances.

I could do this, just to avoid the problem, although it seems 
undesirable. I guess another option could be for the server to retry the 
connect if it finds a port conflict. Would that be a desirable mod? If 
so, I could enter it in Mantis.


___
resin-interest mailing list
resin-interest@caucho.com
http://maillist.caucho.com/mailman/listinfo/resin-interest


Re: [Resin-interest] Linux startup issue

2010-01-07 Thread Scott Ferguson
Matt Pangaro wrote:
 On 1/7/2010 11:39 AM, Scott Ferguson wrote:
   
 The second instance should attach to the first watchdog (assuming you're
 working from the same configuration file.) The start flow looks like:

1. try to contact and existing watchdog at the watchdog port
 a. if that succeeds, send a BAM/HMTP command to start the new Resin
 instance
2. otherwise start a new watchdog instance
 

 Right, I think what's happening, though, is something like this:

 1. linux starts instance a (/etc/rc3.d/S86resin-a start)
 1a. that script returns control.
   - At this point the script has completed, but resin isn't done 
 starting, but watchdog isn't up, running, and ready to respond to the 
 command.
   
Hmm. So basically the start command is returning too early, i.e. 
forking the new watchdog but not delaying until it starts. We should 
probably change that behavior.

-- Scott
 2. linux starts instance b (/etc/rc3.d/S95resin-b start)
 2a. this tries to connect to watchdog and can't so it initiates that

 3. by now the a instance has completed starting its watchdog, so the 
 instance b attempt collides

   
 The watchdog does use the configuration file for authentication. If you
 have different AdminAuthenticator users, the start/stop will fail
 authentication. So if you need isolated instances, you'll need to start
 separate watchdogs.
 

 All the config is shared.

   
 Thewatchdog-port  in theserver  block can be used to create separate
 watchdog instances.
 

 I could do this, just to avoid the problem, although it seems 
 undesirable. I guess another option could be for the server to retry the 
 connect if it finds a port conflict. Would that be a desirable mod? If 
 so, I could enter it in Mantis.


 ___
 resin-interest mailing list
 resin-interest@caucho.com
 http://maillist.caucho.com/mailman/listinfo/resin-interest

   



___
resin-interest mailing list
resin-interest@caucho.com
http://maillist.caucho.com/mailman/listinfo/resin-interest


Re: [Resin-interest] Linux startup issue

2010-01-07 Thread Matt Pangaro
On 1/7/2010 12:04 PM, Scott Ferguson wrote:
 Hmm. So basically the start command is returning too early, i.e.
 forking the new watchdog but not delaying until it starts. We should
 probably change that behavior.

Yeah, that's how I'm interpreting what I'm seeing. A change to that 
would probably resolve my issue.

-- Matt


___
resin-interest mailing list
resin-interest@caucho.com
http://maillist.caucho.com/mailman/listinfo/resin-interest