Had an offline discussion with Akila, Sajith & Gayan. It is not a good idea to introduce new configuration files in a minor release.
So we are going to read the same cartridge-config.properties fie from AS. For that, we are moving CartridgeConfigFileReader class from SM to Common package and call CartridgeConfigFileReader.readProperties() from both AS & SM. It will ensure that AS will have those services URLs as system properties always. Thanks, Raj. On Fri, Nov 13, 2015 at 5:03 PM, Rajkumar Rajaratnam <rajkum...@wso2.com> wrote: > > > On Fri, Nov 13, 2015 at 4:54 PM, Sajith Kariyawasam <saj...@wso2.com> > wrote: > >> From which component do we read puppet.* values? >> > > AS. > > > >> >> On Fri, Nov 13, 2015 at 4:19 PM, Rajkumar Rajaratnam <rajkum...@wso2.com> >> wrote: >> >>> Akila, +1. >>> >>> @All, What do you think about the following structure for >>> stratos-manager.xml? It is similar to autoscaler.xml. >>> >>> <configuration> >>> <stratosManager> >>> <cloudController> >>> <hostname>localhost</hostname> >>> <port>9443</port> >>> <serviceSuffix>services/CloudControllerService</serviceSuffix> >>> <!-- cloud controller client timout in ms --> >>> <clientTimeout>300000</clientTimeout> >>> </cloudController> >>> <Metering> >>> <hostname>localhost</hostname> >>> <port>9443</port> >>> >>> <serviceSuffix>portal/dashboards/metering-dashboard</serviceSuffix> >>> <!-- metering client timout in ms --> >>> <clientTimeout>300000</clientTimeout> >>> </Metering> >>> <Monitoring> >>> <hostname>localhost</hostname> >>> <port>9443</port> >>> >>> <serviceSuffix>portal/dashboards/monitoring-dashboard</serviceSuffix> >>> <!-- monitoring client timout in ms --> >>> <clientTimeout>300000</clientTimeout> >>> </Monitoring> >>> <threadpool> >>> <identifier>stratosManager</identifier> >>> <threadPoolSize>10</threadPoolSize> >>> </threadpool> >>> </stratosManager> >>> </configuration> >>> >>> Thanks, >>> Raj. >>> >>> On Fri, Nov 13, 2015 at 3:49 PM, Akila Ravihansa Perera < >>> raviha...@wso2.com> wrote: >>> >>>> Hi, >>>> >>>> I'd prefer not to use System variables to pass service URLs. Any >>>> component which needs those can read from the file right? >>>> >>>> Thanks. >>>> >>>> On Fri, Nov 13, 2015 at 3:15 PM, Rajkumar Rajaratnam < >>>> rajkum...@wso2.com> wrote: >>>> >>>>> Hi All, >>>>> >>>>> Thanks for your thoughts. >>>>> >>>>> Will do the following. >>>>> >>>>> 1) Lets remove service URLs (AS, SM, CC & DAS) from >>>>> cartridge-config.properties file >>>>> 2) Lets included these service URLs in stratos-manager.xml (new) and >>>>> autoscaler.xml. CC doesn't need these URLs. >>>>> 3) Configuration file (stratos-manager.xml & autoscaler.xml) >>>>> readers/parsers will set these URLs as system variables. >>>>> 4) No other code changes required, because we are reading these >>>>> properties from system variables in our code base (expect DAS URLs) >>>>> 5) Lets update the console app [1] to read the DAS metering & >>>>> monitoring URLs from stratos-manager.xml >>>>> >>>>> If you think this is too much work for this release, we can read the >>>>> same cartridge-config.properties file from both SM & AS. >>>>> >>>>> Please do let me know if you have any concerns. >>>>> >>>>> [1] >>>>> https://github.com/apache/stratos/blob/stratos-4.1.x/components/org.apache.stratos.manager.console/console/app.js#L48 >>>>> >>>>> Thanks, >>>>> Raj. >>>>> >>>>> On Fri, Nov 13, 2015 at 2:19 PM, Sajith Kariyawasam <saj...@wso2.com> >>>>> wrote: >>>>> >>>>>> What if we keep stratos-manger.xml, cloud-controller.xml (already >>>>>> have) and autoscaler.xml (already have) file and move only the relevant >>>>>> configs to each of those files? >>>>>> For eg, the values need to be read by SM should only be in >>>>>> stratos-manager.xml. >>>>>> I think cartridge-config.properties file was meant to be read by SM >>>>>> only and if other components are using the values defined in that file, >>>>>> IMO >>>>>> its not good. >>>>>> >>>>>> >>>>>> On Fri, Nov 13, 2015 at 1:55 PM, Thanuja Uruththirakodeeswaran < >>>>>> thanu...@wso2.com> wrote: >>>>>> >>>>>>> >>>>>>> >>>>>>> On Fri, Nov 13, 2015 at 12:53 PM, Gayan Gunarathne <gay...@wso2.com> >>>>>>> wrote: >>>>>>> >>>>>>>> Hi, >>>>>>>> >>>>>>>> On Fri, Nov 13, 2015 at 12:42 PM, Rajkumar Rajaratnam < >>>>>>>> rajkum...@wso2.com> wrote: >>>>>>>> >>>>>>>>> Hi Devs, >>>>>>>>> >>>>>>>>> This file content is as below. >>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>>> *autoscaler.service.url=https://localhost:9443/services/AutoscalerService/ >>>>>>>>> <https://localhost:9443/services/AutoscalerService/>cloud.controller.service.url=https://localhost:9443/services/CloudControllerService/ >>>>>>>>> <https://localhost:9443/services/CloudControllerService/>stratos.manager.service.url=https://localhost:9443/services/StratosManagerService/ >>>>>>>>> <https://localhost:9443/services/StratosManagerService/>das.metering.dashboard.url=https://localhost:9444/portal/dashboards/metering-dashboard >>>>>>>>> <https://localhost:9444/portal/dashboards/metering-dashboard>das.monitoring.dashboard.url=https://localhost:9444/portal/dashboards/monitoring-dashboard >>>>>>>>> <https://localhost:9444/portal/dashboards/monitoring-dashboard>puppet.ip=127.0.0.1puppet.hostname=puppet.stratos.apache.org >>>>>>>>> <http://puppet.stratos.apache.org>puppet.dns.available=falsepuppet.environment=stratos* >>>>>>>>> >>>>>>>>> CartridgeConfigFileReader class (part of SM component) reads this >>>>>>>>> file and set these properties as system variables and these system >>>>>>>>> variables are used by other components like AS (to communicate with >>>>>>>>> CC). >>>>>>>>> >>>>>>>>> This approach have several issues. >>>>>>>>> >>>>>>>>> a) Since the component's start up order is CC > AS > SM, there is >>>>>>>>> no guarantee that these properties will be set before other components >>>>>>>>> start. >>>>>>>>> b) In distributed deployment, these properties will not be set in >>>>>>>>> AS JVM. >>>>>>>>> c) This file contains information which are used by other >>>>>>>>> components, not only cartridges. So this file name is misleading. >>>>>>>>> >>>>>>>>> IMO, we need to fix it for 4.1.5 release. Without fixing this, I >>>>>>>>> can't fix the issue discussed in [1]. I am getting error [2]. >>>>>>>>> >>>>>>>>> There can be several way to fix this; some of them are. >>>>>>>>> >>>>>>>>> A) We can remove following properties from >>>>>>>>> cartridge-config.properties file and set them as system properties in >>>>>>>>> stratos.sh scripts. >>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>>> *autoscaler.service.url=https://localhost:9443/services/AutoscalerService/ >>>>>>>>> <https://localhost:9443/services/AutoscalerService/>cloud.controller.service.url=https://localhost:9443/services/CloudControllerService/ >>>>>>>>> <https://localhost:9443/services/CloudControllerService/>stratos.manager.service.url=https://localhost:9443/services/StratosManagerService/ >>>>>>>>> <https://localhost:9443/services/StratosManagerService/>das.metering.dashboard.url=https://localhost:9444/portal/dashboards/metering-dashboard >>>>>>>>> <https://localhost:9444/portal/dashboards/metering-dashboard>das.monitoring.dashboard.url=https://localhost:9444/portal/dashboards/monitoring-dashboard >>>>>>>>> <https://localhost:9444/portal/dashboards/monitoring-dashboard>* >>>>>>>>> >>>>>>>> >>>>>>> +1 to move *das.metering.dashboard.url and * >>>>>>> *das.monitoring.dashboard.url *properties to stratos.sh. >>>>>>> Because I also had an issue in reading this properties at webapp >>>>>>> initialization as webapp initialized before SM gets activated and at the >>>>>>> time of webapp initialization these properties are not exported as >>>>>>> system >>>>>>> properties and can't read them using jaggery 'process' module. >>>>>>> So I loaded cartridge-config.properties file using jaggery 'carbon' >>>>>>> module and read these two param at webapp initialization as in here[1]. >>>>>>> >>>>>>> [1]. >>>>>>> https://github.com/apache/stratos/blob/stratos-4.1.x/components/org.apache.stratos.manager.console/console/app.js#L48 >>>>>>> >>>>>>> >>>>>>>>> >>>>>>>>> B) This file should be read by all other components (e.g SM, AS) >>>>>>>>> which need these properties. >>>>>>>>> >>>>>>>>> WDYT? >>>>>>>>> >>>>>>>> >>>>>>>> IMO we can read this file and maintain the information in the in >>>>>>>> memory so every component can pick from there. We can have a common >>>>>>>> method >>>>>>>> to read this file as those properties are used among all the >>>>>>>> components. >>>>>>>> Also we can change the configuration name also as that >>>>>>>> configuration name seems to be confuse. May be we can have like >>>>>>>> stratos-config.properties >>>>>>>> >>>>>>>> >>>>>>>>> [1] [Stratos 4.1.5] [Blocker] Monitors are not created on Stratos >>>>>>>>> restart >>>>>>>>> [2] >>>>>>>>> >>>>>>>>> [2015-11-13 11:37:36,468] ERROR >>>>>>>>> {org.apache.stratos.autoscaler.monitor.MonitorFactory} - Error while >>>>>>>>> validating deployment policy from cloud controller >>>>>>>>> [network-partition-id] >>>>>>>>> network-partition-1 >>>>>>>>> java.lang.RuntimeException: System property not found: >>>>>>>>> cloud.controller.service.url >>>>>>>>> at >>>>>>>>> org.apache.stratos.common.client.CloudControllerServiceClient.getInstance(CloudControllerServiceClient.java:75) >>>>>>>>> at >>>>>>>>> org.apache.stratos.autoscaler.monitor.MonitorFactory.getClusterMonitor(MonitorFactory.java:270) >>>>>>>>> at >>>>>>>>> org.apache.stratos.autoscaler.monitor.MonitorFactory.getMonitor(MonitorFactory.java:83) >>>>>>>>> at >>>>>>>>> org.apache.stratos.autoscaler.monitor.component.ParentComponentMonitor$MonitorAdder.run(ParentComponentMonitor.java:1001) >>>>>>>>> at >>>>>>>>> java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) >>>>>>>>> at java.util.concurrent.FutureTask.run(FutureTask.java:262) >>>>>>>>> at >>>>>>>>> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) >>>>>>>>> at >>>>>>>>> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) >>>>>>>>> at java.lang.Thread.run(Thread.java:745) >>>>>>>>> [2015-11-13 11:37:36,469] ERROR >>>>>>>>> {org.apache.stratos.autoscaler.monitor.component.ParentComponentMonitor} >>>>>>>>> - >>>>>>>>> An error occurred while starting monitor: [type] cluster [component] >>>>>>>>> single-cartridge-app.my-php.php.domain >>>>>>>>> java.lang.RuntimeException: Error while validating deployment >>>>>>>>> policy from cloud controller [network-partition-id] >>>>>>>>> network-partition-1 >>>>>>>>> at >>>>>>>>> org.apache.stratos.autoscaler.monitor.MonitorFactory.getClusterMonitor(MonitorFactory.java:278) >>>>>>>>> at >>>>>>>>> org.apache.stratos.autoscaler.monitor.MonitorFactory.getMonitor(MonitorFactory.java:83) >>>>>>>>> at >>>>>>>>> org.apache.stratos.autoscaler.monitor.component.ParentComponentMonitor$MonitorAdder.run(ParentComponentMonitor.java:1001) >>>>>>>>> at >>>>>>>>> java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) >>>>>>>>> at java.util.concurrent.FutureTask.run(FutureTask.java:262) >>>>>>>>> at >>>>>>>>> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) >>>>>>>>> at >>>>>>>>> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) >>>>>>>>> at java.lang.Thread.run(Thread.java:745) >>>>>>>>> Caused by: java.lang.RuntimeException: System property not found: >>>>>>>>> cloud.controller.service.url >>>>>>>>> at >>>>>>>>> org.apache.stratos.common.client.CloudControllerServiceClient.getInstance(CloudControllerServiceClient.java:75) >>>>>>>>> at >>>>>>>>> org.apache.stratos.autoscaler.monitor.MonitorFactory.getClusterMonitor(MonitorFactory.java:270) >>>>>>>>> ... 7 more >>>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>>> >>>>>>>>> Thanks, >>>>>>>>> Raj. >>>>>>>>> >>>>>>>>> -- >>>>>>>>> Rajkumar Rajaratnam >>>>>>>>> Committer & PMC Member, Apache Stratos >>>>>>>>> Software Engineer, WSO2 >>>>>>>>> >>>>>>>>> Mobile : +94777568639 >>>>>>>>> Blog : rajkumarr.com >>>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> -- >>>>>>>> >>>>>>>> Gayan Gunarathne >>>>>>>> Technical Lead, WSO2 Inc. (http://wso2.com) >>>>>>>> Committer & PMC Member, Apache Stratos >>>>>>>> email : gay...@wso2.com | mobile : +94 775030545 >>>>>>>> <%2B94%20766819985> >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>> >>>>>>> >>>>>>> >>>>>>> -- >>>>>>> Thanuja Uruththirakodeeswaran >>>>>>> Software Engineer >>>>>>> WSO2 Inc.;http://wso2.com >>>>>>> lean.enterprise.middleware >>>>>>> >>>>>>> mobile: +94 774363167 >>>>>>> >>>>>> >>>>>> >>>>>> >>>>>> -- >>>>>> Sajith Kariyawasam >>>>>> *Committer and PMC member, Apache Stratos, * >>>>>> *WSO2 Inc.; http://wso2.com <http://wso2.com>* >>>>>> *Mobile: 0772269575* >>>>>> >>>>> >>>>> >>>>> >>>>> -- >>>>> Rajkumar Rajaratnam >>>>> Committer & PMC Member, Apache Stratos >>>>> Software Engineer, WSO2 >>>>> >>>>> Mobile : +94777568639 >>>>> Blog : rajkumarr.com >>>>> >>>> >>>> >>>> >>>> -- >>>> Akila Ravihansa Perera >>>> WSO2 Inc.; http://wso2.com/ >>>> >>>> Blog: http://ravihansa3000.blogspot.com >>>> >>> >>> >>> >>> -- >>> Rajkumar Rajaratnam >>> Committer & PMC Member, Apache Stratos >>> Software Engineer, WSO2 >>> >>> Mobile : +94777568639 >>> Blog : rajkumarr.com >>> >> >> >> >> -- >> Sajith Kariyawasam >> *Committer and PMC member, Apache Stratos, * >> *WSO2 Inc.; http://wso2.com <http://wso2.com>* >> *Mobile: 0772269575* >> > > > > -- > Rajkumar Rajaratnam > Committer & PMC Member, Apache Stratos > Software Engineer, WSO2 > > Mobile : +94777568639 > Blog : rajkumarr.com > -- Rajkumar Rajaratnam Committer & PMC Member, Apache Stratos Software Engineer, WSO2 Mobile : +94777568639 Blog : rajkumarr.com