Skip to content

Commit

Permalink
Merge "Closes-Bug: #1550650 - Fixed upgrade 3.0-1 -> 3.0-2719" into R3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Zuul authored and opencontrail-ci-admin committed Feb 28, 2016
2 parents 42db3d1 + 95e25c7 commit 92801e9
Show file tree
Hide file tree
Showing 3 changed files with 64 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
#!/bin/bash
set -x
this_host=$1; shift
database_dir=$1
database_dir=$1; shift
contrail_package_name=$1
cassandra_version=`dpkg -s cassandra | grep Version | awk '{print $2}'`
if [ "$cassandra_version" != "1.2.11" ]; then
# Don't do upgrade
exit
fi
nodetool upgradesstables
service supervisor-database stop
wget http://puppet/contrail/repo/dgautam_uj_mainline_2713/cassandra_2.0.17_all.deb
wget http://puppet/contrail/repo/${contrail_package_name}/cassandra_2.0.17_all.deb
dpkg --force-depends --force-overwrite --force-confnew --install cassandra_2.0.17_all.deb
service cassandra stop
chown -R cassandra:cassandra ${database_dir}
Expand All @@ -33,4 +34,4 @@ sleep 5
done
echo "Successful cassandra connect to 2.0.17: $cassandra_cli_cmd"
nodetool upgradesstables
service cassandra stop
service cassandra stop
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
# Moved Cassandra config to augeas from templates
$cassandra_config_file ="${contrail_cassandra_dir}/cassandra.yaml"
$cassandra_env_file="${contrail_cassandra_dir}/cassandra-env.sh"
$cassandra_seeds_join = join($cassandra_seeds, ',')
#$cassandra_yaml_config = { 'cassandra_config' => {
# 'listen_address' => $host_control_ip,
# 'cluster_name' => "\'Contrail\'",
Expand Down Expand Up @@ -59,17 +60,72 @@
} ->
file_line { 'Config Cassandra Seeds':
path => $cassandra_config_file,
line => " - seeds: \"${cassandra_seeds}\"",
line => " - seeds: \"${cassandra_seeds_join}\"",
match => " - seeds:.*$",
} ->
file_line { 'Config File Directories':
path => $cassandra_config_file,
line => " - ${database_dir}/data",
match => " - /var/lib/cassandra/data",
} ->
file_line { 'Config File Remove 1':
path => $cassandra_config_file,
line => "#multithreaded_compaction",
match => "^multithreaded_compaction.*",
} ->
file_line { 'Config File Remove 2':
path => $cassandra_config_file,
line => "#row_cache_provider",
match => "^row_cache_provider.*",
} ->
file_line { 'Config File Remove 3':
path => $cassandra_config_file,
line => "#flush_largest_memtables_at",
match => "^flush_largest_memtables_at.*",
} ->
file_line { 'Config File Remove 4':
path => $cassandra_config_file,
line => "#reduce_cache_sizes_at",
match => "^reduce_cache_sizes_at.*",
} ->
file_line { 'Config File Remove 5':
path => $cassandra_config_file,
line => "#reduce_cache_capacity_to",
match => "^reduce_cache_capacity_to.*",
} ->
file_line { 'Config File Remove 6':
path => $cassandra_config_file,
line => "#memtable_flush_queue_size",
match => "^memtable_flush_queue_size.*",
} ->
file_line { 'Config File Remove 7':
path => $cassandra_config_file,
line => "#tombstone_debug_threshold",
match => "^tombstone_debug_threshold.*",
} ->
file_line { 'Config File Remove 8':
path => $cassandra_config_file,
line => "#in_memory_compaction_limit_in_mb:",
match => "^in_memory_compaction_limit_in_mb:.*",
} ->
file_line { 'Config File Remove 9':
path => $cassandra_config_file,
line => "#compaction_preheat_key_cache",
match => "^compaction_preheat_key_cache.*",
} ->
file_line { 'Config File Remove 10':
path => $cassandra_config_file,
line => "#preheat_kernel_page_cache",
match => "^preheat_kernel_page_cache.*",
} ->
file_line { 'ENV Cassandra file setting':
path => $cassandra_env_file,
line => 'JVM_OPTS="$JVM_OPTS -Xss512k"',
match => "JVM_OPTS=\"\$JVM_OPTS -Xss.*\"",
}
-> file_line { 'ENV Cassandra jmm setting':
path => $cassandra_env_file,
line => 'JVM_OPTS="$JVM_OPTS -javaagent:$CASSANDRA_HOME/lib/jamm-0.3.0.jar"',
match => "JVM_OPTS=\"\$JVM_OPTS -javaagent:.*\"",
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@
$contrail_logoutput = $::contrail::params::contrail_logoutput,
$host_ip = $::contrail::params::host_ip,
$database_dir = $::contrail::params::database_dir,
$contrail_package_name = $::contrail::params::contrail_repo_name,
) {
if ($lsbdistrelease == "14.04") {
package { 'default-jre-headless' :
ensure => latest,
before => Package['contrail-openstack-database']
}
}
$cassandra_upgrade_cmd = "/bin/bash /etc/contrail/contrail_setup_utils/upgrade_cassandra.sh ${host_ip} ${database_dir}"
$cassandra_upgrade_cmd = "/bin/bash /etc/contrail/contrail_setup_utils/upgrade_cassandra.sh ${host_ip} ${database_dir} ${contrail_package_name[0]}"
file { '/etc/contrail/contrail_setup_utils/upgrade_cassandra.sh':
ensure => present,
mode => '0755',
Expand All @@ -29,4 +30,4 @@
package { 'contrail-openstack-database' :
ensure => latest
}
}
}

0 comments on commit 92801e9

Please sign in to comment.