usergrid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From snoopd...@apache.org
Subject [4/6] git commit: Multiple fixes to get stack working with Usergrid "two-dot-o" / Core Persistence, setting Tomcat RAM, Tomcat thread pool size and allowing use of c3.4xlarge nodes.
Date Fri, 25 Jul 2014 17:40:42 GMT
Multiple fixes to get stack working with Usergrid "two-dot-o" / Core Persistence, setting Tomcat
RAM, Tomcat thread pool size and allowing use of c3.4xlarge nodes.


Project: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/commit/2d592f0a
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/2d592f0a
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/2d592f0a

Branch: refs/heads/two-dot-o
Commit: 2d592f0a36ea0a36e08c563ce6eca7c4bbd95e7d
Parents: d5adda3
Author: Dave Johnson <dmjohnson@apigee.com>
Authored: Fri Jul 25 10:30:13 2014 -0400
Committer: Dave Johnson <dmjohnson@apigee.com>
Committed: Fri Jul 25 10:30:13 2014 -0400

----------------------------------------------------------------------
 portal/dist/usergrid-portal.zip                 | Bin 0 -> 15544780 bytes
 stack/awscluster/assembly.xml                   |   7 -
 .../src/main/dist/init_instance/create_raid0.sh |   2 +-
 .../dist/init_instance/create_raid0_2disks.sh   |  54 +++++++
 .../main/dist/init_instance/init_db_server.sh   |  13 +-
 .../main/dist/init_instance/init_rest_server.sh |  15 +-
 .../dist/init_instance/install_cassandra.sh     |  34 +----
 .../dist/init_instance/install_elasticsearch.sh |  13 +-
 .../src/main/dist/lib/log4j.properties          |  53 +++++++
 stack/awscluster/src/main/dist/lib/server.xml   | 145 +++++++++++++++++++
 .../awscluster/src/main/dist/webapps/dummy.txt  |   0
 .../main/groovy/configure_elasticsearch.groovy  |  12 +-
 .../src/main/groovy/configure_usergrid.groovy   |  26 ++--
 .../src/main/groovy/wait_for_instances.groovy   |   8 +-
 stack/awscluster/ugcluster-cf.json              |  64 ++++----
 stack/corepersistence/pom.xml                   |   2 +-
 stack/pom.xml                                   |   8 +-
 17 files changed, 336 insertions(+), 120 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/2d592f0a/portal/dist/usergrid-portal.zip
----------------------------------------------------------------------
diff --git a/portal/dist/usergrid-portal.zip b/portal/dist/usergrid-portal.zip
new file mode 100644
index 0000000..97056f8
Binary files /dev/null and b/portal/dist/usergrid-portal.zip differ

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/2d592f0a/stack/awscluster/assembly.xml
----------------------------------------------------------------------
diff --git a/stack/awscluster/assembly.xml b/stack/awscluster/assembly.xml
index a7fce3c..65c9e37 100644
--- a/stack/awscluster/assembly.xml
+++ b/stack/awscluster/assembly.xml
@@ -43,13 +43,6 @@
             <includes>
                 <include>**</include>
             </includes>
-
-            <!-- Exclude Priam for now -->
-            <excludes>
-                <exclude>**/priam**</exclude>
-                <exclude>**/Priam**</exclude>
-            </excludes>
-
         </fileSet>
 
         <fileSet>

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/2d592f0a/stack/awscluster/src/main/dist/init_instance/create_raid0.sh
----------------------------------------------------------------------
diff --git a/stack/awscluster/src/main/dist/init_instance/create_raid0.sh b/stack/awscluster/src/main/dist/init_instance/create_raid0.sh
index 80f75d8..296cb9f 100644
--- a/stack/awscluster/src/main/dist/init_instance/create_raid0.sh
+++ b/stack/awscluster/src/main/dist/init_instance/create_raid0.sh
@@ -24,7 +24,7 @@ debconf-set-selections <<< "postfix postfix/main_mailer_type string
'Internet Si
 apt-get install -y postfix
 
 # install mdadm RAID controller
-apt-get -y install mdadm
+apt-get -y --force-yes install mdadm
 
 # m1.xlarge has four 414GB disks, but only /dev/xvdb is mounted
 # unmount /dev/xvdb so we can use it in our setup

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/2d592f0a/stack/awscluster/src/main/dist/init_instance/create_raid0_2disks.sh
----------------------------------------------------------------------
diff --git a/stack/awscluster/src/main/dist/init_instance/create_raid0_2disks.sh b/stack/awscluster/src/main/dist/init_instance/create_raid0_2disks.sh
new file mode 100644
index 0000000..25733d3
--- /dev/null
+++ b/stack/awscluster/src/main/dist/init_instance/create_raid0_2disks.sh
@@ -0,0 +1,54 @@
+#!/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.
+#  See the License for the specific language governing permissions and
+#  limitations under the License.  For additional information regarding
+#  copyright in this work, please see the NOTICE file in the top level
+#  directory of this distribution.
+#
+
+
+
+# WARNING: this does not work yet (and is not used by any other script)
+
+
+
+# install postfix first and prevent it from prompting the user
+debconf-set-selections <<< "postfix postfix/mailname string your.hostname.com"
+debconf-set-selections <<< "postfix postfix/main_mailer_type string 'Internet Site'"
+apt-get install -y postfix
+
+# install mdadm RAID controller
+apt-get -y --force-yes install mdadm
+
+# m1.xlarge has four 414GB disks, but only /dev/xvdb is mounted
+# unmount /dev/xvdb so we can use it in our setup
+umount /mnt
+
+# create & format partition on each of our four disks
+(echo o; echo n; echo p; echo 1; echo ; echo; echo w) | fdisk /dev/xvdb
+(echo o; echo n; echo p; echo 1; echo ; echo; echo w) | fdisk /dev/xvdc
+
+# create striped RAID0 device with our four disks
+mdadm --create --verbose /dev/md0 --level=stripe \
+--raid-devices=4 /dev/xvdb1 /dev/xvdc1 /dev/xvdd1 /dev/xvde1
+
+# save config
+mdadm --detail --scan | tee /etc/mdadm/mdadm.conf
+
+# create, mount and save disk to stab
+mkfs.ext4 -b 4096 -E stride=32,stripe-width=128 -L Stripe /dev/md0
+mkdir -p /mnt
+echo "/dev/md0  /mnt  auto  defaults,nobootwait,noatime 0 2" | tee /etc/fstab
+mount /mnt 

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/2d592f0a/stack/awscluster/src/main/dist/init_instance/init_db_server.sh
----------------------------------------------------------------------
diff --git a/stack/awscluster/src/main/dist/init_instance/init_db_server.sh b/stack/awscluster/src/main/dist/init_instance/init_db_server.sh
index 87db30c..defc87e 100644
--- a/stack/awscluster/src/main/dist/init_instance/init_db_server.sh
+++ b/stack/awscluster/src/main/dist/init_instance/init_db_server.sh
@@ -33,9 +33,9 @@ cd /usr/share/usergrid/init_instance
 ./create_raid0.sh
 
 # Install the easy stuff
-PKGS="ntp unzip groovy tomcat7 curl"
+PKGS="ntp unzip groovy curl"
 apt-get update
-apt-get -y install ${PKGS}
+apt-get -y --force-yes install ${PKGS}
 /etc/init.d/tomcat7 stop
 
 # Install AWS Java SDK and get it into the Groovy classpath
@@ -59,15 +59,6 @@ cd /usr/share/usergrid/init_instance
 # Install and start ElasticSearch
 cd /usr/share/usergrid/init_instance
 ./install_elasticsearch.sh
-/etc/init.d/elasticsearch start
-
-# Starting Tomcat starts Priam which starts Priam
-#/etc/init.d/tomcat7 restart
-
-# Priam consistently craps out on first run
-# making this ugly kludge necessary
-#sleep 90
-#/etc/init.d/tomcat7 restart
 
 cd /usr/share/usergrid/scripts
 groovy tag_instance.groovy

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/2d592f0a/stack/awscluster/src/main/dist/init_instance/init_rest_server.sh
----------------------------------------------------------------------
diff --git a/stack/awscluster/src/main/dist/init_instance/init_rest_server.sh b/stack/awscluster/src/main/dist/init_instance/init_rest_server.sh
index 7dfa2eb..80bad42 100644
--- a/stack/awscluster/src/main/dist/init_instance/init_rest_server.sh
+++ b/stack/awscluster/src/main/dist/init_instance/init_rest_server.sh
@@ -27,7 +27,7 @@ dpkg-reconfigure -f noninteractive tzdata
 
 PKGS="openjdk-7-jdk tomcat7 s3cmd ntp unzip groovy"
 apt-get update
-apt-get -y install ${PKGS}
+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
@@ -44,12 +44,23 @@ ln -s /home/ubuntu/.groovy /root/.groovy
 . /etc/profile.d/aws-credentials.sh
 . /etc/profile.d/usergrid-env.sh
 
