On Sat, Sep 7, 2013 at 1:21 AM, Nirmal Fernando <[email protected]>wrote:
> > > > On Fri, Sep 6, 2013 at 2:47 PM, Isuru Perera <[email protected]> wrote: > >> >> Hi, >> >> On Fri, Sep 6, 2013 at 2:01 PM, Nirmal Fernando >> <[email protected]>wrote: >> >>> >>> >>> >>> On Fri, Sep 6, 2013 at 7:20 AM, Isuru Perera <[email protected]> wrote: >>> >>>> Hi Manula, >>>> >>>> As I mentioned, config.sh doesn't need to copy MySQL connector jar. >>>> >>> >>> What's the solution? >>> >> Solution is to have a common installer. When setting up EC2 demo, we can >> use the installer and then clean up IaaS configurations from the image. >> >> We use config.sh only to get user-data from EC2 and it's EC2 specific. >> (No need to mention this since you created the config.sh script! >> > > Wrong! I've just added the user-data extraction section to config.sh. > I don't understand what you mean! I meant following part in config.sh ------------------------------------------------------------------ # following is helpful if you've mistakenly added data in user-data and want to recover. read -p "Please confirm that you want to be prompted, irrespective of whether the data is available in the user-data? [y/n]" answer if [[ $answer = n ]] ; then echo "Trying to find values via user-data.." >> $LOG wget http://169.254.169.254/latest/user-data -O /opt/user-data.txt >> $LOG userData=`cat /opt/user-data.txt` echo "Extracted user-data: $userData" >> $LOG #assign values obtained through user-data for i in {1..8} do entry=`echo $userData | cut -d',' -f$i | sed 's/,//g'` key=`echo $entry | cut -d'=' -f1 | sed 's/=//g'` value=`echo $entry | cut -d'=' -f2 | sed 's/=//g'` if [[ "$key" == *EC2_KEY_PATH* ]] ; then EC2_KEY_PATH=$value; elif [[ "$key" == *ACCESS_KEY* ]] ; then ACCESS_KEY=$value; elif [[ "$key" == *SECRET_KEY* ]] ; then SECRET_KEY=$value; elif [[ "$key" == *OWNER_ID* ]] ; then OWNER_ID=$value; elif [[ "$key" == *AVAILABILITY_ZONE* ]] ; then AVAILABILITY_ZONE=$value; elif [[ "$key" == *SECURITY_GROUP* ]] ; then SECURITY_GROUP=$value; elif [[ "$key" == *KEY_PAIR_NAME* ]] ; then KEY_PAIR_NAME=$value; elif [[ "$key" == *DOMAIN* ]] ; then DOMAIN=$value; fi done fi ------------------------------------------------------------------ > :D) >> >> With config.sh, we can just configure the IaaS account details as entered >> by the user. >> >>> >>>> And you have copied only to Stratos Controller. Usually ELB also need >>>> to use the same userstore database. >>>> >>>> Let's not complicate the config script as it was written only to get >>>> user data from the EC2 meta data service and configure the instance. >>>> >>>> Thanks! >>>> >>>> ---------- Forwarded message ---------- >>>> From: <[email protected]> >>>> Date: Thu, Sep 5, 2013 at 12:06 PM >>>> Subject: git commit: Update tools/ec2-demo-setup/config.sh by adding >>>> copy mysql connector to sc >>>> To: [email protected] >>>> >>>> >>>> Updated Branches: >>>> refs/heads/master b7d1abdb4 -> 858799f6b >>>> >>>> >>>> Update tools/ec2-demo-setup/config.sh by adding copy mysql connector to >>>> sc >>>> >>>> >>>> Project: http://git-wip-us.apache.org/repos/asf/incubator-stratos/repo >>>> Commit: >>>> http://git-wip-us.apache.org/repos/asf/incubator-stratos/commit/858799f6 >>>> Tree: >>>> http://git-wip-us.apache.org/repos/asf/incubator-stratos/tree/858799f6 >>>> Diff: >>>> http://git-wip-us.apache.org/repos/asf/incubator-stratos/diff/858799f6 >>>> >>>> Branch: refs/heads/master >>>> Commit: 858799f6beca78728bbcfca81b0110667f6a80d9 >>>> Parents: b7d1abd >>>> Author: Manula Thantriwatte <[email protected]> >>>> Authored: Thu Sep 5 12:02:53 2013 +0530 >>>> Committer: Manula Thantriwatte <[email protected]> >>>> Committed: Thu Sep 5 12:02:53 2013 +0530 >>>> >>>> ---------------------------------------------------------------------- >>>> tools/ec2-demo-setup/config.sh | 5 +++++ >>>> 1 file changed, 5 insertions(+) >>>> ---------------------------------------------------------------------- >>>> >>>> >>>> >>>> http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/858799f6/tools/ec2-demo-setup/config.sh >>>> ---------------------------------------------------------------------- >>>> diff --git a/tools/ec2-demo-setup/config.sh >>>> b/tools/ec2-demo-setup/config.sh >>>> index e405de3..5c4736a 100755 >>>> --- a/tools/ec2-demo-setup/config.sh >>>> +++ b/tools/ec2-demo-setup/config.sh >>>> @@ -26,6 +26,8 @@ >>>> CARTRIDGE_DEFINITIONS=/opt/apache-stratos-cc-3.0.0-SNAPSHOT/repository/deploymen >>>> >>>> >>>> SERVICE_DEFINITIONS=/opt/apache-stratos-cc-3.0.0-SNAPSHOT/repository/deployment/server/services >>>> >>>> >>>> PAYLOADS=/opt/apache-stratos-cc-3.0.0-SNAPSHOT/repository/resources/payload >>>> >>>> >>>> SC_CONF_MT=/opt/apache-stratos-sc-3.0.0-SNAPSHOT/repository/conf/multitenancy >>>> +MYSQL_JAR=/opt/mysql-connector-java-5.1.25.jar >>>> >>>> +MYSQL_COPY_PATH=/opt/apache-stratos-sc-3.0.0-SNAPSHOT/repository/components/lib >>>> >>>> # Make sure the user is running as root. >>>> if [ "$UID" -ne "0" ]; then >>>> @@ -187,6 +189,9 @@ sed -i "s/S2DOMAIN/$DOMAIN/g" >>>> $TEMP_CONFIG_DIR/features-dashboard.xml.tmp >>>> mv $TEMP_CONFIG_DIR/features-dashboard.xml.tmp >>>> $SC_CONF_MT/features-dashboard.xml >>>> chown ubuntu:ubuntu $SC_CONF_MT/features-dashboard.xml >>>> >>>> +echo "Copying mysql connector jar" >> $LOG >>>> +cp -f $MYSQL_JAR $MYSQL_COPY_PATH >>>> + >>>> echo "You have successfully configured Apache Stratos!!" >>>> >>>> su - ubuntu -c /opt/start_servers.sh >>>> >>>> >>>> >>>> >>>> -- >>>> Isuru Perera >>>> Senior Software Engineer | WSO2, Inc. | http://wso2.com/ >>>> Lean . Enterprise . Middleware >>>> >>>> about.me/chrishantha >>>> >>> >>> >>> >>> -- >>> Best Regards, >>> Nirmal >>> >>> C.S.Nirmal J. Fernando >>> Senior Software Engineer, >>> WSO2 Inc. >>> >>> Blog: http://nirmalfdo.blogspot.com/ >>> >> >> >> >> -- >> Isuru Perera >> Senior Software Engineer | WSO2, Inc. | http://wso2.com/ >> Lean . Enterprise . Middleware >> >> about.me/chrishantha >> > > > > -- > Best Regards, > Nirmal > > C.S.Nirmal J. Fernando > Senior Software Engineer, > WSO2 Inc. > > Blog: http://nirmalfdo.blogspot.com/ > -- Isuru Perera Senior Software Engineer | WSO2, Inc. | http://wso2.com/ Lean . Enterprise . Middleware about.me/chrishantha
