You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by Costin Manolache <cm...@yahoo.com> on 2003/04/14 18:12:19 UTC

Re: [JK2] spliting worker_status to two new workers

Mladen Turk wrote:

> Hi,
> 
> I would like to split status worker to two new workers.
> One is status worker as is, giving all the status info.
> The other is admin worker, that will have some functionality
> from the status workers (displaying configuration setting)
> but will have (if enabled) options to dynamically configure
> JK2 itself.
> This means that the configurations directives could be added,
> edited and deleted at runtime.
> 
> The question is should we allow to save those settings and how.
> Adding woldn't be a problem, but deleting and editing, would
> require additional complex config file parsing.


Not sure I understand. The status worker _does_ save the settings already.
And I think I explained why it has to - at least for apache and
multi-process servers. Whenver you make modifications via jkstatus/, the
changes must be saved so the other apache processes can reparse the file.

I'm -0 on spliting it - I would be +1 on doing it later. IMO the "display
status" is more of a debug function - I think the main use will be via a
JMX console or jmx application that will display the jk info in the larger
context. 
Probably adding the status of jk to the manager/ ( in the same page with the
status for tomcat ) would be a good idea too. 



> My thought on that is to 'dump' the entire configuration instead of
> parsing existing.

That's sort-of how it works. IT doesn't dump all the config - it keeps track
of the original configuration as well as the changes, and it saves
acordingly. I'm trying to implement the same strategy for modeler saving
the mbeans file.

Saving all attributes ( using blind getAttribute ) is ugly and makes the 
file hard to edit by hand. 



> Of course one idea is to enhance the status worker with the admin
> functionallity.

You mean besides what's already there ( the JMX proxy ) ?

Costin 

> 
> Thoughts and objections?





---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org


RE: [JK2] spliting worker_status to two new workers

Posted by Costin Manolache <cm...@yahoo.com>.
Mladen Turk wrote:

> 
> 
>> -----Original Message-----
>> From: news [mailto:news@main.gmane.org] On Behalf Of Costin Manolache
>> > 
>> > I was thinking to rewrite and save the workers2.properties. Status
>> > worker is read only right now.
>> 
>> jkstatus/ can save workers2.properties.
>> It is a big hacky and undocumented maybe. I tested this few
>> days ago - it does seem to work fine.
>>
> 
> I cannot control the _save_ option. Each change is always saved,
> and all my pretty comments are gone ;).

And how do you want to save the comments ? The "info" attribute and
the "disabled" were supposed to reduce the pain.

If you really need the comments, we can add code to preserve them.

I just don't understand what you want here - if you want to save the file
you need a way to preserve the comments ( or they'll be lost ). 

Saving server.xml from /admin no only looses the comments, but it also 
dumps all the attributes and changes the whole structure of the file. 
With modeler - the comments are preserved, but that's only because it's
using DOM which preserves the comments.



>> Have you tried to set values via JMX proxies and didn't work
>> ? What was the error ?
>> 
> 
> No, I was hoping to be able to do that using simple web browser,
> so my entire admin story is about generating hrefs for each mbean.
> Specifying the attributes for whom the hrefs get autogenerated would be
> similar to IndexOptions of
> mod_autoindex.

The JMX proxies are implemented using simple URLs - nothing prevents you
from using them directly. We can change the params to be easier to use with
hrefs if you want. 

The reason I suggest using JMX for jk management is consistency with the
rest of tomcat, and to integrate them with the other things in /manager
or /admin. If you want a jk-specific page - that can be done, but I don't
think it is the best solution, we already use JMX a lot and it would be 
much easier to maintain if we keep things consistent.


Maybe a good first step would be to figure out what we are talking about, 
I have a feeling we are speaking about different things. 


Costin


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org


RE: [JK2] spliting worker_status to two new workers

Posted by Mladen Turk <mt...@apache.org>.

> -----Original Message-----
> From: news [mailto:news@main.gmane.org] On Behalf Of Costin Manolache
> > 
> > I was thinking to rewrite and save the workers2.properties. Status 
> > worker is read only right now.
> 
> jkstatus/ can save workers2.properties. 
> It is a big hacky and undocumented maybe. I tested this few 
> days ago - it does seem to work fine. 
>

I cannot control the _save_ option. Each change is always saved,
and all my pretty comments are gone ;).

> Have you tried to set values via JMX proxies and didn't work 
> ? What was the error ? 
> 

No, I was hoping to be able to do that using simple web browser,
so my entire admin story is about generating hrefs for each mbean.
Specifying the attributes for whom the hrefs get autogenerated would be
similar to IndexOptions of
mod_autoindex.


MT. 


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org


RE: [JK2] spliting worker_status to two new workers

Posted by Costin Manolache <cm...@yahoo.com>.
Mladen Turk wrote:

>> Not sure I understand. The status worker _does_ save the
>> settings already. And I think I explained why it has to - at
>> least for apache and multi-process servers. Whenver you make
>> modifications via jkstatus/, the changes must be saved so the
>> other apache processes can reparse the file.
>>
> 
> I was thinking to rewrite and save the workers2.properties.
> Status worker is read only right now.

jkstatus/ can save workers2.properties. 
It is a big hacky and undocumented maybe. I tested this few days
ago - it does seem to work fine. 

Have you tried to set values via JMX proxies and didn't work ? What was
the error ? 


> I was thinking with the admin worker to be able to enable, or disable
> particular worker,
> and then save this new configuration to workers2.properties.
> Something like simple editor for preconfigured entries, without the need
> to
> reload entire config.

The current code can do exactly that, under the control of JMX. Use the JMX
console to set the "greaceful" attribute in the channel or worker mbean.
When you do that, the workers2.properties file should be saved with the
attribute changed, and the worker disabled. 

The only problem is with apache installed as root, it needs write permission
on workers2.properties ( i.e. the file must be owned by apache, not root )

Costin



---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org


RE: [JK2] spliting worker_status to two new workers

Posted by Mladen Turk <mt...@apache.org>.

> -----Original Message-----
> From: news [mailto:news@main.gmane.org] On Behalf Of Costin Manolache
> > 
> > The question is should we allow to save those settings and 
> how. Adding 
> > woldn't be a problem, but deleting and editing, would require 
> > additional complex config file parsing.
> 
> 
> Not sure I understand. The status worker _does_ save the 
> settings already. And I think I explained why it has to - at 
> least for apache and multi-process servers. Whenver you make 
> modifications via jkstatus/, the changes must be saved so the 
> other apache processes can reparse the file.
>

I was thinking to rewrite and save the workers2.properties.
Status worker is read only right now.
I was thinking with the admin worker to be able to enable, or disable
particular worker,
and then save this new configuration to workers2.properties.
Something like simple editor for preconfigured entries, without the need
to
reload entire config.


MT.


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org