Created
April 4, 2012 15:45
-
-
Save m2mIO-gister/2303005 to your computer and use it in GitHub Desktop.
DSE - Local
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# TODO: Add arg to get path | |
path_to_new_dse_dir=/Users/franklovecchio/Desktop/development/dse | |
handle_args() { | |
} | |
# $1: path | |
make_config() { | |
cat >> $path_to_new_dse_dir/cassandra.yaml <<EOF | |
cluster_name: '' | |
initial_token: | |
auto_bootstrap: false | |
hinted_handoff_enabled: true | |
max_hint_window_in_ms: 3600000 # one hour | |
hinted_handoff_throttle_delay_in_ms: 50 | |
authenticator: org.apache.cassandra.auth.AllowAllAuthenticator | |
authority: org.apache.cassandra.auth.AllowAllAuthority | |
partitioner: org.apache.cassandra.dht.RandomPartitioner | |
data_file_directories: | |
- $path_to_new_dse_dir/$1/data | |
commitlog_directory: $path_to_new_dse_dir/$1/commitlog | |
saved_caches_directory: $path_to_new_dse_dir/$1/saved_caches | |
commitlog_sync: periodic | |
commitlog_sync_period_in_ms: 10000 | |
seed_provider: | |
- class_name: org.apache.cassandra.locator.SimpleSeedProvider | |
parameters: | |
- seeds: "127.0.0.1" | |
flush_largest_memtables_at: 0.75 | |
reduce_cache_sizes_at: 0.85 | |
reduce_cache_capacity_to: 0.6 | |
concurrent_reads: 32 | |
concurrent_writes: 32 | |
memtable_flush_queue_size: 4 | |
sliced_buffer_size_in_kb: 64 | |
storage_port: 7000 | |
ssl_storage_port: 7001 | |
listen_address: | |
rpc_address: 0.0.0.0 | |
rpc_port: 9160 | |
rpc_keepalive: true | |
rpc_server_type: sync | |
thrift_framed_transport_size_in_mb: 15 | |
thrift_max_message_length_in_mb: 16 | |
incremental_backups: false | |
snapshot_before_compaction: false | |
column_index_size_in_kb: 64 | |
in_memory_compaction_limit_in_mb: 64 | |
multithreaded_compaction: false | |
compaction_throughput_mb_per_sec: 16 | |
compaction_preheat_key_cache: true | |
rpc_timeout_in_ms: 10000 | |
endpoint_snitch: com.datastax.bdp.snitch.DseSimpleSnitch | |
dynamic_snitch_update_interval_in_ms: 100 | |
dynamic_snitch_reset_interval_in_ms: 600000 | |
dynamic_snitch_badness_threshold: 0.1 | |
request_scheduler: org.apache.cassandra.scheduler.NoScheduler | |
index_interval: 128 | |
encryption_options: | |
internode_encryption: none | |
keystore: conf/.keystore | |
keystore_password: cassandra | |
truststore: conf/.truststore | |
truststore_password: cassandra | |
EOF | |
} | |
# $1: type | |
setup_data_directories() { | |
mkdir $1 | |
mkdir $1/data | |
mkdir $1/commitlog | |
mkdir $1/saved_caches | |
} | |
download_and_config() { | |
mkdir $path_to_new_dse_dir | |
cd $path_to_new_dse_dir | |
wget https://s3.amazonaws.com/2lemetry-public/dse-2.0-1-bin.tar.gz | |
tar -xzf dse-2.0-1-bin.tar.gz | |
setup_data_directories "data_cass" | |
setup_data_directories "data_hadoop" | |
setup_data_directories "data_solr" | |
cp -r dse-2.0-1 dse-2.0-1_hadoop | |
cp -r dse-2.0-1 dse-2.0-1_solr | |
mv dse-2.0-1 dse-2.0-1_cass | |
make_config_file "data_cass" | |
mv cassandra.yaml dse-2.0-1_cass/resources/cassandra/conf/ | |
make_config_file "data_hadoop" | |
mv cassandra.yaml dse-2.0-1_hadoop/resources/cassandra/conf/ | |
make_config_file "data_solr" | |
mv cassandra.yaml dse-2.0-1_solr/resources/cassandra/conf/ | |
} | |
# $1: folder | |
# $2: ip | |
# $3: seeds | |
# $4: token | |
modify_config() { | |
cass_env=$path_to_new_dse_dir/$1/cassandra/resources/cassandra-env.sh | |
cass_config=$path_to_new_dse_dir/$1/cassandra/resources/cassandra.yaml | |
echo -e 'JVM_OPTS="$JVM_OPTS -Djava.rmi.server.hostname=$2"' >> $cass_env | |
sed -i "s/- seeds: \"127.0.0.1\"/- seeds: \"$3\"/g" $cass_config | |
sed -i "s/initial_token:/initial_token: 4/g" $cass_config | |
sed -i "s/cluster_name: ''/cluster_name: 'dse'/g" $cass_config | |
sed -i "s/listen_address:/listen_address: $2/g" $cass_config | |
sed -i "s/0.0.0.0/$2/g" $cass_config | |
} | |
setup_cass() { | |
modify_config "dse-2.0-1_cass" "127.0.0.1" "127.0.0.2, 127.0.0.1" "0" | |
} | |
setup_hadoop() { | |
modify_config "dse-2.0-1_hadoop" "127.0.0.2" "127.0.0.2, 127.0.0.1" "56713727820156410577229101238628035242" | |
} | |
setup_solr() { | |
modify_config "dse-2.0-1_solr" "127.0.0.3" "127.0.0.2, 127.0.0.1" "113427455640312821154458202477256070485" | |
} | |
handle_args | |
download_and_config | |
setup_cass | |
setup_hadoop | |
setup_solr |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment