Caucho Forums  

This forum is permanently closed because of spam. For free community support, please visit Google Groups:


Go Back   Caucho Forums > Resin

Reply
 
Thread Tools Display Modes
  #1  
Old 12-16-2011, 07:54 PM
theBlueSage theBlueSage is offline
Member
 
Join Date: Apr 2011
Posts: 33
Default adding different http ports to resin.properties does not work

according to your documentation here : http://caucho.com/resin-4.0/changes/resin-4.0.24.xtp

I should be able to change the http port for each of my servers defined in resin.properties, and use server-multi to set them up. Well, using the config below this is failing.

-------------resin.properties snip ---------------
setuid_user : orion
setuid_group : orion

app_tier : 192.168.2.252:6800 192.168.2.252:6801

http : 8080
app-0.http : 10880
app-1.http : 10881

--------------- end resin.properties snip ---------------

and here is the relevant part from the resin.xml file

---------- resin.xml snip -------------------------
<cluster id="app_tier">

<!-- sets the content root for the cluster, relative to resin.root -->
<root-directory>.</root-directory>

<!-- define the servers in the cluster -->
<server-multi id-prefix="app-" address-list="${app_tier}" port="6800" >
<http port="${rvar('http')}" />
<http port="${rvar('https')}">
<jsse-ssl self-signed-certificate-name="resin@localhost"/>
</http>
</server-multi>
...
</cluster>

I start the first server using this (yes I contrarily started app-1 before app-0, and yes I tried it the other way too with app-0 first and it made no difference) :

java -jar /home/orion/clusterResins/latest_resin/lib/resin.jar -resin-home /home/orion/resinB -log-directory /home/orion/resinB/log/ -root-directory /home/orion/resinB -server app-1 start

This part went well and I see my' hello world' at 192.168.2.252:10881/ . I then started the second serer with the following command :

java -jar /home/orion/clusterResins/latest_resin/lib/resin.jar -resin-home /home/orion/resin -log-directory /home/orion/resin/log/ -root-directory /home/orion/resin -server app-0 start

and although the start command rendered :

Resin/4.0.24 started -server 'app-0' for watchdog at 127.0.0.1:6600

