Commit d8ccc6fd authored by Julien Muchembled's avatar Julien Muchembled

NEO: change default ports of admin & master nodes + option to change or disable

parent d35284d8
...@@ -34,8 +34,9 @@ This software release assigns the following port ranges by default: ...@@ -34,8 +34,9 @@ This software release assigns the following port ranges by default:
memcached-volatile 2010-2019 memcached-volatile 2010-2019
cloudooo 2020-2024 cloudooo 2020-2024
smtp 2025-2029 smtp 2025-2029
neo (admin & master) 2050-2051
mariadb 2099 mariadb 2099
zodb 2100-2149 zeo 2100-2149
balancer 2150-2199 balancer 2150-2199
zope 2200-* zope 2200-*
==================== ========== ==================== ==========
......
...@@ -41,6 +41,16 @@ ...@@ -41,6 +41,16 @@
"description": "Dictionary containing parameters required to configure individual nodes.", "description": "Dictionary containing parameters required to configure individual nodes.",
"default": {}, "default": {},
"properties": { "properties": {
"admin": {
"description": "Port of admin node. 0 to disable.",
"default": 2050,
"type": "integer"
},
"master": {
"description": "Port of master node. 0 to disable.",
"default": 2051,
"type": "integer"
},
"storage-count": { "storage-count": {
"description": "Number of storage nodes to deploy. One master and one admin node is deployed with each storage.", "description": "Number of storage nodes to deploy. One master and one admin node is deployed with each storage.",
"default": 1, "default": 1,
......
...@@ -30,10 +30,10 @@ context = section parameter_dict my-cnf-parameters ...@@ -30,10 +30,10 @@ context = section parameter_dict my-cnf-parameters
{% set master_list = [] -%} {% set master_list = [] -%}
{% set admin_list = [] -%} {% set admin_list = [] -%}
{% for k, v in slapparameter_dict.iteritems() -%} {% for k, v in slapparameter_dict.iteritems() -%}
{% if k.startswith('master-') -%} {% if k.startswith('master-') and v -%}
{% do master_list.append(v) -%} {% do master_list.append(v) -%}
{% endif -%} {% endif -%}
{% if k.startswith('admin-') -%} {% if k.startswith('admin-') and v -%}
{% do admin_list.append(v) -%} {% do admin_list.append(v) -%}
{% endif -%} {% endif -%}
{% endfor -%} {% endfor -%}
...@@ -42,10 +42,20 @@ context = section parameter_dict my-cnf-parameters ...@@ -42,10 +42,20 @@ context = section parameter_dict my-cnf-parameters
recipe = slapos.cookbook:publish.serialised recipe = slapos.cookbook:publish.serialised
# TODO: make port a partition parameter # TODO: make port a partition parameter
ip = {{ (ipv4_set | list)[0] }} ip = {{ (ipv4_set | list)[0] }}
port-master = 10000 {% set admin = slapparameter_dict.get('admin', 2050) -%}
port-admin = 10002 {% set master = slapparameter_dict.get('master', 2051) -%}
{% if master -%}
port-master = {{ master }}
master = ${:ip}:${:port-master} master = ${:ip}:${:port-master}
{% else -%}
master =
{% endif -%}
{% if admin -%}
port-admin = {{ admin }}
admin = ${:ip}:${:port-admin} admin = ${:ip}:${:port-admin}
{% else -%}
admin =
{% endif -%}
masters = {{ ' '.join(sorted(master_list)) }} masters = {{ ' '.join(sorted(master_list)) }}
{%- if admin_list %} {%- if admin_list %}
admins = {{ ' '.join(sorted(admin_list)) }} admins = {{ ' '.join(sorted(admin_list)) }}
...@@ -111,8 +121,12 @@ post = ${mysqld:mysql-base-directory}/bin/mysql --defaults-file="${my-cnf:render ...@@ -111,8 +121,12 @@ post = ${mysqld:mysql-base-directory}/bin/mysql --defaults-file="${my-cnf:render
[buildout] [buildout]
extends = extends =
{{ logrotate_cfg }} {{ logrotate_cfg }}
{%- if master %}
{{ master_cfg }} {{ master_cfg }}
{%- endif %}
{%- if admin %}
{{ admin_cfg }} {{ admin_cfg }}
{%- endif %}
parts += parts +=
{{ '\n '.join(part_list) }} {{ '\n '.join(part_list) }}
logrotate-mysql logrotate-mysql
...@@ -86,7 +86,7 @@ md5sum = 9563ce56676bf9ae5e77fe12e9020289 ...@@ -86,7 +86,7 @@ md5sum = 9563ce56676bf9ae5e77fe12e9020289
[instance-neo-storage-mysql] [instance-neo-storage-mysql]
<= download-base-neo <= download-base-neo
md5sum = 51ad624103bb6d1d5a0b7159e7add4fa md5sum = 5a61039c7a980e24519e1bbb1252e662
[template-neo-my-cnf] [template-neo-my-cnf]
<= download-base-neo <= download-base-neo
......
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