You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by co...@covalent.net on 2002/03/19 07:07:21 UTC
jk2: config
I just commited a big chunk of config changes to support
dynamic configuration of jk2.
I'm pretty happy with the new model - many new things
will become possible.
As you know, I'm usually a bit extreme regarding backward
compatibility. Preserving it is still possible - but
I'm now convinced it would be much better to not do so.
The current code follows a single pattern:
[OBJECT_NAME].[PROPERTY]=value
OBJECT_NAME can be either a previously defined
object ( like 'logger', 'workerEnv', 'config' ) or
a new object that is created when the name is first
reached.
The object is created using a factory that matches
the prefix.
Ex:
worker.ajp13.8009.channel=socket
In this case, "channel" is the property, and
worker.ajp13.8009 is the object name. It'll match
the factory for 'worker.ajp13'.
No need to specify 'type' or 'worker_list' or to
use any other constructs.
The property can be set at any time - but not all
objects and all properties support run-time
config ( at this moment - we'll add this in time ).
The whole idea is that the config is intended for
config tools or other frontends - or at least that's
the goal. We want to allow user configuration, but
in order to support ajp14 and dynamic config ( like
deployment of webapps, etc ) we need to let mod_jk
write the config file.
Axis does the same thing with the wsdl, same for
kde, gnome, etc. The config is editable, but when
the program runs it will manage it and save it.
The main problem is that the comments may be lost,
and any manual change done while the server
is running will probably have the same fate.
Again, this is not for the first release of jk2, but
IMHO it should follow soon.
One idea I'm considering is to use the ini style
for URIs. That is:
[object_name]
propery=value
...
This will make the syntax much cleaner for URIs.
It's a well-known format, used in many cases and programs
- far better than inventing our own ( and better
than hacking the name/value ). Of course, XML
may be a better choice - but I won't volunteer to
do xml processing in C :-)
Costin
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: jk2: config
Posted by jean-frederic clere <jf...@fujitsu-siemens.com>.
costinm@covalent.net wrote:
>
> I just commited a big chunk of config changes to support
> dynamic configuration of jk2.
>
> I'm pretty happy with the new model - many new things
> will become possible.
>
> As you know, I'm usually a bit extreme regarding backward
> compatibility. Preserving it is still possible - but
> I'm now convinced it would be much better to not do so.
We could write a converter from "old" format to "new" format if too many people
complain.
>
> The current code follows a single pattern:
> [OBJECT_NAME].[PROPERTY]=value
>
> OBJECT_NAME can be either a previously defined
> object ( like 'logger', 'workerEnv', 'config' ) or
> a new object that is created when the name is first
> reached.
>
> The object is created using a factory that matches
> the prefix.
>
> Ex:
> worker.ajp13.8009.channel=socket
>
> In this case, "channel" is the property, and
> worker.ajp13.8009 is the object name. It'll match
> the factory for 'worker.ajp13'.
>
> No need to specify 'type' or 'worker_list' or to
> use any other constructs.
>
> The property can be set at any time - but not all
> objects and all properties support run-time
> config ( at this moment - we'll add this in time ).
>
> The whole idea is that the config is intended for
> config tools or other frontends - or at least that's
> the goal. We want to allow user configuration, but
> in order to support ajp14 and dynamic config ( like
> deployment of webapps, etc ) we need to let mod_jk
> write the config file.
>
> Axis does the same thing with the wsdl, same for
> kde, gnome, etc. The config is editable, but when
> the program runs it will manage it and save it.
>
> The main problem is that the comments may be lost,
> and any manual change done while the server
> is running will probably have the same fate.
A warning in the first lines of the file like:
+++
#
# NOTE: This file is automatically updated by the
autoconfigure.
# Any changes will be lost!
#
+++
is probably enough.
>
> Again, this is not for the first release of jk2, but
> IMHO it should follow soon.
>
> One idea I'm considering is to use the ini style
> for URIs. That is:
>
> [object_name]
> propery=value
> ...
>
> This will make the syntax much cleaner for URIs.
> It's a well-known format, used in many cases and programs
> - far better than inventing our own ( and better
> than hacking the name/value ). Of course, XML
> may be a better choice - but I won't volunteer to
> do xml processing in C :-)
If the file is handled by program it does not need to be nice: for me the
property format is enough.
And -0 for using xerces C to do that... I want to run mod_jk on EBCDIC machines
and porting xerces C is some work.
What about parsing the xml file in Java? ;-)
>
> Costin
>
> --
> To unsubscribe, e-mail: <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: config
Posted by co...@covalent.net.
On Mon, 18 Mar 2002, Bill Barker wrote:
> I can see that this is going to make life difficult for ApacheConfig. Yes,
> hopefully we can deprecate it soon. But in the mean time, I'd personally
> prefer that the port is a property of the worker.ajp13. So your example
> would be:
> worker.ajp13.channel=socket
> worker.ajp13.port=8009
ApacheConfig is likely to change into JkConfig - we'll have almost
nothing in httpd.conf, and nothing specific to apache ( except
the experimental <Location>, which I hope to implement using the
config APIs in apache2 - the only purpose is to take advantage of the
native apache mapper and framework ).
Right now there's no 'magic' in jk2, but as soon as things are stable
I'll start adding it - setting the port on the worker is easy, and
more.
If we use a new default name ( jk2.properties ? ) and
default location ( ${ServerRoot}/conf/jk2.properties ), the only
change in httpd.conf will be including mod_jk.so ( and we can
clearly recommend puting mod_jk.so in modules/,
like all other modules )
But in the general case, I want to keep the 'channel.socket' and
'worker.ajp13' separated, and use code in the setter to simplify the
configuration without mixing up the real objects.
> I can't see that many people will do manual changes without at least doing
> "apachectl graceful". As long as that works, I can't see much of a problem
> here (at least in the real world).
There's a small problem here. If you use a management application
or ajp14 to automatically deploy apps - the config file will
change on disk. If you edit it manually at the same time - not
good :-).
You can continue to edit it manually, and it's easy to code
something in the status ( or conf ) worker to reload jk2.properties
gracefully - without even restarting the server. ( you don't
want to restart apache every time a worker is added/removed ).
> It's not that bad. If you allow in C++ (and on non-performance critical
> paths I don't see why not), then it's just http://xml.apache.org/xerces-c/
> And, no, I'm not volunteering either.
Expat is included in apache, but I don't want to increase complexity
without a good reason. Reading is not the big concern here - we'll
also have to write it, and keep code simple.
I would rather spend the time writing a jk_config_ldap - that would
much more sense given the target ( farms of workers and servers, etc ).
But that would require more work on tomcat as well to make it get
config from a directory service ( quite easy to do, if we had time ).
Propeties are good as 'common ground' because they force us to
keep things simple. As soon as we add XML, people may use entities,
includes, etc.
Costin
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: config
Posted by Bill Barker <wb...@wilshire.com>.
----- Original Message -----
From: <co...@covalent.net>
To: <to...@jakarta.apache.org>
Sent: Monday, March 18, 2002 10:07 PM
Subject: jk2: config
> I just commited a big chunk of config changes to support
> dynamic configuration of jk2.
>
> I'm pretty happy with the new model - many new things
> will become possible.
>
> As you know, I'm usually a bit extreme regarding backward
> compatibility. Preserving it is still possible - but
> I'm now convinced it would be much better to not do so.
>
> The current code follows a single pattern:
> [OBJECT_NAME].[PROPERTY]=value
>
> OBJECT_NAME can be either a previously defined
> object ( like 'logger', 'workerEnv', 'config' ) or
> a new object that is created when the name is first
> reached.
>
> The object is created using a factory that matches
> the prefix.
>
> Ex:
> worker.ajp13.8009.channel=socket
>
> In this case, "channel" is the property, and
> worker.ajp13.8009 is the object name. It'll match
> the factory for 'worker.ajp13'.
I can see that this is going to make life difficult for ApacheConfig. Yes,
hopefully we can deprecate it soon. But in the mean time, I'd personally
prefer that the port is a property of the worker.ajp13. So your example
would be:
worker.ajp13.channel=socket
worker.ajp13.port=8009
>
> No need to specify 'type' or 'worker_list' or to
> use any other constructs.
>
> The property can be set at any time - but not all
> objects and all properties support run-time
> config ( at this moment - we'll add this in time ).
>
> The whole idea is that the config is intended for
> config tools or other frontends - or at least that's
> the goal. We want to allow user configuration, but
> in order to support ajp14 and dynamic config ( like
> deployment of webapps, etc ) we need to let mod_jk
> write the config file.
>
> Axis does the same thing with the wsdl, same for
> kde, gnome, etc. The config is editable, but when
> the program runs it will manage it and save it.
>
> The main problem is that the comments may be lost,
> and any manual change done while the server
> is running will probably have the same fate.
I can't see that many people will do manual changes without at least doing
"apachectl graceful". As long as that works, I can't see much of a problem
here (at least in the real world).
>
> Again, this is not for the first release of jk2, but
> IMHO it should follow soon.
>
> One idea I'm considering is to use the ini style
> for URIs. That is:
>
> [object_name]
> propery=value
> ...
Well, the MS syntax is well known. I don't have a better suggestion, so
I'll hold my nose and +0.
>
> This will make the syntax much cleaner for URIs.
> It's a well-known format, used in many cases and programs
> - far better than inventing our own ( and better
> than hacking the name/value ). Of course, XML
> may be a better choice - but I won't volunteer to
> do xml processing in C :-)
It's not that bad. If you allow in C++ (and on non-performance critical
paths I don't see why not), then it's just http://xml.apache.org/xerces-c/
And, no, I'm not volunteering either.
>
> Costin
>
>
> --
> To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
> For additional commands, e-mail:
<ma...@jakarta.apache.org>
>
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>