Browse Source

Make Cassandra default to one-node cluster and simplify database.sh

Hamilton Turner 10 years ago
parent
commit
ed047dce32

+ 3 - 3
config/cassandra/cassandra.yaml

@@ -224,7 +224,7 @@ seed_provider:
       parameters:
       parameters:
           # seeds is actually a comma-delimited list of addresses.
           # seeds is actually a comma-delimited list of addresses.
           # Ex: "<ip1>,<ip2>,<ip3>"
           # Ex: "<ip1>,<ip2>,<ip3>"
-          - seeds: "TFB_DATABASE_HOST"
+          - seeds: "127.0.0.1"
 
 
 # For workloads with more data than can fit in memory, Cassandra's
 # For workloads with more data than can fit in memory, Cassandra's
 # bottleneck will be reads that need to fetch data from
 # bottleneck will be reads that need to fetch data from
@@ -294,7 +294,7 @@ ssl_storage_port: 7001
 # address associated with the hostname (it might not be).
 # address associated with the hostname (it might not be).
 #
 #
 # Setting this to 0.0.0.0 is always wrong.
 # Setting this to 0.0.0.0 is always wrong.
-listen_address: TFB_DATABASE_HOST
+# listen_address: 127.0.0.1
 
 
 # Address to broadcast to other Cassandra nodes
 # Address to broadcast to other Cassandra nodes
 # Leaving this blank will set it to the same value as listen_address
 # Leaving this blank will set it to the same value as listen_address
@@ -332,7 +332,7 @@ start_rpc: true
 # Note that unlike ListenAddress above, it is allowed to specify 0.0.0.0
 # Note that unlike ListenAddress above, it is allowed to specify 0.0.0.0
 # here if you want to listen on all interfaces, but that will break clients 
 # here if you want to listen on all interfaces, but that will break clients 
 # that rely on node auto-discovery.
 # that rely on node auto-discovery.
-rpc_address: TFB_DATABASE_HOST
+rpc_address: 0.0.0.0
 # port for Thrift to listen for clients on
 # port for Thrift to listen for clients on
 rpc_port: 9160
 rpc_port: 9160
 
 

+ 3 - 9
toolset/setup/linux/database.sh

@@ -22,7 +22,6 @@
 # problems are welcome
 # problems are welcome
 
 
 set -x
 set -x
-export DB_HOST=${DB_HOST:-127.0.0.1}
 export DEBIAN_FRONTEND=noninteractive
 export DEBIAN_FRONTEND=noninteractive
 
 
 source /etc/lsb-release
 source /etc/lsb-release
@@ -166,11 +165,6 @@ tar xzf apache-cassandra-$CASS_V-bin.tar.gz
 
 
 rm -rf /ssd/cassandra /ssd/log/cassandra
 rm -rf /ssd/cassandra /ssd/log/cassandra
 mkdir -p /ssd/cassandra /ssd/log/cassandra
 mkdir -p /ssd/cassandra /ssd/log/cassandra
-
-sed -i "s/^.*seeds:.*/          - seeds: \"$DB_HOST\"/" cassandra/cassandra.yaml
-sed -i "s/^listen_address:.*/listen_address: $DB_HOST/" cassandra/cassandra.yaml
-sed -i "s/^rpc_address:.*/rpc_address: $DB_HOST/" cassandra/cassandra.yaml
-
 mv cassandra/cassandra.yaml apache-cassandra-$CASS_V/conf
 mv cassandra/cassandra.yaml apache-cassandra-$CASS_V/conf
 mv cassandra/log4j-server.properties apache-cassandra-$CASS_V/conf
 mv cassandra/log4j-server.properties apache-cassandra-$CASS_V/conf
 nohup apache-cassandra-$CASS_V/bin/cassandra -p c.pid > cassandra.log
 nohup apache-cassandra-$CASS_V/bin/cassandra -p c.pid > cassandra.log
@@ -181,10 +175,10 @@ for i in {1..45}; do
 done
 done
 nc -z localhost 9160
 nc -z localhost 9160
 if [ $? -eq 0 ]; then
 if [ $? -eq 0 ]; then
-  cat cassandra/cleanup-keyspace.cql | apache-cassandra-$CASS_V/bin/cqlsh $DB_HOST
+  cat cassandra/cleanup-keyspace.cql | apache-cassandra-$CASS_V/bin/cqlsh 127.0.0.1
   python cassandra/db-data-gen.py > cassandra/tfb-data.cql
   python cassandra/db-data-gen.py > cassandra/tfb-data.cql
-  apache-cassandra-$CASS_V/bin/cqlsh -f cassandra/create-keyspace.cql $DB_HOST
-  apache-cassandra-$CASS_V/bin/cqlsh -f cassandra/tfb-data.cql $DB_HOST
+  apache-cassandra-$CASS_V/bin/cqlsh -f cassandra/create-keyspace.cql 127.0.0.1
+  apache-cassandra-$CASS_V/bin/cqlsh -f cassandra/tfb-data.cql 127.0.0.1
   rm -rf apache-cassandra-*-bin.tar.gz cassandra
   rm -rf apache-cassandra-*-bin.tar.gz cassandra
 else
 else
   >&2 echo "Cassandra did not start, skipping"
   >&2 echo "Cassandra did not start, skipping"

+ 2 - 3
toolset/setup/linux/installer.py

@@ -26,11 +26,10 @@ class Installer:
       print("\nINSTALL: Installing database software\n")   
       print("\nINSTALL: Installing database software\n")   
       self.__run_command("cd .. && " + self.benchmarker.database_sftp_string(batch_file="../config/database_sftp_batch"), True)
       self.__run_command("cd .. && " + self.benchmarker.database_sftp_string(batch_file="../config/database_sftp_batch"), True)
       with open (linux_install_root + "/database.sh", "r") as myfile:
       with open (linux_install_root + "/database.sh", "r") as myfile:
-        remote_script = myfile.read()
         print("\nINSTALL: %s" % self.benchmarker.database_ssh_string)
         print("\nINSTALL: %s" % self.benchmarker.database_ssh_string)
         p = subprocess.Popen(self.benchmarker.database_ssh_string.split(" ") +
         p = subprocess.Popen(self.benchmarker.database_ssh_string.split(" ") +
-                             ["DB_HOST=" + self.benchmarker.database_host,
-                              "bash"], stdin=subprocess.PIPE)
+                             ["bash"], stdin=subprocess.PIPE)
+        remote_script = myfile.read()
         p.communicate(remote_script)
         p.communicate(remote_script)
         returncode = p.returncode
         returncode = p.returncode
         if returncode != 0:
         if returncode != 0: