Skip to content
This repository has been archived by the owner on Jan 5, 2022. It is now read-only.

Commit

Permalink
Fixes incorrect system initialization order
Browse files Browse the repository at this point in the history
  • Loading branch information
Todd Nine committed Mar 5, 2015
1 parent 2e77c63 commit 494f8ae
Showing 1 changed file with 13 additions and 11 deletions.
24 changes: 13 additions & 11 deletions stack/awscluster/src/main/dist/init_instance/init_rest_server.sh
@@ -1,14 +1,14 @@
#!/bin/bash

#
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. The ASF licenses this file to You
# under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
Expand All @@ -35,10 +35,10 @@ apt-get -y --force-yes install ${PKGS}
# Install AWS Java SDK and get it into the Groovy classpath
curl http://sdk-for-java.amazonwebservices.com/latest/aws-java-sdk.zip > /tmp/aws-sdk-java.zip
cd /usr/share/
unzip /tmp/aws-sdk-java.zip
unzip /tmp/aws-sdk-java.zip
mkdir -p /home/ubuntu/.groovy/lib
cp /usr/share/aws-java-sdk-*/third-party/*/*.jar /home/ubuntu/.groovy/lib
cp /usr/share/aws-java-sdk-*/lib/* /home/ubuntu/.groovy/lib
cp /usr/share/aws-java-sdk-*/lib/* /home/ubuntu/.groovy/lib
ln -s /home/ubuntu/.groovy /root/.groovy

# Build environment for Groovy scripts
Expand All @@ -55,7 +55,7 @@ groovy tag_instance.groovy -BUILD-IN-PROGRESS
chmod +x /usr/share/usergrid/update.sh

cd /usr/share/usergrid/init_instance
./install_oraclejdk.sh
./install_oraclejdk.sh

cd /usr/share/usergrid/init_instance
./install_yourkit.sh
Expand Down Expand Up @@ -171,7 +171,7 @@ kernel.shmall = 4294967296
######
EOF

# wait for enough Cassandra nodes then delpoy and configure Usergrid
# wait for enough Cassandra nodes then delpoy and configure Usergrid
cd /usr/share/usergrid/scripts
groovy wait_for_instances.groovy cassandra ${CASSANDRA_NUM_SERVERS}
groovy wait_for_instances.groovy elasticsearch ${ES_NUM_SERVERS}
Expand All @@ -185,8 +185,8 @@ chown -R tomcat7 /usr/share/usergrid/webapps
chown -R tomcat7 /var/lib/tomcat7/webapps

# configure usergrid
mkdir -p /usr/share/tomcat7/lib
groovy configure_usergrid.groovy > /usr/share/tomcat7/lib/usergrid-deployment.properties
mkdir -p /usr/share/tomcat7/lib
groovy configure_usergrid.groovy > /usr/share/tomcat7/lib/usergrid-deployment.properties
groovy configure_portal_new.groovy >> /var/lib/tomcat7/webapps/portal/config.js


Expand Down Expand Up @@ -222,15 +222,17 @@ GRAPHITE_SERVER="$(groovy get_first_instance.groovy graphite )"
#First host run the migration and setup
if [ "$FIRSTHOST"=="$PUBLIC_HOSTNAME" ]; then

#Run the system database setup since migration is a no-op
curl -X GET http://localhost:8080/system/database/setup -u superuser:test


#Run the migration
curl -X PUT http://localhost:8080/system/migrate/run -u superuser:test

#Wait since migration is no-op just needs to ideally run to completion to bring the internal state up to date before
#Running setup
sleep 10

#Run the system database setup since migration is a no-op
curl -X GET http://localhost:8080/system/database/setup -u superuser:test

cd /usr/share/usergrid/init_instance
./update_keyspaces.sh
Expand Down

0 comments on commit 494f8ae

Please sign in to comment.