remove the code which configures the reserved VIP in the pacemaker
run zabbix-server process in the haproxy namespace Change-Id: Ifaf2b91b67e7d5bc86868049b22f9b3346f6d6d5
This commit is contained in:
parent
0e6883c58c
commit
9569aa748c
|
@ -30,6 +30,7 @@
|
|||
# OCF_RESKEY_user
|
||||
# OCF_RESKEY_pid
|
||||
# OCF_RESKEY_additional_parameters
|
||||
# OCF_RESKEY_namespace
|
||||
#######################################################################
|
||||
# Initialization:
|
||||
|
||||
|
@ -44,9 +45,11 @@ SERVICE_NAME="Zabbix-server"
|
|||
|
||||
OCF_RESKEY_binary_default="/usr/sbin/zabbix_server"
|
||||
OCF_RESKEY_pid_default="/var/run/zabbix/zabbix_server.pid"
|
||||
OCF_RESKEY_namespace_default="haproxy"
|
||||
|
||||
: ${OCF_RESKEY_binary=${OCF_RESKEY_binary_default}}
|
||||
: ${OCF_RESKEY_pid=${OCF_RESKEY_pid_default}}
|
||||
: ${OCF_RESKEY_namespace=${OCF_RESKEY_namespace}}
|
||||
|
||||
#######################################################################
|
||||
|
||||
|
@ -95,6 +98,14 @@ The pid file to use for this process
|
|||
<content type="string" default="${OCF_RESKEY_pid_default}" />
|
||||
</parameter>
|
||||
|
||||
<parameter name="namespace" unique="0" required="0">
|
||||
<longdesc lang="en">
|
||||
The namespace in which this process should be run
|
||||
</longdesc>
|
||||
<shortdesc lang="en">zabbix-server namespace</shortdesc>
|
||||
<content type="string" default="${OCF_RESKEY_namespace_default}" />
|
||||
</parameter>
|
||||
|
||||
</parameters>
|
||||
|
||||
<actions>
|
||||
|
@ -165,7 +176,7 @@ service_start() {
|
|||
return $OCF_SUCCESS
|
||||
fi
|
||||
|
||||
${OCF_RESKEY_binary}
|
||||
ip netns exec ${OCF_RESKEY_namespace} ${OCF_RESKEY_binary}
|
||||
|
||||
# Spin waiting for the server to come up.
|
||||
# Let the CRM/LRM time us out if required
|
||||
|
|
|
@ -72,14 +72,7 @@ class plugin_zabbix::controller {
|
|||
enable => true,
|
||||
provider => 'pacemaker',
|
||||
}
|
||||
service { "vip__${plugin_zabbix::params::server_service}-started":
|
||||
ensure => running,
|
||||
name => "vip__${plugin_zabbix::params::server_service}",
|
||||
enable => true,
|
||||
provider => 'pacemaker',
|
||||
}
|
||||
|
||||
Service["vip__${plugin_zabbix::params::server_service}-started"] -> Service["${plugin_zabbix::params::server_service}-started"]
|
||||
File['zabbix-server-ocf'] -> Service["${plugin_zabbix::params::server_service}-init-stopped"] -> Service["${plugin_zabbix::params::server_service}-started"]
|
||||
|
||||
cron { 'zabbix db_clean':
|
||||
|
|
|
@ -82,7 +82,8 @@ class plugin_zabbix::params {
|
|||
$has_userparameters = true
|
||||
|
||||
#server parameters
|
||||
$server_ip = $network_metadata['vips']['zabbix_vip_management']['ipaddr']
|
||||
$vip_name = 'zabbix_vip_management'
|
||||
$server_ip = $network_metadata['vips'][$vip_name]['ipaddr']
|
||||
$server_config = '/etc/zabbix/zabbix_server.conf'
|
||||
$server_scripts = '/etc/zabbix/externalscripts'
|
||||
$server_config_template = 'plugin_zabbix/zabbix_server.conf.erb'
|
||||
|
|
|
@ -24,26 +24,6 @@ class plugin_zabbix::primary_controller {
|
|||
before => [ Class['plugin_zabbix::frontend'], Cs_resource["p_${plugin_zabbix::params::server_service}"] ],
|
||||
}
|
||||
|
||||
cs_resource { "vip__${plugin_zabbix::params::server_service}":
|
||||
before => Cs_group["group__${plugin_zabbix::params::server_service}"],
|
||||
primitive_class => 'ocf',
|
||||
provided_by => 'heartbeat',
|
||||
primitive_type => 'IPaddr2',
|
||||
operations => {
|
||||
'monitor' => { 'interval' => '3', 'timeout' => '30' },
|
||||
'start' => { 'interval' => '0', 'timeout' => '30' },
|
||||
'stop' => { 'interval' => '0', 'timeout' => '30' },
|
||||
},
|
||||
metadata => {
|
||||
'migration-threshold' => '3',
|
||||
'failure-timeout' => '60',
|
||||
'resource-stickiness' => '1',
|
||||
},
|
||||
parameters => {
|
||||
'ip' => $plugin_zabbix::params::server_ip,
|
||||
},
|
||||
}
|
||||
|
||||
cs_resource { "p_${plugin_zabbix::params::server_service}":
|
||||
before => Cs_group["group__${plugin_zabbix::params::server_service}"],
|
||||
primitive_class => 'ocf',
|
||||
|
@ -60,12 +40,11 @@ class plugin_zabbix::primary_controller {
|
|||
}
|
||||
|
||||
cs_group { "group__${plugin_zabbix::params::server_service}":
|
||||
primitives => ["vip__${plugin_zabbix::params::server_service}", "p_${plugin_zabbix::params::server_service}"],
|
||||
primitives => ["vip__${plugin_zabbix::params::vip_name}", "p_${plugin_zabbix::params::server_service}"],
|
||||
}
|
||||
|
||||
File[$plugin_zabbix::params::server_config] -> File['zabbix-server-ocf'] -> Cs_resource["p_${plugin_zabbix::params::server_service}"]
|
||||
Service["${plugin_zabbix::params::server_service}-init-stopped"] -> Cs_resource["p_${plugin_zabbix::params::server_service}"]
|
||||
Cs_group["group__${plugin_zabbix::params::server_service}"] -> Service["${plugin_zabbix::params::server_service}-started"]
|
||||
Cs_resource["vip__${plugin_zabbix::params::server_service}"] -> Cs_resource["p_${plugin_zabbix::params::server_service}"]
|
||||
|
||||
}
|
||||
|
|
|
@ -5,3 +5,4 @@
|
|||
gateway: false
|
||||
vip:
|
||||
- name: "zabbix_vip_management"
|
||||
namespace: "haproxy"
|
||||
|
|
Loading…
Reference in New Issue