Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
slapos
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Thomas Leymonerie
slapos
Commits
fea0be72
Commit
fea0be72
authored
Dec 27, 2011
by
Romain Courteaud
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/master' into CR1094
parents
e666488e
4dad6d08
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
6 deletions
+26
-6
slapos/recipe/erp5/__init__.py
slapos/recipe/erp5/__init__.py
+12
-2
slapos/recipe/erp5/template/haproxy.cfg.in
slapos/recipe/erp5/template/haproxy.cfg.in
+13
-4
slapos/recipe/erp5/template/logrotate_entry.in
slapos/recipe/erp5/template/logrotate_entry.in
+1
-0
No files found.
slapos/recipe/erp5/__init__.py
View file @
fea0be72
...
...
@@ -426,14 +426,24 @@ class Recipe(BaseSlapRecipe):
}
def
installHaproxy
(
self
,
ip
,
port
,
name
,
server_check_path
,
url_list
):
server_template
=
""" server %(name)s %(address)s cookie %(name)s check inter 3s rise 2 fall 4"""
# inter must be quite short in order to detect quickly an unresponsive node
# and to detect quickly a node which is back
# rise must be minimal possible : 1, indeed, a node which is back don't need
# to sleep more time and we can give him work immediately
# fall should be quite sort. with inter at 3, and fall at 2, a node will be
# considered as dead after 6 seconds.
# maxconn should be set as the maximum thread we have per zope, like this
# haproxy will manage the queue of request with the possibility to
# move a request to another node if the initially selected one is dead
server_template
=
""" server %(name)s %(address)s cookie %(name)s check inter 3s rise 1 fall 2 maxconn %(cluster_zope_thread_amount)s"""
config
=
dict
(
name
=
name
,
ip
=
ip
,
port
=
port
,
server_check_path
=
server_check_path
,)
i
=
1
server_list
=
[]
cluster_zope_thread_amount
=
self
.
options
.
get
(
'cluster_zope_thread_amount'
,
1
)
for
url
in
url_list
:
server_list
.
append
(
server_template
%
dict
(
name
=
'%s_%s'
%
(
name
,
i
),
address
=
url
))
address
=
url
,
cluster_zope_thread_amount
=
cluster_zope_thread_amount
))
i
+=
1
config
[
'server_text'
]
=
'
\
n
'
.
join
(
server_list
)
haproxy_conf_path
=
self
.
createConfigurationFile
(
'haproxy_%s.cfg'
%
name
,
...
...
slapos/recipe/erp5/template/haproxy.cfg.in
View file @
fea0be72
...
...
@@ -9,10 +9,19 @@ defaults
retries 1
option redispatch
maxconn 2000
timeout server 3000s
timeout queue 5s
timeout connect 10s
timeout client 3600s
# it is useless to have timeout much bigger than the one of apache.
# By default apache use 300s, so we set slightly more in order to
# make sure that apache will first stop the connection.
timeout server 305s
# Stop waiting in queue for a zope to become available.
# If no zope can be reached after one minute, consider the request will
# never succeed.
timeout queue 60s
# The connection should be immediate on LAN,
# so we should not set more than 5 seconds, and it could be already too much
timeout connect 5s
# As requested in haproxy doc, make this "at least equal to timeout server".
timeout client 305s
listen %(name)s %(ip)s:%(port)s
cookie SERVERID insert
...
...
slapos/recipe/erp5/template/logrotate_entry.in
View file @
fea0be72
%(file_list)s {
daily
dateext
rotate 3650
compress
notifempty
sharedscripts
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment