Commit 3d12927a authored by MAUPETIT Charly's avatar MAUPETIT Charly
Browse files

adding script to managing sidekiq

parent 8e49fc21
GEM
remote: https://rubygems.org/
specs:
actionmailer (4.2.2)
actionpack (= 4.2.2)
actionview (= 4.2.2)
activejob (= 4.2.2)
actionmailer (4.2.3)
actionpack (= 4.2.3)
actionview (= 4.2.3)
activejob (= 4.2.3)
mail (~> 2.5, >= 2.5.4)
rails-dom-testing (~> 1.0, >= 1.0.5)
actionpack (4.2.2)
actionview (= 4.2.2)
activesupport (= 4.2.2)
actionpack (4.2.3)
actionview (= 4.2.3)
activesupport (= 4.2.3)
rack (~> 1.6)
rack-test (~> 0.6.2)
rails-dom-testing (~> 1.0, >= 1.0.5)
rails-html-sanitizer (~> 1.0, >= 1.0.1)
actionview (4.2.2)
activesupport (= 4.2.2)
rails-html-sanitizer (~> 1.0, >= 1.0.2)
actionview (4.2.3)
activesupport (= 4.2.3)
builder (~> 3.1)
erubis (~> 2.7.0)
rails-dom-testing (~> 1.0, >= 1.0.5)
rails-html-sanitizer (~> 1.0, >= 1.0.1)
activejob (4.2.2)
activesupport (= 4.2.2)
rails-html-sanitizer (~> 1.0, >= 1.0.2)
activejob (4.2.3)
activesupport (= 4.2.3)
globalid (>= 0.3.0)
activemodel (4.2.2)
activesupport (= 4.2.2)
activemodel (4.2.3)
activesupport (= 4.2.3)
builder (~> 3.1)
activerecord (4.2.2)
activemodel (= 4.2.2)
activesupport (= 4.2.2)
activerecord (4.2.3)
activemodel (= 4.2.3)
activesupport (= 4.2.3)
arel (~> 6.0)
activesupport (4.2.2)
activesupport (4.2.3)
i18n (~> 0.7)
json (~> 1.7, >= 1.7.7)
minitest (~> 5.1)
......@@ -43,9 +43,9 @@ GEM
execjs
json
bcrypt (3.1.10)
bootstrap-sass (3.3.5)
bootstrap-sass (3.3.5.1)
autoprefixer-rails (>= 5.0.0.1)
sass (>= 3.2.19)
sass (>= 3.3.0)
builder (3.2.2)
capistrano (2.15.5)
highline
......@@ -84,7 +84,7 @@ GEM
gherkin (~> 2.12.0)
d3js-rails (3.1.6)
railties (>= 3.0, < 5.0)
daemons (1.2.2)
daemons (1.2.3)
devise (3.5.1)
bcrypt (~> 3.0)
orm_adapter (~> 0.1)
......@@ -154,16 +154,16 @@ GEM
rack
rack-test (0.6.3)
rack (>= 1.0)
rails (4.2.2)
actionmailer (= 4.2.2)
actionpack (= 4.2.2)
actionview (= 4.2.2)
activejob (= 4.2.2)
activemodel (= 4.2.2)
activerecord (= 4.2.2)
activesupport (= 4.2.2)
rails (4.2.3)
actionmailer (= 4.2.3)
actionpack (= 4.2.3)
actionview (= 4.2.3)
activejob (= 4.2.3)
activemodel (= 4.2.3)
activerecord (= 4.2.3)
activesupport (= 4.2.3)
bundler (>= 1.3.0, < 2.0)
railties (= 4.2.2)
railties (= 4.2.3)
sprockets-rails
rails-deprecated_sanitizer (1.0.3)
activesupport (>= 4.2.0.alpha)
......@@ -173,18 +173,18 @@ GEM
rails-deprecated_sanitizer (>= 1.0.1)
rails-html-sanitizer (1.0.2)
loofah (~> 2.0)
railties (4.2.2)
actionpack (= 4.2.2)
activesupport (= 4.2.2)
railties (4.2.3)
actionpack (= 4.2.3)
activesupport (= 4.2.3)
rake (>= 0.8.7)
thor (>= 0.18.1, < 2.0)
raindrops (0.13.0)
raindrops (0.14.0)
rake (10.4.2)
rb-fsevent (0.9.5)
rb-inotify (0.9.5)
ffi (>= 0.5.0)
rdoc (4.2.0)
redcarpet (3.3.1)
redcarpet (3.3.2)
redis (3.2.1)
redis-namespace (1.5.2)
redis (~> 3.0, >= 3.0.4)
......@@ -206,7 +206,7 @@ GEM
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.3.0)
rspec-support (3.3.0)
sass (3.4.14)
sass (3.4.15)
sass-rails (5.0.3)
railties (>= 4.0.0, < 5.0)
sass (~> 3.1)
......@@ -228,7 +228,7 @@ GEM
tilt (>= 1.3, < 3)
sprockets (3.2.0)
rack (~> 1.0)
sprockets-rails (2.3.1)
sprockets-rails (2.3.2)
actionpack (>= 3.0)
activesupport (>= 3.0)
sprockets (>= 2.8, < 4.0)
......
......@@ -187,3 +187,13 @@ Change the name and then:
```zsh
sudo /etc/init.d/hostname.sh start
```
#To mount datastore :
nfs-kernel on main server (woody)
on node : vim /etc/fstab
add : woody.irisa.fr:/mnt/datastore /mnt/datastore nfs user 0 0
do : mount /mnt/datastore
sudo vim /etc/exports
/mnt/datastore/ worker0.irisa.fr(rw,all_squash,anonuid=1000,anongid=1000,sync)
/mnt/datastore/ worker1.irisa.fr(rw,all_squash,anonuid=1000,anongid=1000,sync)
/mnt/datastore/ sid.irisa.fr(rw,all_squash,anonuid=1000,anongid=1000,sync)
This diff is collapsed.
......@@ -82,7 +82,7 @@ Allgo::Application.configure do
config.assets.paths << Rails.root.join('vendor','assets','fonts')
config.action_mailer.smtp_settings = { :address => "127.0.0.1", :port => 25 }
config.action_mailer.default_url_options = { :host => 'woody.irisa.fr' }
config.datastore = '/home/allgo/datastore/' #relative link
config.datastore = '/mnt/datastore/' #relative link
config.i18n.enforce_available_locales = false #ne génère pas d'erreur si message manquant
config.restrict_email = ['irisa.fr','inria.fr']
......@@ -99,7 +99,7 @@ Allgo::Application.configure do
config.docker_registry = 'cargo.irisa.fr:5000'
config.connect_sandbox = "#{Rails.configuration.connection_prefix}@#{Rails.configuration.sandbox}"
config.connect_worker = "#{Rails.configuration.connection_prefix}@worker0.irisa.fr" #TODO : for Armand
config.url_swarm = "tcp://0.0.0.0:2375"
config.active_record.raise_in_transactional_callbacks = true
# + # Disable serving static files from the `/public` folder by default since
......
......@@ -67,7 +67,7 @@ Vagrant::Config.run(2) do |config|
end
worker.vm.synced_folder "/mnt/datastore/", "/mnt/datastore/"
worker.vm.provision "shell", path: "provisioning/worker.sh"
worker.vm.provision :shell, :inline => "token=$(cat /mnt/datastore/token_id);docker run -d swarm join --addr=192.168.50.1#{i}:2375 token://$token"
worker.vm.provision :shell, :inline => "token=$(cat /mnt/datastore/token_id);docker run -d -name swarm_manager swarm join --addr=192.168.50.1#{i}:2375 token://$token"
end
end
......
......@@ -18,7 +18,7 @@ cat ~/.ssh/id_rsa.pub | ssh 192.168.50.03 "cat - >> ~/.ssh/authorized_keys"
#end
docker run swarm create > /mnt/datastore/token_id
toto=$(cat /mnt/datastore/token_id)
docker run -d -p 2375:2375 swarm manage token://$toto
docker run -d -p 2375:2375 --name swarm_manager swarm manage token://$toto
mkdir /home/vagrant/allgo/
cd /home/vagrant/allgo/
mysql -u root allgo_dev < db/backup/backup_mysql_2015-04-30.sql
......
[Unit]
Description=Swarm cluster master
#Requires=docker.service
After=swarm_manager.service
[Service]
Restart=always
WorkingDirectory=/home/vagrant/allgo/
ExecStart=bundle exec sidekiq -d -L log/sidekiq.log
#ExecStop=/usr/bin/docker stop -t 2 swarm_manager
[Install]
WantedBy=local.target
[Unit]
Description=Swarm cluster master
Requires=docker.service
After=docker.service
[Service]
Restart=always
ExecStart=/usr/bin/docker start -a swarm_manager
ExecStop=/usr/bin/docker stop -t 2 swarm_manager
[Install]
WantedBy=local.target
[Unit]
Description=Swarm node container
Requires=docker.service
After=docker.service
[Service]
Restart=always
ExecStart=/usr/bin/docker start -a swarm_join_cluster
ExecStop=/usr/bin/docker stop -t 2 swarm_join_cluster
[Install]
WantedBy=local.target
#!/bin/bash
/home/allgo/production/shared/bundle/ruby/2.2.0/bin/sidekiq -d -e production -C config/sidekiq.yml -L log/sidekiq.log
#!/bin/bash
pid=$(cat tmp/pids/sidekiq.pid)
kill -9 $pid
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment