Hi Nirmal,
I guess in an ideal world, the wso2server.sh script with Carbon would be
generic enough to be usable for all products without editing.
The products would have their own custom configuration file that would be
included, for example:
wso2server.sh:
...
source $PRGDIR/server-properties.sh
while [ "$status" = "$START_EXIT_STATUS" ]
do
$JAVACMD \
-Xbootclasspath/a:"$CARBON_XBOOTCLASSPATH" \
$JAVA_MEMORY_SETTINGS \
-XX:+HeapDumpOnOutOfMemoryError \
-XX:HeapDumpPath="$CARBON_HOME/repository/logs/heap-dump.hprof" \
$JAVA_OPTS \
-Dcom.sun.management.jmxremote \
...
-Djava.security.egd=file:/dev/./urandom \
-Dfile.encoding=UTF8 \
$CUSTOM_STARTUP_ARGS \
org.wso2.carbon.bootstrap.Bootstrap $*
status=$?
done
...
server-properties.sh:
#!/bin/sh
export JAVA_MEMORY_SETTINGS="-Xms256m -Xmx1024m -XX:MaxPermSize=256m"
export
CUSTOM_STARTUP_ARGS="-Dloadbalancer.conf=file:repository/conf/loadbalancer.conf"
The server-properties.sh would be checked into git with suitable default
settings, but may be edited by the administrator to tweak settings.
The maven build for a product would include the standard wso2server.sh
file, and the product specific server-properties.sh file. The example
above is fairly crude, but hopefully demonstrates the separation between
standard functionality across all carbon based products, and the product
specific configuration.
Cheers,
Chris
On Thu, Jan 9, 2014 at 3:47 PM, Nirmal Fernando <[email protected]>wrote:
> Hi Chris,
>
> Where do you intend to do this? AFAIU at the time of servers start-up
> right? Can we generate these scripts once the products get build? So, that
> the maven built product would contain the required script to start the
> respective server? wdyt?
>
>
> On Thu, Jan 9, 2014 at 7:59 PM, chris snow <[email protected]> wrote:
>
>> Nirmal, is this what you were thinking as well, or are you suggesting
>> something else?
>> On 9 Jan 2014 14:19, "chris snow" <[email protected]> wrote:
>>
>>> Hi Nirmal,
>>>
>>> I was thinking that the script would be manually created, but the
>>> certain parts of the configuration would be extracted, so instead of this:
>>>
>>> while [ "$status" = "$START_EXIT_STATUS" ]
>>> do
>>> $JAVACMD \
>>> -Xbootclasspath/a:"$CARBON_XBOOTCLASSPATH" \
>>> -Xms256m -Xmx1024m -XX:MaxPermSize=256m \
>>> -XX:+HeapDumpOnOutOfMemoryError \
>>> ...
>>> done
>>>
>>> you would have something like this:
>>>
>>> while [ "$status" = "$START_EXIT_STATUS" ]
>>> do
>>> $JAVACMD \
>>> -Xbootclasspath/a:"$CARBON_XBOOTCLASSPATH" \
>>> $JAVA_MEM_SETTINGS \
>>> -XX:+HeapDumpOnOutOfMemoryError \
>>> ...
>>> done
>>>
>>> there would then be a custom properties file that would be read by the
>>> startup script, for example
>>>
>>> JAVA_MEM_SETTINGS= -Xms256m -Xmx1024m -XX:MaxPermSize=256m
>>>
>>> You would then have different property files for different products, e.g.
>>>
>>> stratos-load-balancer-startup.properties (e.g. for the load balancer
>>> product when installed standalone)
>>>
>>> JAVA_MEM_SETTINGS= -Xms256m -Xmx1024m -XX:MaxPermSize=256m
>>>
>>> stratos-manager-startup.properties (e.g. for the manager product when
>>> installed standalone)
>>>
>>> JAVA_MEM_SETTINGS= -Xms256m -Xmx2048m -XX:MaxPermSize=256m
>>>
>>> all-in-one-startup.properties (e.g. when all stratos products are
>>> installed in one server)
>>>
>>> JAVA_MEM_SETTINGS= -Xms1024m -Xmx4094m -XX:MaxPermSize=1024m
>>>
>>> I don't know if this approach would work, it depends on what startup
>>> configuration varies for each of the products.
>>>
>>> Does this help explain?
>>>
>>> Many thanks,
>>>
>>> Chris
>>>
>>>
>>>
>>>
>>>
>>> On Thu, Jan 9, 2014 at 12:52 PM, Nirmal Fernando <[email protected]
>>> > wrote:
>>>
>>>> Hi Chris/All,
>>>>
>>>> What do you think about the point I made?
>>>>
>>>>
>>>> On Thu, Jan 9, 2014 at 6:05 PM, chris snow <[email protected]> wrote:
>>>>
>>>>> Hi Isuru, that sounds good. I'm trying to think of a similar approach
>>>>> in the unix world that we could borrow ideas from. Postfix springs to
>>>>> mind, where I think there are multiple small services that can be started
>>>>> individually, or all together?
>>>>>
>>>>>
>>>>> On Thu, Jan 9, 2014 at 11:30 AM, Isuru Haththotuwa <[email protected]>wrote:
>>>>>
>>>>>> Good thinking Chris. In my opinion it would be nice to have the
>>>>>> capability to start the whole system at one go, using a single
>>>>>> command/script, and also to be able to start/stop individual servers.
>>>>>> Maybe
>>>>>> we can use a generic startup script in which we could specify one/more
>>>>>> than
>>>>>> one/all server(s) that should start. WDYT?
>>>>>>
>>>>>>
>>>>>> On Thu, Jan 9, 2014 at 4:42 PM, Isuru Perera <[email protected]> wrote:
>>>>>>
>>>>>>> Hi Chris,
>>>>>>>
>>>>>>>
>>>>>>> On Thu, Jan 9, 2014 at 4:12 PM, chris snow <[email protected]>wrote:
>>>>>>>
>>>>>>>> Would there be any benefit in having a generic startup script by
>>>>>>>> extracting the differences into a product specific properties file
>>>>>>>> that get
>>>>>>>> imported by the generic script?
>>>>>>>>
>>>>>>> Yes! There are benefits using a generic start-up script as you
>>>>>>> mentioned.
>>>>>>>
>>>>>>>> I'm not sure if this would be possible, but this approach would be
>>>>>>>> helpful for newbie administrators to easily identify produce specific
>>>>>>>> customisations on top of carbon. It would also allow us to maintain
>>>>>>>> only
>>>>>>>> one startup script that is used across all the products?
>>>>>>>>
>>>>>>> This is a good idea and I think it should be possible when
>>>>>>> considering the overall idea. However we need to think about this when
>>>>>>> we
>>>>>>> finalize the configurations required for the next release.
>>>>>>>
>>>>>>> Currently we have the start-up script in each product distribution
>>>>>>> now.
>>>>>>>
>>>>>>>
>>>>>>> *./products/autoscaler/modules/distribution/src/main/resources/stratos.sh**
>>>>>>>
>>>>>>> *./products/cloud-controller/modules/distribution/src/main/resources/stratos.sh**
>>>>>>>
>>>>>>> ./products/cartridge-agent/modules/distribution/src/main/bin/stratos.sh
>>>>>>> *./products/stratos-manager/modules/distribution/src/bin/stratos.sh**
>>>>>>> ./products/stratos-cli/distribution/src/main/bin/stratos.sh
>>>>>>>
>>>>>>> *./products/load-balancer/modules/distribution/src/main/bin/stratos.sh**
>>>>>>>
>>>>>>> * - The products, which depend on WSO2 Carbon kernel and these are
>>>>>>> files I'm going to update.
>>>>>>>
>>>>>>> AFAIK, these scripts can be the same, and there will be no product
>>>>>>> specific changes. The team is doing lot of changes for next major
>>>>>>> version
>>>>>>> and there may be product specific changes. I'm in the process of
>>>>>>> learning
>>>>>>> new changes :)
>>>>>>>
>>>>>>> We will have to see what each product would need additionally.
>>>>>>>
>>>>>>> Therefore as the first step, I will try to update individual files.
>>>>>>>
>>>>>>> Thanks!
>>>>>>>
>>>>>>> Best Regards,
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>> On 9 Jan 2014 09:34, "Isuru Perera" <[email protected]> wrote:
>>>>>>>>
>>>>>>>>> Hi,
>>>>>>>>>
>>>>>>>>> With the recent Carbon 4.2.0 upgrade, I think we should also
>>>>>>>>> update stratos.sh to match with the wso2server.sh file provided by
>>>>>>>>> Carbon.
>>>>>>>>>
>>>>>>>>> I am going to update those now.
>>>>>>>>>
>>>>>>>>> I found that each stratos.sh in different products has different
>>>>>>>>> configurations.
>>>>>>>>>
>>>>>>>>> However, I'm going to use the original startup script provided by
>>>>>>>>> Carbon and only necessary configurations for Stratos.
>>>>>>>>>
>>>>>>>>> So far, I found that following argument is important to Stratos.
>>>>>>>>>
>>>>>>>>> -Djndi.properties.dir="$CARBON_HOME/repository/conf"
>>>>>>>>>
>>>>>>>>> Any other important properties?
>>>>>>>>>
>>>>>>>>> Please let me know.
>>>>>>>>>
>>>>>>>>> Thanks!
>>>>>>>>>
>>>>>>>>> Best Regards,
>>>>>>>>>
>>>>>>>>> --
>>>>>>>>> Isuru Perera
>>>>>>>>> Senior Software Engineer | WSO2, Inc. | http://wso2.com/
>>>>>>>>> Lean . Enterprise . Middleware
>>>>>>>>>
>>>>>>>>> about.me/chrishantha
>>>>>>>>>
>>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> --
>>>>>>> Isuru Perera
>>>>>>> Senior Software Engineer | WSO2, Inc. | http://wso2.com/
>>>>>>> Lean . Enterprise . Middleware
>>>>>>>
>>>>>>> about.me/chrishantha
>>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> --
>>>>>> Thanks and Regards,
>>>>>>
>>>>>> Isuru H.
>>>>>> Software Engineer, WSO2 Inc.
>>>>>> +94 716 358 048* <http://wso2.com/>*
>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> Check out my professional profile and connect with me on LinkedIn.
>>>>> http://lnkd.in/cw5k69
>>>>>
>>>>
>>>>
>>>>
>>>> --
>>>> Best Regards,
>>>> Nirmal
>>>>
>>>> Nirmal Fernando.
>>>> PPMC Member & Committer of Apache Stratos,
>>>> Senior Software Engineer, WSO2 Inc.
>>>>
>>>> Blog: http://nirmalfdo.blogspot.com/
>>>>
>>>
>>>
>>>
>>> --
>>> Check out my professional profile and connect with me on LinkedIn.
>>> http://lnkd.in/cw5k69
>>>
>>
>
>
> --
> Best Regards,
> Nirmal
>
> Nirmal Fernando.
> PPMC Member & Committer of Apache Stratos,
> Senior Software Engineer, WSO2 Inc.
>
> Blog: http://nirmalfdo.blogspot.com/
>
--
Check out my professional profile and connect with me on LinkedIn.
http://lnkd.in/cw5k69