biemond / biemond-orawls

Puppet 3/4 module for WebLogic provisioning module ( Linux & Solaris )
Apache License 2.0
63 stars 104 forks source link

stuck in dependency cycle on clusters/datasource #425

Closed mdplatts closed 7 years ago

mdplatts commented 7 years ago

Probably me doing it wrong and I apologise if this is the wrong place, but I'm getting the following error -

Error: Failed to apply catalog: Found 1 dependency cycle: (Class[Datasources] => Wls_datasource[xxx/ClusterLeasingDataSource] => Wls_cluster[xxx/NameServerCluster] => Class[Cluster] => Class[Datasources])

I have this data source -

datasource_instances:
  xxx/ClusterLeasingDataSource:
    ensure: present
    jndinames: ClusterLeasingDataSource
    drivername: oracle.jdbc.driver.OracleDriver
    globaltransactionsprotocol: None
    usexa: '0'
    initialcapacity: '2'
    maxcapacity: 50
    testtablename: 'SQL SELECT 1 FROM DUAL'
    target:
      - NameServerCluster
    targettype:
      - Cluster

And this cluster definition -

cluster_instances:
  xxx/NameServerCluster:
    ensure: present
    messagingmode:              'unicast'
    #migrationbasis:             'database'
    migrationbasis:             'consensus'
    #migration_datasource:       'ClusterLeasingDataSource'
    servers:
      - 'ns_1'
      - 'ns_2'
      - 'ns_3'

If I leave it as 'consensus' then puppet runs but if I change it to "database" and "ClusterLeasingSource" then I get the dependency error. I'm trying to do that to see if I can get a 3-node cluster to run as a one node cluster (e.g. in the event of the failure of two of the three AZ's in our AWS account). I can reduce 3 to 2 nodes but not 2 to 1 (or even reboot the one) and someone suggested I try switching to database.

I'd also want to use the data source for mutliple different clusters - which given the "migration_table_name" value I'm presuming it should be possible to share a schema and just have several tables in the one place.

biemond commented 7 years ago

Hi

you got the chicken and egg situations but you can always assign the datasource to the cluster nodes (servers) instead of cluster. That also works.

thanks

mdplatts commented 7 years ago

Thanks - I tried that and it still reports the same as if its ignored the changes (unless I misunderstood which is always an option) -

datasource_instances:
  xxx/ClusterLeasingDataSource:
    ensure: present
    jndinames: ClusterPool
    drivername: oracle.jdbc.driver.OracleDriver
    globaltransactionsprotocol: None
    usexa: '0'
    initialcapacity: '2'
    maxcapacity: '50'
    testtablename: 'SQL SELECT 1 FROM DUAL'
    target:
      - ns_1
      - ns_2
      - ns_3
    targettype:
      - Server
      - Server
      - Server

The graph remains the same as if its ignored the changes -

digraph Resource_Cycles {
  label = "Resource Cycles"
"Class[Datasources]" -> "Wls_datasource[strata/ClusterLeasingDataSource]" -> "Wls_cluster[xxx/EchCluster]" -> "Class[Cluster]" -> "Class[Datasources]"
"Class[Datasources]" -> "Wls_datasource[strata/ClusterLeasingDataSource]" -> "Wls_cluster[xxx/NameServerCluster]" -> "Class[Cluster]" -> "Class[Datasources]"
"Class[Datasources]" -> "Wls_datasource[strata/ClusterLeasingDataSource]" -> "Wls_cluster[xxx/SICluster]" -> "Class[Cluster]" -> "Class[Datasources]"
"Class[Datasources]" -> "Wls_datasource[strata/ClusterLeasingDataSource]" -> "Wls_cluster[xxx/XxxCluster]" -> "Class[Cluster]" -> "Class[Datasources]"
"Class[Datasources]" -> "Wls_datasource[strata/ClusterLeasingDataSource]" -> "Wls_cluster[xxx/SupCluster]" -> "Class[Cluster]" -> "Class[Datasources]"
}
biemond commented 7 years ago

Ok,

but now I think it is in your code , you added some dependency on class Cluster back to datasources again.

mdplatts commented 7 years ago

Its just as in the first post - but with the database options uncommented to "enable" the feature. e.g.

cluster_instances:
  xxx/NameServerCluster:
    ensure: present
    messagingmode:               'unicast'
    migrationbasis:                  'database'
    migration_datasource:       'ClusterLeasingDataSource'
    migration_table_name:      'XXX_NS' 
    servers:
      - 'ns_1'
      - 'ns_2'
      - 'ns_3'

Will take another look - thanks.

biemond commented 7 years ago

if I look at this , it should be first servers -> datasource -> cluster.

can you show me your manifest and the hiera parts.

mdplatts commented 7 years ago

Sorry for the delay - not had chance to try this yet (I did a quick test but it didnt seem to fix it but it might still be me).

A quick question rather than a separate log (unless you or github would prefer it to be separate) - is there support for startup classes. I cannot see it but I need to add some to support a 3rd party instrumentation/monitoring tool - CA APM (https://docops.ca.com/ca-apm/10-1/en/implementing-agents/java-agent/install-the-java-agent/configure-application-server-to-use-the-java-agent/oracle-weblogic/)

I can add startup arguments and extra jar files to the classpath but I've not seen that a startupclass is supported.

I support I might need to run a wlst script to do it or try (unlikely to succeed) to add it to the module.

biemond commented 7 years ago

Hi,

I guess I don't support this but you can send me a PullRequest

Thanks

mdplatts commented 7 years ago

will see what I can do.