oracle / weblogic-deploy-tooling

WebLogic Deploy Tooling
https://oracle.github.io/weblogic-deploy-tooling/
Universal Permissive License v1.0
151 stars 90 forks source link

Configure Oracle Diagnostic Log Handler at level of Server Template / Dynamic Server #1527

Closed brieucolivier closed 7 months ago

brieucolivier commented 8 months ago

We are trying to configure a log handler in our WDT Model. In our case we would like to modify the supplemental attributes. After checking the code, we noticed (in odl_deployer.py) that it is only possible for concrete instances of servers. Is it planned to make it possible to manage for Server Template / Dynamic Servers configuration? BR.

robertpatrick commented 8 months ago

@brieucolivier It looks like it is already supported for Dynamic Servers...what am I missing?

https://github.com/oracle/weblogic-deploy-tooling/blob/main/core/src/main/python/wlsdeploy/tool/deploy/odl_deployer.py#L114-L122

brieucolivier commented 8 months ago

The issue we have is that we have a dynamic configuration where we have a range from 1 to n Dynamic Managed Servers, thus the "fixed" named attribute in the referenced file is not fitting to us. E.g., in the line 4 of the example provided here https://oracle.github.io/weblogic-deploy-tooling/samples/odl-model/

We would either need to setup a cluster or a regex to match a dynamic set of servers templates.

robertpatrick commented 8 months ago

So you are likely already using a WDT placeholder property for the DynamicClusterSize so why not just use a placeholder property for the server names?

brieucolivier commented 8 months ago

We are implementing auto scaling so we could have from 1 to N Dynamic Clusters. Defined by a common Server Template. We do not have any definition of Dynamic Server directly, the Dynamic Server instances originates from the Server Template. S How could we define the template so our N Dynamic Clusters will each have the supplemental attributes for the ODL Log Handler?

robertpatrick commented 8 months ago

@brieucolivier I am confused.

The ServerTemplate has nothing to do with either the DynamicClusterSize or the ServerNamePrefix--both are defined in the DynamicServers folder of a Cluster. Presumably, your properties file already has an entry that looks something like this:

Cluster.mycluster.DynamicServers.DynamicServerCount=4

Why can't you add another property to that file that looks something like this:

ODLConfiguration.config1.Servers=MS1,MS2,MS3,MS4

If you added the ServerNamePrefix into the properties file too, it would be pretty easy to write a script that reads the DynamicServerCount and ServerNamePrefix properties and generate the value for the ODL configuration Servers property.

brieucolivier commented 7 months ago

Hello, I completely understand your point and how you want to handle it.

Unfortunately, in our case, the number of dynamic server is not "hardcoded" in the image (model in image). This number is set as a environment variable to be able to "tune" our image easily without rebuilding the image.

In this case, it means that we don't know in advance the size of the cluster.

Regarding the property ODLConfiguration.config1.Servers, we cannot hardcode the name of the servers as we don't know the number of managed server.

We propose to be able to put a regex (or another mechanism) to include a set of managed servers (In this case it can be MS*) or all managed servers of a Cluster.

robertpatrick commented 7 months ago

So use a second environment variable to specify the list of server names?

In your proposal, what exactly would this regex do? You do realize that these server names are used to create directories where a logging XML file is written, right? These directory names must match the managed server names or the software will ignore them.

Regardless of who implements this, they have to dynamically determine the list of server names in order for this to work. I’m not feeling like there is a compelling need for WDT to do this.

brieucolivier commented 7 months ago

So use a second environment variable to specify the list of server names?

Yes indeed, we can do that. Sorry, I did not think about that, but it can work for us.

Thank you very much for the support.