VR optimalization for riak cluster

Only one haproxy_riak_config_http and one  haproxy_riak_config_pb is required.
This commit is contained in:
Łukasz Oleś 2015-09-26 17:59:52 +02:00
parent 990e17252a
commit c8309335a8

View File

@ -37,14 +37,12 @@ resources:
{% endfor %} {% endfor %}
{% endfor %} {% endfor %}
{% for i in range(idx|int) %} - id: haproxy_riak_config_http
- id: haproxy_service_config_http{{i}}
from: resources/haproxy_service_config from: resources/haproxy_service_config
location: {{nodes[i]}}
values: values:
listen_port: 8098 listen_port: 8098
protocol: 'http' protocol: 'http'
name: 'riak_haproxy_http{{i}}' name: 'riak_haproxy_http'
backends:server: backends:server:
{% for j in range(idx|int) %} {% for j in range(idx|int) %}
- riak_service{{j}}::riak_hostname - riak_service{{j}}::riak_hostname
@ -53,16 +51,13 @@ resources:
{% for j in range(idx|int) %} {% for j in range(idx|int) %}
- riak_service{{j}}::riak_port_http - riak_service{{j}}::riak_port_http
{% endfor %} {% endfor %}
{% endfor %}
{% for i in range(idx|int) %} - id: haproxy_riak_config_pb
- id: haproxy_service_config_pb{{i}}
from: resources/haproxy_service_config from: resources/haproxy_service_config
location: {{nodes[i]}}
values: values:
listen_port: 8087 listen_port: 8087
protocol: 'tcp' protocol: 'tcp'
name: 'riak_haproxy_pb{{i}}' name: 'riak_haproxy_pb'
backends:server: backends:server:
{% for j in range(idx|int) %} {% for j in range(idx|int) %}
- riak_service{{j}}::riak_hostname - riak_service{{j}}::riak_hostname
@ -71,7 +66,6 @@ resources:
{% for j in range(idx|int) %} {% for j in range(idx|int) %}
- riak_service{{j}}::riak_port_pb - riak_service{{j}}::riak_port_pb
{% endfor %} {% endfor %}
{% endfor %}
{% for i in range(idx|int) %} {% for i in range(idx|int) %}
- id: haproxy_config{{i}} - id: haproxy_config{{i}}
@ -79,17 +73,17 @@ resources:
location: {{nodes[i]}} location: {{nodes[i]}}
values: values:
config:protocol: config:protocol:
- haproxy_service_config_http{{i}}::protocol - haproxy_riak_config_http::protocol
- haproxy_service_config_pb{{i}}::protocol - haproxy_riak_config_pb::protocol
config:listen_port: config:listen_port:
- haproxy_service_config_http{{i}}::listen_port - haproxy_riak_config_http::listen_port
- haproxy_service_config_pb{{i}}::listen_port - haproxy_riak_config_pb::listen_port
config:name: config:name:
- haproxy_service_config_http{{i}}::name - haproxy_riak_config_http::name
- haproxy_service_config_pb{{i}}::name - haproxy_riak_config_pb::name
config:backends: config:backends:
- haproxy_service_config_http{{i}}::backends - haproxy_riak_config_http::backends
- haproxy_service_config_pb{{i}}::backends - haproxy_riak_config_pb::backends
ip: '{{nodes[i]}}::ip' ip: '{{nodes[i]}}::ip'
{% endfor %} {% endfor %}