From 6160264a0bd6d01552e120d2ea9dc11629fe4088 Mon Sep 17 00:00:00 2001 From: Michael Polenchuk Date: Fri, 28 Sep 2018 16:02:30 +0400 Subject: [ha] Run OpenDaylight in cluster mode Change-Id: Id75fbee34a6cfc6e7fc60df053cccaaff21cb15a Signed-off-by: Michael Polenchuk --- .../metadata/service/server/cluster.yml | 41 ++++++++++++++++++++++ .../opendaylight/map.jinja | 5 ++- .../opendaylight/server.sls | 8 +++++ 3 files changed, 51 insertions(+), 3 deletions(-) create mode 100644 mcp/salt-formulas/salt-formula-opendaylight/metadata/service/server/cluster.yml (limited to 'mcp/salt-formulas/salt-formula-opendaylight') diff --git a/mcp/salt-formulas/salt-formula-opendaylight/metadata/service/server/cluster.yml b/mcp/salt-formulas/salt-formula-opendaylight/metadata/service/server/cluster.yml new file mode 100644 index 000000000..69e1d84fd --- /dev/null +++ b/mcp/salt-formulas/salt-formula-opendaylight/metadata/service/server/cluster.yml @@ -0,0 +1,41 @@ +############################################################################## +# Copyright (c) 2018 Mirantis Inc. and others. +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## +--- +applications: + - opendaylight +classes: + - service.keepalived.cluster.single +parameters: + _param: + opendaylight_version: fluorine + keepalived_vip_virtual_router_id: 199 + keepalived_vip_address: ${_param:opendaylight_service_host} + keepalived_vip_password: ${_param:opnfv_main_password} + keepalived_vip_interface: ${_param:single_nic} + opendaylight: + server: + enabled: 'True' + version: ${_param:opendaylight_version} + repo: 'odl-team/${_param:opendaylight_version}' + cluster_enabled: true + logging: + engine: syslog + keepalived: + cluster: + vrrp_scripts: + check_port: + args: + - ${_param:opendaylight_rest_port} + - TCP + - 4 + interval: 15 + rise: 3 + fall: 1 + instance: + VIP: + track_script: check_port diff --git a/mcp/salt-formulas/salt-formula-opendaylight/opendaylight/map.jinja b/mcp/salt-formulas/salt-formula-opendaylight/opendaylight/map.jinja index 9874f60cf..f8d49643b 100644 --- a/mcp/salt-formulas/salt-formula-opendaylight/opendaylight/map.jinja +++ b/mcp/salt-formulas/salt-formula-opendaylight/opendaylight/map.jinja @@ -13,9 +13,8 @@ 'odl_bind_ip': '0.0.0.0', 'repo': 'odl-team/oxygen', 'log_levels': {}, - 'enable_ha': false, - 'ha_node_ips': [], - 'ha_node_index': 0, + 'cluster_enabled': false, + 'seed_nodes_list': [], 'stats_polling_enabled': false, 'dhcp': { 'enabled': false, diff --git a/mcp/salt-formulas/salt-formula-opendaylight/opendaylight/server.sls b/mcp/salt-formulas/salt-formula-opendaylight/opendaylight/server.sls index 1ae23d61a..e4ebecf87 100644 --- a/mcp/salt-formulas/salt-formula-opendaylight/opendaylight/server.sls +++ b/mcp/salt-formulas/salt-formula-opendaylight/opendaylight/server.sls @@ -69,6 +69,14 @@ opendaylight_service_mask: - prereq: - pkg: opendaylight +{%- if server.cluster_enabled %} +configure_cluster: + cmd.run: + - name: /opt/opendaylight/bin/configure-cluster-ipdetect.sh {{ server.seed_nodes_list }} + - require: + - pkg: opendaylight +{%- endif %} + opendaylight: pkg.installed: - require: -- cgit 1.2.3-korg