diff --git a/README.md b/README.md index 61afdeea0..69953d9b3 100644 --- a/README.md +++ b/README.md @@ -234,20 +234,14 @@ the host can provide but will usually be much more slower than a production envi yarn install ``` -7. Set a directory for Sidekick pids: - - ```bash - mkdir -p tmp/pids - ``` - -8. Copy the default configuration files: +7. Copy the default configuration files: ```bash cp config/database.yml.virtual config/database.yml cp config/application.yml.default config/application.yml ``` -10. Set up the databases. (Note that you should provide the desired admin credentials and that these +8. Set up the databases. (Note that you should provide the desired admin credentials and that these specific set of commands must be used to set up the database as some raw SQL instructions are included in the migrations. Password minimal length is 8 characters): @@ -262,7 +256,7 @@ the host can provide but will usually be much more slower than a production envi RAILS_ENV=test rake db:migrate ``` -11. Start the application and visit `localhost:3000` on your browser to check that it works: +9. Start the application and visit `localhost:3000` on your browser to check that it works: ```bash foreman s -p 3000 diff --git a/Vagrantfile b/Vagrantfile index fc91b4f5a..7c4c6ca92 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -33,7 +33,7 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| config.vm.provision "shell", privileged: false, run: "once", path: "provision/zsh_setup.sh" - config.vm.provision "shell", privileged: false, run: "once", + config.vm.provision "shell", privileged: true, run: "once", path: "provision/box_setup.zsh", env: { "LC_ALL" => "en_US.UTF-8", diff --git a/provision/box_setup.zsh b/provision/box_setup.zsh index 05d26700e..2abce66b3 100755 --- a/provision/box_setup.zsh +++ b/provision/box_setup.zsh @@ -164,10 +164,15 @@ system_tuning() { echo "Tunning up the system" + # Create pids directory for Sidekick + sudo mkdir -p /vagrant/tmp/pids + + # Enable overcomit memmory for Redis sudo echo -e "\n## Redis tune-up" >> /etc/sysctl.conf sudo echo '# Allow background save on low memory conditions' >> /etc/sysctl.conf sudo echo -e "vm.overcommit_memory = 1\n" >> /etc/sysctl.conf + # Enagle huge pages for Redis sudo touch /etc/rc.local sudo echo '## Redis tune-up' >> /etc/rc.local sudo echo '# Reduce latency and memory usage' >> /etc/rc.local @@ -176,6 +181,7 @@ system_tuning() sudo echo -e "exit 0\n" >> /etc/rc.local sudo chmod +x /etc/rc.local + # Increase virtual memory areas for ElasticSearch sudo echo -e "\n## ElasticSearch tune-up" >> /etc/sysctl.conf sudo echo '# Increase max virtual memory areas' >> /etc/sysctl.conf sudo echo -e "vm.max_map_count = 262144\n" >> /etc/sysctl.conf @@ -200,7 +206,7 @@ setup() { install_yarn install_rvm install_ruby - system_tunning + system_tuning clean_up }