diff --git a/Vagrantfile b/Vagrantfile index c30b1ba3..0678f988 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -71,15 +71,13 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| config.vm.provision :chef_solo do |chef| chef.json = { - mysql: { - server_root_password: 'rootpass', - server_debian_password: 'debpass', - server_repl_password: 'replpass' + cassandra: { + cluster_name: 'vagrant-test' } } chef.run_list = [ - "recipe[cassandra::default]" + "recipe[cassandra-dse::default]" ] end end diff --git a/recipes/datastax.rb b/recipes/datastax.rb index 330fc033..740338c4 100644 --- a/recipes/datastax.rb +++ b/recipes/datastax.rb @@ -90,6 +90,7 @@ options '--force-yes -o Dpkg::Options::="--force-confold"' # giving C* some time to start up notifies :run, 'ruby_block[sleep30s]', :immediately + notifies :run, 'ruby_block[set_fd_limit]', :immediately notifies :run, 'execute[set_cluster_name]', :immediately end @@ -100,6 +101,16 @@ action :nothing end + ruby_block "set_fd_limit" do + block do + file = Chef::Util::FileEdit.new("/etc/init.d/#{node['cassandra']['service_name']}") + file.search_file_replace_line(/^FD_LIMIT=.*$/, "FD_LIMIT=#{node['cassandra']['limits']['nofile']}") + file.write_file + end + notifies :restart, 'service[cassandra]', :delayed + action :nothing + end + execute 'set_cluster_name' do command "/usr/bin/cqlsh -e \"update system.local set cluster_name='#{node['cassandra']['cluster_name']}' where key='local';\"; /usr/bin/nodetool flush;" notifies :restart, 'service[cassandra]', :delayed