seesaw 0.2.3 → 0.2.4
Sign up to get free protection for your applications and to get access to all the features.
- data/README.txt +67 -5
- data/lib/seesaw/init.rb +2 -2
- metadata +1 -1
data/README.txt
CHANGED
@@ -12,7 +12,7 @@ Let's say you have a mongrel cluster setup with 7 individual mongrels on your se
|
|
12
12
|
|
13
13
|
When you execute:
|
14
14
|
|
15
|
-
mongrel_rails seesaw::ripple
|
15
|
+
mongrel_rails seesaw::ripple
|
16
16
|
|
17
17
|
This will happen:
|
18
18
|
|
@@ -45,15 +45,23 @@ Halfway through the process, your site is only running on half of the mongrels,
|
|
45
45
|
|
46
46
|
== INSTALL:
|
47
47
|
|
48
|
-
sudo gem install seesaw
|
48
|
+
sudo gem install seesaw
|
49
49
|
|
50
50
|
== CONFIGURATION
|
51
51
|
|
52
|
-
|
52
|
+
Generate an initial configuration with
|
53
53
|
|
54
|
-
|
54
|
+
mongrel_rails seesaw::configure
|
55
55
|
|
56
|
-
|
56
|
+
This will generate the webserver includes in config/http_cluster. You should move them out of the Rails project and into a well-known location.
|
57
|
+
|
58
|
+
*IMPORTANT*: the configuration files and the symlink are owned by the user excecuting the seesaw command. You can change the ownership, but you may need to change the symlink_cmd ocnfiguration parameter to use sudo.
|
59
|
+
|
60
|
+
Now change your webserver configuration as outlined below, and you're ready to go.
|
61
|
+
|
62
|
+
=== seesaw.yml
|
63
|
+
|
64
|
+
The seesaw configuration looks like this (example for nginx):
|
57
65
|
|
58
66
|
---
|
59
67
|
restart_cmd: sudo kill -HUP `cat /opt/local/nginx/logs/nginx.pid`
|
@@ -66,8 +74,62 @@ config_files:
|
|
66
74
|
2: cluster_2.conf
|
67
75
|
symlink_cmd: ln -sf
|
68
76
|
|
77
|
+
In order to switch between cluster halves seamlessly, seesaw symlinks one of three different configuration files. The symlink must be references by the webserver configuration, see webserver-specific documentation below.
|
78
|
+
|
79
|
+
* config_path
|
80
|
+
The full path to the directory where the webserver configuration files live. More on that follows.
|
81
|
+
|
82
|
+
* config_symlink
|
83
|
+
The name of the symlink that points to one of the three cluster configurations. Defaults to cluster.conf. This needs to be included by the webserver configuration.
|
84
|
+
|
85
|
+
* config_files
|
86
|
+
* all
|
87
|
+
the name of the configuration fragment containing the full cluster setup
|
88
|
+
* 1
|
89
|
+
the name of the configuration fragment containing the front half of the cluster
|
90
|
+
* 2
|
91
|
+
the name of the configuration fragment containing the back half of the cluster
|
92
|
+
|
93
|
+
Other options:
|
94
|
+
|
95
|
+
* mongrel_config_file
|
96
|
+
the location of the mongrel_cluster configuration file (config/mongrel_cluster.yml by default)
|
97
|
+
|
98
|
+
* restart_cmd
|
99
|
+
the command to execute to grecefully restart the webserver. You will need to adjust this according to your filesystem layout. The defaults are:
|
100
|
+
* nginx: sudo kill -HUP `cat /opt/local/nginx/logs/nginx.pid`
|
101
|
+
* apache: sudo apachectl graceful
|
102
|
+
For nginx, adjust the path to the nginx.pid file to match your setup. You can adjust the location of the pid file in you nginx configuration.
|
103
|
+
|
104
|
+
=== Nginx
|
105
|
+
|
106
|
+
To include the seesaw-managed symlink pointing to the current cluster configuration, use something like this (mongrel_pack is the default name of the mongrel cluster generated by seesaw. Change in the three cluster configurations and the webserver config):
|
107
|
+
|
108
|
+
http {
|
109
|
+
...
|
110
|
+
include /full/path/to/generated/files/http_cluster/cluster.conf;
|
111
|
+
server {
|
112
|
+
...
|
113
|
+
location / {
|
114
|
+
#root share/nginx/html;
|
115
|
+
proxy_pass http://mongrel_pack;
|
116
|
+
}
|
117
|
+
...
|
118
|
+
}
|
119
|
+
}
|
120
|
+
|
69
121
|
=== Apache
|
70
122
|
|
123
|
+
Simply add
|
124
|
+
|
125
|
+
Include "/full/path/to/generated/files/http_cluster/cluster.conf"
|
126
|
+
|
127
|
+
where you would normally have your <Proxy balancer> section.
|
128
|
+
|
129
|
+
If you have any rewrite rules referencing the cluster name, change it accordingly:
|
130
|
+
|
131
|
+
RewriteRule ^/(.*)$ balancer://mongrel_pack%{REQUEST_URI} [P,QSA,L]
|
132
|
+
|
71
133
|
== LICENSE:
|
72
134
|
|
73
135
|
(The MIT License)
|
data/lib/seesaw/init.rb
CHANGED
@@ -6,7 +6,7 @@ require 'seesaw/mongrel_cluster_patch'
|
|
6
6
|
require "erb"
|
7
7
|
|
8
8
|
module Seesaw
|
9
|
-
VERSION = '0.2.
|
9
|
+
VERSION = '0.2.4'
|
10
10
|
|
11
11
|
module CommandBase
|
12
12
|
|
@@ -217,7 +217,7 @@ module Seesaw
|
|
217
217
|
write_config_include(File.join(@http_config_path,@options["config_files"][2]), (mid_port..end_port))
|
218
218
|
|
219
219
|
# symlink
|
220
|
-
system("#{@options["symlink_cmd"]} #{
|
220
|
+
system("#{@options["symlink_cmd"]} #{@options["config_files"]["all"]} #{File.join(@http_config_path,@options["config_symlink"])}")
|
221
221
|
|
222
222
|
log "Don't forget to include #{File.expand_path("#{@http_config_path}/cluster.conf")} in your webserver configuration."
|
223
223
|
end
|