usergrid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From toddn...@apache.org
Subject [1/3] git commit: Added opscenter agent configuration
Date Fri, 25 Jul 2014 16:47:22 GMT
Repository: incubator-usergrid
Updated Branches:
  refs/heads/two-dot-o 54f045fc6 -> 3392c2e24


Added opscenter agent configuration


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

Branch: refs/heads/two-dot-o
Commit: d33812aa0a20a1ca6bc82acaa1ce0b8a69777254
Parents: 4da636b
Author: Todd Nine <tnine@apigee.com>
Authored: Fri Jul 18 11:23:01 2014 -0600
Committer: Todd Nine <tnine@apigee.com>
Committed: Fri Jul 18 11:23:01 2014 -0600

----------------------------------------------------------------------
 .../main/dist/init_instance/init_db_server.sh   |  3 +
 .../dist/init_instance/install_cassandra.sh     |  3 +
 .../init_instance/install_opscenter_agent.sh    | 37 +++++++++++++
 .../dist/init_instance/install_oraclejdk.sh     |  7 ++-
 .../groovy/configure_opscenter_agent.groovy     | 58 ++++++++++++++++++++
 stack/awscluster/ugcluster-cf.json              | 10 ++++
 6 files changed, 117 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/d33812aa/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..fe689c7 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
@@ -56,6 +56,9 @@ cd /usr/share/usergrid/init_instance
 cd /usr/share/usergrid/init_instance
 ./install_cassandra.sh
 
+cd /usr/share/usergrid/init_instance
+./install_opscenter_agent.sh
+
 # Install and start ElasticSearch
 cd /usr/share/usergrid/init_instance
 ./install_elasticsearch.sh

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/d33812aa/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..76a4c09 100644
--- a/stack/awscluster/src/main/dist/init_instance/install_cassandra.sh
+++ b/stack/awscluster/src/main/dist/init_instance/install_cassandra.sh
@@ -54,6 +54,9 @@ apt-get  --force-yes -y install opscenter
 sudo service opscenterd start
 
 
+
+
+
 ## Configure Priam
 #groovy configure_priam.groovy
 #

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/d33812aa/stack/awscluster/src/main/dist/init_instance/install_opscenter_agent.sh
----------------------------------------------------------------------
diff --git a/stack/awscluster/src/main/dist/init_instance/install_opscenter_agent.sh b/stack/awscluster/src/main/dist/init_instance/install_opscenter_agent.sh
new file mode 100644
index 0000000..447da6f
--- /dev/null
+++ b/stack/awscluster/src/main/dist/init_instance/install_opscenter_agent.sh
@@ -0,0 +1,37 @@
+#!/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.
+#
+
+
+# Install and stop Cassandra
+pushd /etc/apt/sources.list.d
+
+echo "deb http://debian.datastax.com/community stable main" | sudo tee -a /etc/apt/sources.list.d/datastax.community.list
+
+curl -L https://debian.datastax.com/debian/repo_key | sudo apt-key add -
+
+sudo apt-get update
+sudo apt-get install datastax-agent
+
+
+groovy configure_opscenter_agent.groovy > /var/lib/datastax-agent/conf/address.yaml
+
+sudo service datastax-agent start
+
+popd

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/d33812aa/stack/awscluster/src/main/dist/init_instance/install_oraclejdk.sh
----------------------------------------------------------------------
diff --git a/stack/awscluster/src/main/dist/init_instance/install_oraclejdk.sh b/stack/awscluster/src/main/dist/init_instance/install_oraclejdk.sh
index 3d99e38..bb967cd 100644
--- a/stack/awscluster/src/main/dist/init_instance/install_oraclejdk.sh
+++ b/stack/awscluster/src/main/dist/init_instance/install_oraclejdk.sh
@@ -47,4 +47,9 @@ chown -R root:root /usr/lib/jvm/jdk1.7.0
 sudo rm /usr/lib/jvm/default-java
 sudo ln -s /usr/lib/jvm/jdk1.7.0 /usr/lib/jvm/default-java
 
-popd
\ No newline at end of file
+#Install the JNA for cassandra to use
+
+sudo apt-get install libjna-java
+
+
+popd

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/d33812aa/stack/awscluster/src/main/groovy/configure_opscenter_agent.groovy
----------------------------------------------------------------------
diff --git a/stack/awscluster/src/main/groovy/configure_opscenter_agent.groovy b/stack/awscluster/src/main/groovy/configure_opscenter_agent.groovy
new file mode 100644
index 0000000..90fc2f7
--- /dev/null
+++ b/stack/awscluster/src/main/groovy/configure_opscenter_agent.groovy
@@ -0,0 +1,58 @@
+/*
+ * 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.
+ */
+
+
+// configure_cassandra.groovy 
+// 
+// Emits Cassandra config file based on environment and Cassandra node 
+// registry in SimpleDB
+//
+import com.amazonaws.auth.*
+import com.amazonaws.services.simpledb.*
+import com.amazonaws.services.simpledb.model.*
+
+String accessKey = (String)System.getenv().get("AWS_ACCESS_KEY")
+String secretKey = (String)System.getenv().get("AWS_SECRET_KEY")
+String stackName = (String)System.getenv().get("STACK_NAME")
+
+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
+def selectResult = sdbClient.select(new SelectRequest((String)"select * from `${domain}`
where itemName() is not null order by itemName()"))
+
+def opsCenterNode = null
+
+for (item in selectResult.getItems()) {
+    def att = item.getAttributes().get(0)
+    if (att.getValue().equals(stackName)) {
+            opsCenterNode = item.getName();
+        break;
+    }
+
+}
+
+def clientconfig = """
+
+
+stomp_interface: : ${opsCenterNode}
+"""
+
+println clientconfig

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/d33812aa/stack/awscluster/ugcluster-cf.json
----------------------------------------------------------------------
diff --git a/stack/awscluster/ugcluster-cf.json b/stack/awscluster/ugcluster-cf.json
index cfd9956..cd90de8 100644
--- a/stack/awscluster/ugcluster-cf.json
+++ b/stack/awscluster/ugcluster-cf.json
@@ -608,6 +608,16 @@
                 "SourceSecurityGroupName": {"Ref": "CassSecurityGroup"}
             }
         },
+        "CassSecurityGroupPort7199": {
+                   "Type": "AWS::EC2::SecurityGroupIngress",
+                   "Properties": {
+                       "GroupName": {"Ref": "CassSecurityGroup"},
+                       "IpProtocol": "tcp",
+                       "FromPort": "7199",
+                       "ToPort": "7199",
+                       "SourceSecurityGroupName": {"Ref": "CassSecurityGroup"}
+                   }
+               },
         "RestSecurityGroupPort9160" : {
                  "Type" : "AWS::EC2::SecurityGroupIngress",
                  "Properties" : {


Mime
View raw message