+# Copy in our own server.xml to set Tomcat's thread pool size
+cp /usr/share/usergrid/lib/server.xml /var/lib/tomcat7/conf
+chown tomcat7 /var/lib/tomcat7/conf/server.xml 
+
+# Set Tomcat RAM size and path to log4j.properties
+export JAVA_OPTS="-Djava.awt.headless=true -Xmx1024m -Dlog4j.configuration=file:/usr/share/usergrid/lib/log4j.properties"
+sed -i 's/Xmx128m/Xmx1024m -Dlog4j.configuration=file\:\/usr\/share\/usergrid\/lib\/log4j\.properties/'
/etc/default/tomcat7
+
+cd /usr/share/usergrid/init_instance
+./install_oraclejdk.sh 
+
 # Wait for enough Cassandra nodes then deploy and restart Tomcat 
 cd /usr/share/usergrid/scripts
 groovy wait_for_instances.groovy
 
 mkdir -p /usr/share/tomcat7/lib 
-groovy configure_usergrid.groovy > /usr/share/tomcat7/lib/usergrid-deployment.properties

+groovy configure_usergrid.groovy > /usr/share/tomcat7/lib/usergrid-custom.properties 
 
 rm -rf /var/lib/tomcat7/webapps/*
 cp -r /usr/share/usergrid/webapps/* /var/lib/tomcat7/webapps

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/2d592f0a/stack/awscluster/src/main/dist/init_instance/install_cassandra.sh
----------------------------------------------------------------------
diff --git a/stack/awscluster/src/main/dist/init_instance/install_cassandra.sh b/stack/awscluster/src/main/dist/init_instance/install_cassandra.sh
index f66f0b6..d0639ba 100644
--- a/stack/awscluster/src/main/dist/init_instance/install_cassandra.sh
+++ b/stack/awscluster/src/main/dist/init_instance/install_cassandra.sh
@@ -43,7 +43,7 @@ groovy configure_cassandra.groovy > /etc/cassandra/cassandra.yaml
 
 /etc/init.d/cassandra start
 
-#Install opscenter
+# Install opscenter
 echo "deb http://debian.datastax.com/community stable main" | sudo tee -a /etc/apt/sources.list.d/datastax.community.list
 
 curl -L http://debian.datastax.com/debian/repo_key | apt-key add -
@@ -53,37 +53,5 @@ apt-get  --force-yes -y install opscenter
 
 sudo service opscenterd start
 
-
-## Configure Priam
-#groovy configure_priam.groovy
-#
-## Copy Priam extension into Cassandra and Priam WAR into Tomcat
-#rm -rf /var/lib/tomcat7/webapps/*
-#mkdir -p /usr/share/cassandra/lib 
-#cp /usr/share/usergrid/lib/priam-cass-extensions-1.2.24.jar /usr/share/cassandra/lib 
-#cp /usr/share/usergrid/webapps/priam-web-1.2.24.war /var/lib/tomcat7/webapps/Priam.war
-#
-## Make sure Priam via Tomcat can write to /etc/cassandra
-## TODO: do this without 777
-#chmod -R 777 /etc/cassandra
-#chmod 777 /etc/init.d/cassandra
-#
-## Configure sudo for no passwords to please Priam
-#cat >> /tmp/sudoers.new << EOF
-#Defaults    env_reset
-#Defaults    mail_badpass
-#Defaults    secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
-#root    ALL=(ALL:ALL) ALL
-#%admin  ALL=(ALL) ALL
-#%sudo   ALL=(ALL:ALL) NOPASSWD:ALL
-#EOF
-#visudo -c -f /tmp/sudoers.new
-#if [ "$?" -eq "0" ]; then
-#    cp /tmp/sudoers.new /etc/sudoers
-#fi
-## Add tomat user to sudoers to please Priam
-#adduser tomcat7 sudo
-#/etc/init.d/sudo restart
-
 popd
 

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/2d592f0a/stack/awscluster/src/main/dist/init_instance/install_elasticsearch.sh
----------------------------------------------------------------------
diff --git a/stack/awscluster/src/main/dist/init_instance/install_elasticsearch.sh b/stack/awscluster/src/main/dist/init_instance/install_elasticsearch.sh
index 432189a..2b911d5 100644
--- a/stack/awscluster/src/main/dist/init_instance/install_elasticsearch.sh
+++ b/stack/awscluster/src/main/dist/init_instance/install_elasticsearch.sh
@@ -19,11 +19,11 @@
 #
 
 
-# Install and stop ElasticSearch
 pushd /etc/apt/sources.list.d
 
+# Install and stop ElasticSearch
 cat >> elasticsearch.sources.list << EOF
-deb http://packages.elasticsearch.org/elasticsearch/1.0/debian stable main
+deb http://packages.elasticsearch.org/elasticsearch/1.2/debian stable main
 EOF
 apt-get update
 apt-get --force-yes -y install elasticsearch
@@ -35,9 +35,16 @@ chown elasticsearch /mnt/data/elasticsearch
 mkdir -p /mnt/log/elasticsearch
 chown elasticsearch /mnt/log/elasticsearch
 
-# Configure and restart ElasticSearch
+# Configure ElasticSearch
+cat >> /etc/default/elasticsearch << EOF
+JAVA_HOME=/usr/lib/jvm/jdk1.7.0
+EOF
+
 update-rc.d elasticsearch defaults 95 10
 cd /usr/share/usergrid/scripts
 groovy ./configure_elasticsearch.groovy > /etc/elasticsearch/elasticsearch.yml
 
+# Go!
+/etc/init.d/elasticsearch start
+
 popd
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/2d592f0a/stack/awscluster/src/main/dist/lib/log4j.properties
----------------------------------------------------------------------
diff --git a/stack/awscluster/src/main/dist/lib/log4j.properties b/stack/awscluster/src/main/dist/lib/log4j.properties
new file mode 100644
index 0000000..cf63e34
--- /dev/null
+++ b/stack/awscluster/src/main/dist/lib/log4j.properties
@@ -0,0 +1,53 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  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.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# for production, you should probably set the root to INFO
+# and the pattern to %c instead of %l.  (%l is slower.)
+
+# output messages into a rolling log file as well as stdout
+log4j.rootLogger=ERROR,stdout
+
+# stdout
+log4j.appender.stdout=org.apache.log4j.ConsoleAppender
+#log4j.appender.stdout.layout=org.apache.log4j.SimpleLayout
+log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
+log4j.appender.stdout.layout.ConversionPattern=%d %p (%t) %c{1} - %m%n
+
+log4j.logger.org.apache.usergrid=INFO
+
+#log4j.logger.org.apache.usergrid.persistence.cassandra.DB=WARN, stdout
+#log4j.logger.org.apache.usergrid.persistence.cassandra.BATCH=WARN, stdout
+#log4j.logger.org.apache.usergrid.persistence.cassandra.EntityManagerFactoryImpl=WARN, stdout
+#log4j.logger.org.apache.usergrid.persistence.cassandra.DaoUtils=WARN, stdout
+#log4j.logger.org.apache.usergrid.persistence.cassandra.EntityManagerImpl=WARN, stdout
+#log4j.logger.org.apache.usergrid.persistence.cassandra.ConnectionRefImpl=WARN, stdout
+#log4j.logger.me.prettyprint.cassandra.hector.TimingLogger=WARN, stdout
+#log4j.logger.org.apache.usergrid.rest.security.AllowAjaxFilter=WARN, stdout
+#log4j.logger.me.prettyprint.hector.api.beans.AbstractComposite=ERROR, stdout
+#log4j.logger.org.apache.usergrid.locking.singlenode.SingleNodeLockManagerImpl=DEBUG, stdout
+
+#log4j.logger.org.apache.usergrid.persistence=INFO
+log4j.logger.org.apache.usergrid.corepersistence=DEBUG
+#log4j.logger.com.netflix.hystrix=DEBUG
+#log4j.logger.org.antlr=DEBUG
+
+#log4j.logger.org.apache.usergrid.persistence.CollectionIT=DEBUG
+log4j.logger.org.apache.usergrid.persistence.index=DEBUG
+#log4j.logger.org.apache.usergrid.persistence.collection=DEBUG
+#log4j.logger.org.elasticsearch=DEBUG
+
+#log4j.logger.org.apache.cassandra.service.StorageProxy=DEBUG, stdout
+

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/2d592f0a/stack/awscluster/src/main/dist/lib/server.xml
----------------------------------------------------------------------
diff --git a/stack/awscluster/src/main/dist/lib/server.xml b/stack/awscluster/src/main/dist/lib/server.xml
new file mode 100644
index 0000000..40685a7
--- /dev/null
+++ b/stack/awscluster/src/main/dist/lib/server.xml
@@ -0,0 +1,145 @@
+<?xml version='1.0' encoding='utf-8'?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  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.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+-->
+<!-- Note:  A "Server" is not itself a "Container", so you may not
+     define subcomponents such as "Valves" at this level.
+     Documentation at /docs/config/server.html
+ -->
+
+ <!-- Modified for Usergrid to set the threads to 600 -->
+
+<Server port="8005" shutdown="SHUTDOWN">
+  <!-- Security listener. Documentation at /docs/config/listeners.html
+  <Listener className="org.apache.catalina.security.SecurityListener" />
+  -->
+  <!--APR library loader. Documentation at /docs/apr.html -->
+  <!--
+  <Listener className="org.apache.catalina.core.AprLifecycleListener" SSLEngine="on" />
+  -->
+  <!--Initialize Jasper prior to webapps are loaded. Documentation at /docs/jasper-howto.html
-->
+  <Listener className="org.apache.catalina.core.JasperListener" />
+  <!-- Prevent memory leaks due to use of particular java/javax APIs-->
+  <Listener className="org.apache.catalina.core.JreMemoryLeakPreventionListener" />
+  <Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" />
+  <Listener className="org.apache.catalina.core.ThreadLocalLeakPreventionListener" />
+
+  <!-- Global JNDI resources
+       Documentation at /docs/jndi-resources-howto.html
+  -->
+  <GlobalNamingResources>
+    <!-- Editable user database that can also be used by
+         UserDatabaseRealm to authenticate users
+    -->
+    <Resource name="UserDatabase" auth="Container"
+              type="org.apache.catalina.UserDatabase"
+              description="User database that can be updated and saved"
+              factory="org.apache.catalina.users.MemoryUserDatabaseFactory"
+              pathname="conf/tomcat-users.xml" />
+  </GlobalNamingResources>
+
+  <!-- A "Service" is a collection of one or more "Connectors" that share
+       a single "Container" Note:  A "Service" is not itself a "Container",
+       so you may not define subcomponents such as "Valves" at this level.
+       Documentation at /docs/config/service.html
+   -->
+  <Service name="Catalina">
+
+    <!--The connectors can use a shared executor, you can define one or more named thread
pools-->
+    <Executor name="tomcatThreadPool" namePrefix="catalina-exec-"
+        maxThreads="600" minSpareThreads="4"/>
+
+    <!-- A "Connector" represents an endpoint by which requests are received
+         and responses are returned. Documentation at :
+         Java HTTP Connector: /docs/config/http.html (blocking & non-blocking)
+         Java AJP  Connector: /docs/config/ajp.html
+         APR (HTTP/AJP) Connector: /docs/apr.html
+         Define a non-SSL HTTP/1.1 Connector on port 8080
+    -->
+    <Connector port="8080" protocol="HTTP/1.1"
+               connectionTimeout="20000"
+               URIEncoding="UTF-8"
+               redirectPort="8443" />
+    <!-- A "Connector" using the shared thread pool-->
+    <!--
+    <Connector executor="tomcatThreadPool"
+               port="8080" protocol="HTTP/1.1"
+               connectionTimeout="20000"
+               redirectPort="8443" />
+    -->
+    <!-- Define a SSL HTTP/1.1 Connector on port 8443
+         This connector uses the JSSE configuration, when using APR, the
+         connector should be using the OpenSSL style configuration
+         described in the APR documentation -->
+    <!-- <Connector port="8443" protocol="HTTP/1.1" SSLEnabled="true"
+               maxThreads="600" scheme="https" secure="true"
+               clientAuth="false" sslProtocol="TLS" /> -->
+
+    <!-- Define an AJP 1.3 Connector on port 8009 -->
+    <!--    
+    <Connector port="8009" protocol="AJP/1.3" redirectPort="8443" />
+    -->
+
+
+    <!-- An Engine represents the entry point (within Catalina) that processes
+         every request.  The Engine implementation for Tomcat stand alone
+         analyzes the HTTP headers included with the request, and passes them
+         on to the appropriate Host (virtual host).
+         Documentation at /docs/config/engine.html -->
+
+    <!-- You should set jvmRoute to support load-balancing via AJP ie :
+    <Engine name="Catalina" defaultHost="localhost" jvmRoute="jvm1">
+    -->
+    <Engine name="Catalina" defaultHost="localhost">
+
+      <!--For clustering, please take a look at documentation at:
+          /docs/cluster-howto.html  (simple how to)
+          /docs/config/cluster.html (reference documentation) -->
+      <!--
+      <Cluster className="org.apache.catalina.ha.tcp.SimpleTcpCluster"/>
+      -->
+
+      <!-- Use the LockOutRealm to prevent attempts to guess user passwords
+           via a brute-force attack -->
+      <Realm className="org.apache.catalina.realm.LockOutRealm">
+        <!-- This Realm uses the UserDatabase configured in the global JNDI
+             resources under the key "UserDatabase".  Any edits
+             that are performed against this UserDatabase are immediately
+             available for use by the Realm.  -->
+        <Realm className="org.apache.catalina.realm.UserDatabaseRealm"
+               resourceName="UserDatabase"/>
+      </Realm>
+
+      <Host name="localhost"  appBase="webapps"
+            unpackWARs="true" autoDeploy="true">
+
+        <!-- SingleSignOn valve, share authentication between web applications
+             Documentation at: /docs/config/valve.html -->
+        <!--
+        <Valve className="org.apache.catalina.authenticator.SingleSignOn" />
+        -->
+
+        <!-- Access log processes all example.
+             Documentation at: /docs/config/valve.html
+             Note: The pattern used is equivalent to using pattern="common" -->
+        <Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"
+               prefix="localhost_access_log." suffix=".txt"
+               pattern="%h %l %u %t &quot;%r&quot; %s %b" />
+
+      </Host>
+    </Engine>
+  </Service>
+</Server>

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/2d592f0a/stack/awscluster/src/main/dist/webapps/dummy.txt
----------------------------------------------------------------------
diff --git a/stack/awscluster/src/main/dist/webapps/dummy.txt b/stack/awscluster/src/main/dist/webapps/dummy.txt
new file mode 100644
index 0000000..e69de29

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/2d592f0a/stack/awscluster/src/main/groovy/configure_elasticsearch.groovy
----------------------------------------------------------------------
diff --git a/stack/awscluster/src/main/groovy/configure_elasticsearch.groovy b/stack/awscluster/src/main/groovy/configure_elasticsearch.groovy
index 5ddb040..3c82832 100644
--- a/stack/awscluster/src/main/groovy/configure_elasticsearch.groovy
+++ b/stack/awscluster/src/main/groovy/configure_elasticsearch.groovy
@@ -38,22 +38,22 @@ String domain    = stackName
 def creds = new BasicAWSCredentials(accessKey, secretKey)
 def sdbClient = new AmazonSimpleDBClient(creds)
 
-// build seed list by listing all Cassandra nodes found in SimpleDB domain with our stackName
+// build seed list by listing all nodes found in SimpleDB domain with our stackName
 def selectResult = sdbClient.select(new SelectRequest((String)"select * from `${domain}`"))
-def seeds = ""
+def esnodes = ""
 def sep = ""
 for (item in selectResult.getItems()) {
     def att = item.getAttributes().get(0)
     if (att.getValue().equals(stackName)) {
-        seeds = "${seeds}${sep}\"${item.getName()}\""
+        esnodes = "${esnodes}${sep}\"${item.getName()}\""
         sep = ","
     }
 }
 
 def elasticSearchConfig = """
-cluster.name: usergrid2
-discovery.zen.ping.multicast.enabled: false
-discovery.zen.ping.unicast.hosts: [${seeds}]
+cluster.name: ${clusterName}
+discovery.zen.ping.multicast.enabled: true
+discovery.zen.ping.unicast.hosts: [${esnodes}]
 node:
     name: ${hostName} 
 network:

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/2d592f0a/stack/awscluster/src/main/groovy/configure_usergrid.groovy
----------------------------------------------------------------------
diff --git a/stack/awscluster/src/main/groovy/configure_usergrid.groovy b/stack/awscluster/src/main/groovy/configure_usergrid.groovy
index 5513880..a28ab5a 100644
--- a/stack/awscluster/src/main/groovy/configure_usergrid.groovy
+++ b/stack/awscluster/src/main/groovy/configure_usergrid.groovy
@@ -54,23 +54,29 @@ for (item in selectResult.getItems()) {
     }
 }
 
+def esnodes = ""
+sep = ""
+for (item in selectResult.getItems()) {
+    def att = item.getAttributes().get(0)
+    if (att.getValue().equals(stackName)) {
+        esnodes = "${esnodes}${sep}${item.getName()}"
+        sep = ","
+    }
+}
+
 def usergridConfig = """
 ######################################################
 # Minimal Usergrid configuration properties for local Tomcat and Cassandra 
-#
 
 cassandra.url=${seeds}
-cassanrda.cluster=${clusterName}
-cassandra.keyspace.strategy.options.replication_factor=${replFactor}
-cassandra.keyspace.strategy.options.us-west=${replFactor}
-cassandra.keyspace.strategy.options.us-west=${replFactor}
+cassandra.cluster=${clusterName}
 cassandra.keyspace.strategy=org.apache.cassandra.locator.SimpleStrategy
+cassandra.keyspace.replication=${replFactor}
 
-# These settings seem to cause problems at startup time
-#cassandra.keyspace.strategy=org.apache.cassandra.locator.NetworkTopologyStrategy
-#cassandra.writecl=LOCAL_QUORUM
-#cassandra.readcl=LOCAL_QUORUM
-
+elasticsearch.cluster_name=${clusterName}
+elasticsearch.index_prefix=usergrid
+elasticsearch.hosts=${esnodes}
+elasticsearch.port=9300
 
 ######################################################
 # Custom mail transport 

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/2d592f0a/stack/awscluster/src/main/groovy/wait_for_instances.groovy
----------------------------------------------------------------------
diff --git a/stack/awscluster/src/main/groovy/wait_for_instances.groovy b/stack/awscluster/src/main/groovy/wait_for_instances.groovy
index f6cf80a..15de92a 100644
--- a/stack/awscluster/src/main/groovy/wait_for_instances.groovy
+++ b/stack/awscluster/src/main/groovy/wait_for_instances.groovy
@@ -44,11 +44,8 @@ def count = 0
 
 while (true) {
     try {
-
-
-
-        def selectResult = sdbClient.select(new SelectRequest((String)"select * from `${domain}`
where itemName() is not null  order by itemName()"))
-
+        def selectResult = sdbClient.select( new SelectRequest(
+            (String)"select * from `${domain}` where itemName() is not null  order by itemName()"))
 
         count = 0
 
@@ -64,6 +61,7 @@ while (true) {
         }
 
         println("Found ${count} nodes but need at least ${cassNumServers}.  Waiting...")
+        
     } catch (Exception e) {
         println "ERROR waiting for Casasndra ${e.getMessage()}, will continue waiting"
         return

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/2d592f0a/stack/awscluster/ugcluster-cf.json
----------------------------------------------------------------------
diff --git a/stack/awscluster/ugcluster-cf.json b/stack/awscluster/ugcluster-cf.json
index cfd9956..1dfd580 100644
--- a/stack/awscluster/ugcluster-cf.json
+++ b/stack/awscluster/ugcluster-cf.json
@@ -21,19 +21,19 @@
             "Description": "Minimum number of REST servers.",
             "Type": "Number",
             "Default": "3",
-            "MinValue": "3"
+            "MinValue": "1"
         },
         "RestMaxServers": {
             "Description": "Maximum number REST servers.",
             "Type": "Number",
             "Default": "3",
-            "MinValue": "3"
+            "MinValue": "1"
         },
         "RestInstanceType": {
             "Description": "Instance type for REST servers",
             "Type": "String",
             "Default": "m1.large",
-            "AllowedValues": ["m1.small", "m1.medium", "m1.large", "m1.xlarge", "m3.xlarge",
"m3.2xlarge"],
+            "AllowedValues": ["m1.small", "m1.medium", "m1.large", "m1.xlarge", "m3.xlarge",
"m3.large", "c3.4xlarge"],
             "ConstraintDescription": "must be valid instance type."
         },
         "KeyPair": {
@@ -50,20 +50,20 @@
             "Description": "Number of Cass servers to start.",
             "Type": "Number",
             "Default": "3",
-            "MinValue": "3"
+            "MinValue": "1"
         },
         "CassInstanceType": {
             "Description": "Instance type for Cass servers",
             "Type": "String",
             "Default": "m1.xlarge",
-            "AllowedValues": ["m1.small", "m1.medium", "m1.large", "m1.xlarge", "m3.xlarge",
"m3.2xlarge"],
+            "AllowedValues": ["m1.small", "m1.medium", "m1.large", "m1.xlarge", "m3.xlarge",
"m3.2xlarge", "c3.4xlarge"],
             "ConstraintDescription": "must be valid instance type."
         },
         "CassReplicationFactor": {
             "Description": "Cassandra replication factor",
             "Type": "Number",
             "Default": "3",
-            "MinValue": "3"
+            "MinValue": "1"
         },
         "SuperUserEmail": {
             "Description": "Email for superuser user",
@@ -86,7 +86,8 @@
             "m1.small": {"Arch": "64"},
             "m1.medium": {"Arch": "64"},
             "m1.large": {"Arch": "64"},
-            "m1.xlarge": {"Arch": "64"}
+            "m1.xlarge": {"Arch": "64"},
+            "c3.4xlarge": {"Arch": "64"}
         },
         "AWSRegionArch2AMI": {
             "ap-southeast-2": {"64": "ami-5993f663"},
@@ -171,8 +172,6 @@
                                     "\n",
                                     "export CASS_SECURITY_GROUP_NAME=", {"Ref": "CassSecurityGroup"},
"\n",
                                     "\n",
-                                    "#export JVM_EXTRA_OPTS=-javaagent:/usr/share/cassandra/lib/priam-cass-extensions-1.2.24.jar",
"\n",
-                                    "\n",
                                     "export CASSANDRA_CLUSTER_NAME=", {"Ref": "CassClusterName"},
"\n",
                                     "export CASSANDRA_NUM_SERVERS=", {"Ref": "CassNumServers"},
"\n",
                                     "export CASSANDRA_KEYSPACE_NAME=usergrid", "\n",
@@ -190,13 +189,6 @@
                                 "EOF\n",
                                 "\n",
 
-                                "# put AWS creds Priam's config file\n",
-                                "cat >/etc/awscredential.properties <<EOF\n",
-                                "AWSACCESSID=", {"Ref": "CassKey"}, "\n",
-                                "AWSKEY=", {"Fn::GetAtt": ["CassKey", "SecretAccessKey"]},
"\n",
-                                "EOF\n",
-                                "\n",
-
                                 "# setup s3cmd (will be installed by init script) \n",
                                 "cat >/etc/s3cfg <<EOF\n",
                                 "access_key=", {"Ref": "CassKey"}, "\n",
@@ -588,7 +580,7 @@
                     }]
             }
         },
-        "CassSecurityGroupPort7000": {
+        "CassAllow7000FromCass": {
             "Type": "AWS::EC2::SecurityGroupIngress",
             "Properties": {
                 "GroupName": {"Ref": "CassSecurityGroup"},
@@ -598,7 +590,7 @@
                 "SourceSecurityGroupName": {"Ref": "CassSecurityGroup"}
             }
         },
-        "CassSecurityGroupPort9160": {
+        "CassAllow9160FromCass": {
             "Type": "AWS::EC2::SecurityGroupIngress",
             "Properties": {
                 "GroupName": {"Ref": "CassSecurityGroup"},
@@ -608,36 +600,36 @@
                 "SourceSecurityGroupName": {"Ref": "CassSecurityGroup"}
             }
         },
-        "RestSecurityGroupPort9160" : {
-                 "Type" : "AWS::EC2::SecurityGroupIngress",
-                 "Properties" : {
-                     "GroupName" : { "Ref" : "CassSecurityGroup" },
-                     "IpProtocol": "tcp",
-                    "FromPort": "9160",
-                    "ToPort": "9160",
-                    "SourceSecurityGroupName": {"Ref": "RestSecurityGroup"}
-                 }
-             },
-        "CassSecurityGroupPort9200": {
+        "CassAllow9300FromCass": {
             "Type": "AWS::EC2::SecurityGroupIngress",
             "Properties": {
                 "GroupName": {"Ref": "CassSecurityGroup"},
                 "IpProtocol": "tcp",
-                "FromPort": "9200",
-                "ToPort": "9200",
+                "FromPort": "9300",
+                "ToPort": "9300",
                 "SourceSecurityGroupName": {"Ref": "CassSecurityGroup"}
             }
         },
-        "CassSecurityGroupPort9300": {
+        "RestAllowAllFromCass": {
             "Type": "AWS::EC2::SecurityGroupIngress",
             "Properties": {
-                "GroupName": {"Ref": "CassSecurityGroup"},
+                "GroupName": {"Ref": "RestSecurityGroup"},
                 "IpProtocol": "tcp",
-                "FromPort": "9300",
-                "ToPort": "9300",
+                "FromPort": "0",
+                "ToPort": "65535",
                 "SourceSecurityGroupName": {"Ref": "CassSecurityGroup"}
             }
         },
+        "CassAlllowAllFromRest" : {
+                 "Type" : "AWS::EC2::SecurityGroupIngress",
+                 "Properties" : {
+                     "GroupName" : { "Ref" : "CassSecurityGroup" },
+                     "IpProtocol": "tcp",
+                    "FromPort": "0",
+                    "ToPort": "65535",
+                    "SourceSecurityGroupName": {"Ref": "RestSecurityGroup"}
+                 }
+         },
         "RestSecurityGroup": {
             "Type": "AWS::EC2::SecurityGroup",
             "Properties": {
@@ -657,6 +649,4 @@
         }
     }
 
-
-
 }

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/2d592f0a/stack/corepersistence/pom.xml
----------------------------------------------------------------------
diff --git a/stack/corepersistence/pom.xml b/stack/corepersistence/pom.xml
index 4716533..5a5c20c 100644
--- a/stack/corepersistence/pom.xml
+++ b/stack/corepersistence/pom.xml
@@ -43,7 +43,7 @@
         <commons.collections.version>3.2.1</commons.collections.version>
         <commons.io.version>2.4</commons.io.version>
         <commons.lang.version>3.1</commons.lang.version>
-        <elasticsearch.version>1.2.1</elasticsearch.version>
+        <elasticsearch.version>1.2.3</elasticsearch.version>
         <fasterxml-uuid.version>3.1.3</fasterxml-uuid.version>
         <guava.version>15.0</guava.version>
         <guice.version>3.0</guice.version>

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/2d592f0a/stack/pom.xml
----------------------------------------------------------------------
diff --git a/stack/pom.xml b/stack/pom.xml
index 4c03904..4e4eee2 100644
--- a/stack/pom.xml
+++ b/stack/pom.xml
@@ -190,13 +190,13 @@
     <module>core</module>
     <module>services</module>
     <module>tools</module>
-    <module>mongo-emulator</module>
-    <module>websocket</module>
     <module>rest</module>
-    <module>launcher</module>
     <module>test-utils</module>
-    <module>query-validator</module>
     <module>build-tools</module>
+    <module>launcher</module>
+    <module>query-validator</module>
+    <module>mongo-emulator</module>
+    <module>websocket</module>
   </modules>
 
   <dependencyManagement>


Mime
View raw message