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