the watchdog.log showed this :
[2011/12/16 14:29:13.402] {watchdog-app-1} WatchdogChild[app-1] starting
[2011/12/16 14:29:13.420] {watchdog-app-1} Watchdog starting Resin[app-1]
[2011/12/16 14:29:45.718] {watchdog-app-0} WatchdogChild[app-0] starting
[2011/12/16 14:29:45.731] {watchdog-app-0} Watchdog starting Resin[app-0]
[2011/12/16 14:29:50.863] {watchdog-app-0} java.io.IOException: Socket bind failed for null:10881 while running as orion. Check for other processes listening to the port and check for permissions (root on unix).
at com.caucho.vfs.JniServerSocketImpl.<init>(JniServe rSocketImpl.java:65)
at com.caucho.vfs.JniServerSocketImpl.create(JniServe rSocketImpl.java:147)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Native MethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(De legatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.caucho.vfs.QJniServerSocket.createJNI(QJniServ erSocket.java:146)
at com.caucho.network.listen.TcpSocketLinkListener.bi ndForWatchdog(TcpSocketLinkListener.java:1155)
at com.caucho.boot.WatchdogChildProcess.createProcess (WatchdogChildProcess.java:497)
at com.caucho.boot.WatchdogChildProcess.run(WatchdogC hildProcess.java:189)
at com.caucho.boot.WatchdogChildTask.run(WatchdogChil dTask.java:219)
at com.caucho.env.thread.ResinThread.runTasks(ResinTh read.java:164)
at com.caucho.env.thread.ResinThread.run(ResinThread. java:130)
[2011/12/16 14:29:50.866] {watchdog-app-0} com.caucho.config.ConfigException: <user-name> requires compiled JNI.
at com.caucho.boot.WatchdogChildProcess.createProcess (WatchdogChildProcess.java:548)
at com.caucho.boot.WatchdogChildProcess.run(WatchdogC hildProcess.java:189)
at com.caucho.boot.WatchdogChildTask.run(WatchdogChil dTask.java:219)
at com.caucho.env.thread.ResinThread.runTasks(ResinTh read.java:164)
at com.caucho.env.thread.ResinThread.run(ResinThread. java:130)


As you can see, the watchdog tried to start the app-0 server at the http port of 10881, which is the port for app-1. When I start app-0 first, the same clash happens but on port 10880. In other words the first startup does pick up the correct http port, but the second one does not.

Please let me know what I am doing wrong, I'd love to get this going before the end of next week ...

Thanks in advance for your time and support
Reply With Quote
  #2  
Old 12-21-2011, 01:19 AM
alex alex is offline
Administrator
 
Join Date: Aug 2009
Posts: 218
Default

theBlueSage,

I filed a bug for this:
http://bugs.caucho.com/view.php?id=4900

Can you try commenting out setuid_user and group from resin.properties.

Thanks,
Alex
Reply With Quote
  #3  
Old 12-21-2011, 02:10 PM
theBlueSage theBlueSage is offline
Member
 
Join Date: Apr 2011
Posts: 33
Default

<amazement>wow</amazement>

Ok, that worked. I would never have guessed that in a million years. Oddly enough the servers are started as the user we have in the username/group fields anyway, I just had it there as a safeguard. For now I can do without using those fields, so I will move on to the next stage.

Thanks for the answer, do you guys release patches, or only major releases?
Reply With Quote
  #4  
Old 12-21-2011, 05:07 PM
alex alex is offline
Administrator
 
Join Date: Aug 2009
Posts: 218
Default

We release fairly frequently, that's why we don't release patches. The next release is about 5-10 workdays away.
Glad it worked!
Thanks,
Alex
Reply With Quote
  #5  
Old 12-22-2011, 04:35 PM
theBlueSage theBlueSage is offline
Member
 
Join Date: Apr 2011
Posts: 33
Default

As an update to this, it appears the same thing is happening for any jvm_args lines passed using rvar ...

using this in resin.properties :

app-0.jvm_args : -Xloggc:/home/orion/clusterResins/A/log/gc.log -Djava.io.tmpdir=/tmp/resin
app-1.jvm_args : -Xloggc:/home/orion/clusterResins/B/log/gc.log -Djava.io.tmpdir=/tmp/resinB
app-2.jvm_args : -Xloggc:/home/orion/clusterResins/C/log/gc.log -Djava.io.tmpdir=/tmp/resinC

and applying it in resin.xml using :

<jvm-arg>${rvar('jvm_args')</jvm-arg>

I have tried this line in both the <server-default> container, and also inside the <server-multi> container. Regardless of where it is put, the GC otput is appended onto the jvm-app-RESNSVR.log, e.g. jvm-app-1.log or jvm-app-0.log

Interestingly enough if I go to /resin-admin/ and look at the config for the cluster, I see this line (I started resinC (app-2) first ...

<jvm-arg>-Xloggc:/home/orion/clusterResins/C/log/gc.log</jvm-arg>
<jvm-arg>-Djava.io.tmpdir=/tmp/resinC</jvm-arg>

While I really like the abstraction work you have done here with resin.properties, I wish it would work as advertised, or there be a more accurate documentation set for these features.
Reply With Quote
  #6  
Old 12-22-2011, 06:31 PM
ferg ferg is offline
Administrator
 
Join Date: Aug 2009
Posts: 190
Default

The issue is with the properties read by the watchdog, not the Resin instance. So jvm-args, and the http port when using setuid are the main ones. There's a fix for 4.0.25 which will probably be the first or second week of January.
Reply With Quote
  #7  
Old 12-22-2011, 06:43 PM
alex alex is offline
Administrator
 
Join Date: Aug 2009
Posts: 218
Default

theBlueSage, can you make sure that the directories exist?

The JVM won't create them.

/home/orion/clusterResins/A/log/
/home/orion/clusterResins/B/log/
/home/orion/clusterResins/C/log/

Thanks,
Alex
Reply With Quote
  #8  
Old 12-22-2011, 08:04 PM
theBlueSage theBlueSage is offline
Member
 
Join Date: Apr 2011
Posts: 33
Default

yes the directories exist. I have tried to also do something like :

<jvm-arg>-Xloggc:{resin.home}/log/gc.log</jvm-arg>

In this case the gc.log shows up in the log dir of the resin that started the watchdog, but none of the others get a gc.log at all, not even in the jvm log
Reply With Quote
  #9  
Old 12-22-2011, 08:09 PM
theBlueSage theBlueSage is offline
Member
 
Join Date: Apr 2011
Posts: 33
Default

Ferg,

Will the fixes in 4.0.25 work for _all_ JVM args passed via resin.properties, including things like memory tweaking in the JVM etc, per resin within the cluster? Will I be able to pass _any_ variable at a resin specific level and have that available in the resin.xml via the {rvar... mechanism?
Reply With Quote
  #10  
Old 12-22-2011, 08:40 PM
ferg ferg is offline
Administrator
 
Join Date: Aug 2009
Posts: 190
Default

It should be. I added a test for jvm-arg with the two Resin in one watchdog example. Since the jvm-arg is just a string, and the rvar/EL is just interpolated, you can assign anything you want.
Reply With Quote
Reply

Tags
dynamic http port, resin-pro 4.0.24, server-multi

Thread Tools
Display Modes

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 On
HTML code is Off

Forum Jump


All times are GMT. The time now is 05:06 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.