install-reddit: Upgrade Cassandra and use DataStax repos.

This modernizes install-script reddit a bit, as we're already running
1.2 in production.

Note: this upgrades Cassandra from a patched 1.0.7 to vanilla 1.2.19. Please see
http://www.datastax.com/documentation/cassandra/1.2/cassandra/upgrade/upgradeC_c.html
for instructions on upgrading which may require some upgrades of the
data on disk.
This commit is contained in:
Neil Williams
2015-02-05 10:08:38 -08:00
parent f869f10dbc
commit f94e9cc14e

View File

@@ -116,6 +116,10 @@ Pin: release o=LP-PPA-reddit
Pin-Priority: 600
HERE
# add the datastax cassandra repos
echo deb http://debian.datastax.com/community stable main > /etc/apt/sources.list.d/cassandra.sources.list
curl -L https://debian.datastax.com/debian/repo_key | sudo apt-key add -
# grab the new ppas' package listings
apt-get update
@@ -168,7 +172,7 @@ memcached
postgresql
postgresql-client
rabbitmq-server
cassandra
cassandra=1.2.19
haproxy
nginx
stunnel
@@ -177,9 +181,6 @@ sutro
libpcre3-dev
PACKAGES
# paper over stack size issues with cassandra
sed -i s/-Xss128k/-Xss228k/ /etc/cassandra/cassandra-env.sh
###############################################################################
# Wait for all the services to be up
###############################################################################
@@ -232,14 +233,20 @@ done
###############################################################################
# Configure Cassandra
###############################################################################
if ! echo | cassandra-cli -h localhost -k reddit &> /dev/null; then
echo "create keyspace reddit;" | cassandra-cli -h localhost -B
fi
python <<END
import pycassa
sys = pycassa.SystemManager("localhost:9160")
cat <<CASS | cassandra-cli -B -h localhost -k reddit || true
create column family permacache with column_type = 'Standard' and
comparator = 'BytesType';
CASS
if "reddit" not in sys.list_keyspaces():
print "creating keyspace 'reddit'"
sys.create_keyspace("reddit", "SimpleStrategy", {"replication_factor": "1"})
print "done"
if "permacache" not in sys.get_keyspace_column_families("reddit"):
print "creating column family 'permacache'"
sys.create_column_family("reddit", "permacache")
print "done"
END
###############################################################################
# Configure PostgreSQL