usergrid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From snoopd...@apache.org
Subject git commit: Setup RAID0 at /mnt and use that for Cassandra and ElasticSearch data.
Date Sun, 02 Feb 2014 16:20:39 GMT
Updated Branches:
  refs/heads/elasticsearch-cluster ced42e11a -> 894279d66


Setup RAID0 at /mnt and use that for Cassandra and ElasticSearch data.


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

Branch: refs/heads/elasticsearch-cluster
Commit: 894279d662869713bcf599681411ca8ccb29ea99
Parents: ced42e1
Author: Dave Johnson <dmjohnson@apigee.com>
Authored: Sun Feb 2 11:16:01 2014 -0500
Committer: Dave Johnson <dmjohnson@apigee.com>
Committed: Sun Feb 2 11:16:01 2014 -0500

----------------------------------------------------------------------
 .../src/main/dist/conf/Priam.properties         |  6 ++--
 .../src/main/dist/init_instance/create_raid0.sh | 32 ++++++++++++++++++++
 .../main/dist/init_instance/init_instance.sh    |  2 ++
 .../dist/init_instance/install_cassandra.sh     |  5 +--
 .../dist/init_instance/install_elasticsearch.sh |  8 +++++
 .../src/main/groovy/configure_cassandra.groovy  |  6 ++--
 .../main/groovy/configure_elasticsearch.groovy  |  5 ++-
 7 files changed, 55 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/894279d6/stack/corepersistence/priamcluster/src/main/dist/conf/Priam.properties
----------------------------------------------------------------------
diff --git a/stack/corepersistence/priamcluster/src/main/dist/conf/Priam.properties b/stack/corepersistence/priamcluster/src/main/dist/conf/Priam.properties
index eb90064..e327526 100644
--- a/stack/corepersistence/priamcluster/src/main/dist/conf/Priam.properties
+++ b/stack/corepersistence/priamcluster/src/main/dist/conf/Priam.properties
@@ -8,9 +8,9 @@ priam.cass.startscript=/etc/init.d/cassandra start
 priam.cass.stopscript=/etc/init.d/cassandra stop
 priam.yamlLocation=/etc/cassandra/cassandra.yaml
 
-priam.commitlog.location=/var/lib/cassandra/commitlog
-priam.data.location=/var/lib/cassandra/data
-priam.cache.location=/var/lib/cassandra/saved_caches
+priam.commitlog.location=/mnt/data/cassandra/commitlog
+priam.data.location=/mnt/data/cassandra/data
+priam.cache.location=/mnt/data/cassandra/saved_caches
 
 priam.s3.base_dir=priam-backup
 priam.s3.bucket=priam-cassandra-archive

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/894279d6/stack/corepersistence/priamcluster/src/main/dist/init_instance/create_raid0.sh
----------------------------------------------------------------------
diff --git a/stack/corepersistence/priamcluster/src/main/dist/init_instance/create_raid0.sh
b/stack/corepersistence/priamcluster/src/main/dist/init_instance/create_raid0.sh
new file mode 100644
index 0000000..401fcf4
--- /dev/null
+++ b/stack/corepersistence/priamcluster/src/main/dist/init_instance/create_raid0.sh
@@ -0,0 +1,32 @@
+#!/bin/bash
+
+# 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 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
+(echo o; echo n; echo p; echo 1; echo ; echo; echo w) | fdisk /dev/xvdd
+(echo o; echo n; echo p; echo 1; echo ; echo; echo w) | fdisk /dev/xvde
+
+# 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/894279d6/stack/corepersistence/priamcluster/src/main/dist/init_instance/init_instance.sh
----------------------------------------------------------------------
diff --git a/stack/corepersistence/priamcluster/src/main/dist/init_instance/init_instance.sh
b/stack/corepersistence/priamcluster/src/main/dist/init_instance/init_instance.sh
index c733705..46dbbf7 100644
--- a/stack/corepersistence/priamcluster/src/main/dist/init_instance/init_instance.sh
+++ b/stack/corepersistence/priamcluster/src/main/dist/init_instance/init_instance.sh
@@ -10,6 +10,8 @@ dpkg-reconfigure -f noninteractive tzdata
 . /etc/profile.d/aws-credentials.sh
 . /etc/profile.d/usergrid-env.sh
 
+./create_raid0.sh
+
 # Install the easy stuff
 PKGS="ntp unzip groovy tomcat7 curl"
 apt-get update

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/894279d6/stack/corepersistence/priamcluster/src/main/dist/init_instance/install_cassandra.sh
----------------------------------------------------------------------
diff --git a/stack/corepersistence/priamcluster/src/main/dist/init_instance/install_cassandra.sh
b/stack/corepersistence/priamcluster/src/main/dist/init_instance/install_cassandra.sh
index af6ae01..5bf7d04 100644
--- a/stack/corepersistence/priamcluster/src/main/dist/init_instance/install_cassandra.sh
+++ b/stack/corepersistence/priamcluster/src/main/dist/init_instance/install_cassandra.sh
@@ -10,8 +10,9 @@ apt-get update
 apt-get -y install libcap2
 apt-get --force-yes -y install cassandra
 /etc/init.d/cassandra stop
-mkdir -p /var/lib/cassandra
-chown cassandra /var/lib/cassandra
+
+mkdir -p /mnt/data/cassandra
+chown cassandra /mnt/data/cassandra
 
 # Wait for other instances to start up
 cd /usr/share/usergrid/scripts

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/894279d6/stack/corepersistence/priamcluster/src/main/dist/init_instance/install_elasticsearch.sh
----------------------------------------------------------------------
diff --git a/stack/corepersistence/priamcluster/src/main/dist/init_instance/install_elasticsearch.sh
b/stack/corepersistence/priamcluster/src/main/dist/init_instance/install_elasticsearch.sh
index 5b69e8a..8351cf6 100644
--- a/stack/corepersistence/priamcluster/src/main/dist/init_instance/install_elasticsearch.sh
+++ b/stack/corepersistence/priamcluster/src/main/dist/init_instance/install_elasticsearch.sh
@@ -3,6 +3,8 @@
 # Install and stop ElasticSearch
 pushd /etc/apt/sources.list.d
 
+
+
 cat >> elasticsearch.sources.list << EOF
 deb http://packages.elasticsearch.org/elasticsearch/1.0/debian stable main
 EOF
@@ -10,6 +12,12 @@ apt-get update
 apt-get --force-yes -y install elasticsearch
 /etc/init.d/elasticsearch stop
 
+mkdir /mnt/data/elasticsearch
+chown elasticsearch /mnt/data/elasticsearch]
+
+mkdir /mnt/log/elasticsearch
+chown elasticsearch /mnt/log/elasticsearch
+
 # Configure and restart ElasticSearch
 update-rc.d elasticsearch defaults 95 10
 cd /usr/share/usergrid/scripts

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/894279d6/stack/corepersistence/priamcluster/src/main/groovy/configure_cassandra.groovy
----------------------------------------------------------------------
diff --git a/stack/corepersistence/priamcluster/src/main/groovy/configure_cassandra.groovy
b/stack/corepersistence/priamcluster/src/main/groovy/configure_cassandra.groovy
index cbcf5c7..a71e071 100644
--- a/stack/corepersistence/priamcluster/src/main/groovy/configure_cassandra.groovy
+++ b/stack/corepersistence/priamcluster/src/main/groovy/configure_cassandra.groovy
@@ -46,15 +46,15 @@ authenticator: org.apache.cassandra.auth.AllowAllAuthenticator
 authorizer: org.apache.cassandra.auth.AllowAllAuthorizer
 partitioner: org.apache.cassandra.dht.RandomPartitioner
 data_file_directories:
-    - /var/lib/cassandra/data
-commitlog_directory: /var/lib/cassandra/commitlog
+    - /mnt/data/cassandra/data
+commitlog_directory: /mnt/data/cassandra/commitlog
 disk_failure_policy: stop
 key_cache_size_in_mb:
 key_cache_save_period: 14400
 row_cache_size_in_mb: 0
 row_cache_save_period: 0
 row_cache_provider: SerializingCacheProvider
-saved_caches_directory: /var/lib/cassandra/saved_caches
+saved_caches_directory: /mnt/data/cassandra/saved_caches
 commitlog_sync: periodic
 commitlog_sync_period_in_ms: 10000
 commitlog_segment_size_in_mb: 32

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/894279d6/stack/corepersistence/priamcluster/src/main/groovy/configure_elasticsearch.groovy
----------------------------------------------------------------------
diff --git a/stack/corepersistence/priamcluster/src/main/groovy/configure_elasticsearch.groovy
b/stack/corepersistence/priamcluster/src/main/groovy/configure_elasticsearch.groovy
index b80314d..6437b5f 100644
--- a/stack/corepersistence/priamcluster/src/main/groovy/configure_elasticsearch.groovy
+++ b/stack/corepersistence/priamcluster/src/main/groovy/configure_elasticsearch.groovy
@@ -38,7 +38,10 @@ discovery.zen.ping.unicast.hosts: [${seeds}]
 node:
     name: ${hostName} 
 network:
-    host: ${hostName}
+    host: ${hostName}\
+path:
+  logs: /mnt/log/elasticsearch
+  data: /mnt/data/elasticsearch
 """
 
 println elasticSearchConfig


Mime
View raw message