Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Properly set FD_LIMIT in sysv init when installing from package #201

Merged
merged 1 commit into from
Jul 27, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
11 changes: 11 additions & 0 deletions recipes/datastax.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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
Expand Down