Switch default transport to unicast
Unicast is generally alot more reliable and is guaranteed to work in all network configurations unlike multicast. Optimize context build for unicast configuration - its possible to build the corosync cluster prior to the principle charm presenting multicast only configuration options. Change-Id: I7c4f559325234401a7b6f7aa26114349d07817ad
This commit is contained in:
parent
f313da0507
commit
2edb98b7df
18
config.yaml
18
config.yaml
@ -15,25 +15,32 @@ options:
|
|||||||
order for this charm to function correctly, the privacy extension must be
|
order for this charm to function correctly, the privacy extension must be
|
||||||
disabled and a non-temporary address must be configured/available on
|
disabled and a non-temporary address must be configured/available on
|
||||||
your network interface.
|
your network interface.
|
||||||
|
corosync_transport:
|
||||||
|
type: string
|
||||||
|
default: "unicast"
|
||||||
|
description: |
|
||||||
|
Two supported modes are multicast (udp) or unicast (udpu)
|
||||||
corosync_mcastaddr:
|
corosync_mcastaddr:
|
||||||
type: string
|
type: string
|
||||||
default: 226.94.1.1
|
default: 226.94.1.1
|
||||||
description: |
|
description: |
|
||||||
Multicast IP address to use for exchanging messages over the network.
|
Multicast IP address to use for exchanging messages over the network.
|
||||||
If multiple clusters are on the same bindnetaddr network, this value
|
If multiple clusters are on the same bindnetaddr network, this value
|
||||||
can be changed.
|
can be changed. Only used when corosync_transport = multicast.
|
||||||
corosync_bindiface:
|
corosync_bindiface:
|
||||||
type: string
|
type: string
|
||||||
default:
|
default:
|
||||||
description: |
|
description: |
|
||||||
Default network interface on which HA cluster will bind to communication
|
Default network interface on which HA cluster will bind to communication
|
||||||
with the other members of the HA Cluster.
|
with the other members of the HA Cluster. Defaults to the network
|
||||||
|
interface hosting the units private-address. Only used when
|
||||||
|
corosync_transport = multicast.
|
||||||
corosync_mcastport:
|
corosync_mcastport:
|
||||||
type: int
|
type: int
|
||||||
default:
|
default:
|
||||||
description: |
|
description: |
|
||||||
Default multicast port number that will be used to communicate between
|
Default multicast port number that will be used to communicate between
|
||||||
HA Cluster nodes.
|
HA Cluster nodes. Only used when corosync_transport = multicast.
|
||||||
corosync_key:
|
corosync_key:
|
||||||
type: string
|
type: string
|
||||||
default: "64RxJNcCkwo8EJYBsaacitUvbQp5AW4YolJi5/2urYZYp2jfLxY+3IUCOaAUJHPle4Yqfy+WBXO0I/6ASSAjj9jaiHVNaxmVhhjcmyBqy2vtPf+m+0VxVjUXlkTyYsODwobeDdO3SIkbIABGfjLTu29yqPTsfbvSYr6skRb9ne0="
|
default: "64RxJNcCkwo8EJYBsaacitUvbQp5AW4YolJi5/2urYZYp2jfLxY+3IUCOaAUJHPle4Yqfy+WBXO0I/6ASSAjj9jaiHVNaxmVhhjcmyBqy2vtPf+m+0VxVjUXlkTyYsODwobeDdO3SIkbIABGfjLTu29yqPTsfbvSYr6skRb9ne0="
|
||||||
@ -104,11 +111,6 @@ options:
|
|||||||
Specifies the corosync.conf network mtu. If unset, the default
|
Specifies the corosync.conf network mtu. If unset, the default
|
||||||
corosync.conf value is used (currently 1500). See 'man corosync.conf' for
|
corosync.conf value is used (currently 1500). See 'man corosync.conf' for
|
||||||
detailed information on this config option.
|
detailed information on this config option.
|
||||||
corosync_transport:
|
|
||||||
type: string
|
|
||||||
default: "multicast"
|
|
||||||
description: |
|
|
||||||
Two supported modes are multicast (udp) or unicast (udpu)
|
|
||||||
nagios_context:
|
nagios_context:
|
||||||
default: "juju"
|
default: "juju"
|
||||||
type: string
|
type: string
|
||||||
|
@ -212,18 +212,25 @@ def get_corosync_conf():
|
|||||||
ip_version = 'ipv4'
|
ip_version = 'ipv4'
|
||||||
bindnetaddr = get_network_address
|
bindnetaddr = get_network_address
|
||||||
|
|
||||||
|
transport = get_transport()
|
||||||
|
|
||||||
# NOTE(jamespage) use local charm configuration over any provided by
|
# NOTE(jamespage) use local charm configuration over any provided by
|
||||||
# principle charm
|
# principle charm
|
||||||
conf = {
|
conf = {
|
||||||
'corosync_bindnetaddr':
|
|
||||||
bindnetaddr(config('corosync_bindiface')),
|
|
||||||
'corosync_mcastport': config('corosync_mcastport'),
|
|
||||||
'corosync_mcastaddr': config('corosync_mcastaddr'),
|
|
||||||
'ip_version': ip_version,
|
'ip_version': ip_version,
|
||||||
'ha_nodes': get_ha_nodes(),
|
'ha_nodes': get_ha_nodes(),
|
||||||
'transport': get_transport(),
|
'transport': transport,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# NOTE(jamespage): only populate multicast configuration if udp is
|
||||||
|
# configured
|
||||||
|
if transport == 'udp':
|
||||||
|
conf.update({
|
||||||
|
'corosync_bindnetaddr': bindnetaddr(config('corosync_bindiface')),
|
||||||
|
'corosync_mcastport': config('corosync_mcastport'),
|
||||||
|
'corosync_mcastaddr': config('corosync_mcastaddr')
|
||||||
|
})
|
||||||
|
|
||||||
if config('prefer-ipv6'):
|
if config('prefer-ipv6'):
|
||||||
conf['nodeid'] = get_corosync_id(local_unit())
|
conf['nodeid'] = get_corosync_id(local_unit())
|
||||||
|
|
||||||
@ -241,17 +248,23 @@ def get_corosync_conf():
|
|||||||
conf = {}
|
conf = {}
|
||||||
for relid in relation_ids('ha'):
|
for relid in relation_ids('ha'):
|
||||||
for unit in related_units(relid):
|
for unit in related_units(relid):
|
||||||
|
conf = {
|
||||||
|
'ip_version': ip_version,
|
||||||
|
'ha_nodes': get_ha_nodes(),
|
||||||
|
'transport': transport,
|
||||||
|
}
|
||||||
|
|
||||||
|
# NOTE(jamespage): only populate multicast configuration if udpu is
|
||||||
|
# configured
|
||||||
|
if transport == 'udp':
|
||||||
bindiface = relation_get('corosync_bindiface',
|
bindiface = relation_get('corosync_bindiface',
|
||||||
unit, relid)
|
unit, relid)
|
||||||
conf = {
|
conf.update({
|
||||||
'corosync_bindnetaddr': bindnetaddr(bindiface),
|
'corosync_bindnetaddr': bindnetaddr(bindiface),
|
||||||
'corosync_mcastport': relation_get('corosync_mcastport',
|
'corosync_mcastport': relation_get('corosync_mcastport',
|
||||||
unit, relid),
|
unit, relid),
|
||||||
'corosync_mcastaddr': config('corosync_mcastaddr'),
|
'corosync_mcastaddr': config('corosync_mcastaddr'),
|
||||||
'ip_version': ip_version,
|
})
|
||||||
'ha_nodes': get_ha_nodes(),
|
|
||||||
'transport': get_transport(),
|
|
||||||
}
|
|
||||||
|
|
||||||
if config('prefer-ipv6'):
|
if config('prefer-ipv6'):
|
||||||
conf['nodeid'] = get_corosync_id(local_unit())
|
conf['nodeid'] = get_corosync_id(local_unit())
|
||||||
|
Loading…
Reference in New Issue
Block a user