Problem description:
To multi nodes cluster, one node down, all other nodes'
analytics_api/alarmgen state is initing but no active
Solution:
Currently we use redis to get both redis state and collecor state.
We need seperate them.
The solution is add collector to zookeeper, analytics_api/alarmgen
to get collector state with zookeeper, and use redis ping to monitor
redis state.
The znode is like
/analytics-discovery-/Collector/{collector_ip1}
/analytics-discovery-/Collector/{collector_ip2}
......
/analytics-discovery-/Collector is PERSISTENT znode, {collector_ip1}
is EPHEMERAL znode, and znode value is
{"hostname": hostname,
"instance_id": process_id,
"ip_address": collector ip,
"module_id":"contrail-collector",
"type_name":"Analytics"}
This is second commit to implment in contrail-analytics
Test case:
3 nodes cluster: n1, n2, n3 run contrail-analytics
(1) n1 stop redis-server:
result: all analytics-api/alarm-gen in initializing state,
n1 collector in initializing state
(2) n1 stop collector:
result: n1 analytics-api/alarm-gen in initializing state
all other nodes analytics-api/alarm-gen is active
(3) n1 start redis-server:
result: all analytics-api/alarm-gen in active state
(4) n1 start collector:
result: all analytics-api/alarm-gen in active state
(5) shudown n1:
result: all other analytics-api/alarm-gen in active state
Pending issue 1:
when alarmgen state changed from active to init, will not update
AlarmgenPartition UVE. It will be fixed seperately.(Bug #1794632)
Peding issue 2:
Shutdown one server lead kafka lib callback to down other server's
alarmgen. (Bug #1794904)
Reviewed: https:/ /review. opencontrail. org/44483 github. com/Juniper/ contrail- analytics/ commit/ fc282fce06a322c a7b831be051afa6 0664470017
Committed: http://
Submitter: Zuul v3 CI (<email address hidden>)
Branch: master
commit fc282fce06a322c a7b831be051afa6 0664470017
Author: zcui <email address hidden>
Date: Wed Jul 4 21:44:48 2018 -0700
Add contrail-collector to zookeeper
Problem description: api/alarmgen state is initing but no active
To multi nodes cluster, one node down, all other nodes'
analytics_
Solution: api/alarmgen discovery- /Collector/ {collector_ ip1} discovery- /Collector/ {collector_ ip2} discovery- /Collector is PERSISTENT znode, {collector_ip1} id":"contrail- collector" , :"Analytics" }
Currently we use redis to get both redis state and collecor state.
We need seperate them.
The solution is add collector to zookeeper, analytics_
to get collector state with zookeeper, and use redis ping to monitor
redis state.
The znode is like
/analytics-
/analytics-
......
/analytics-
is EPHEMERAL znode, and znode value is
{"hostname": hostname,
"instance_id": process_id,
"ip_address": collector ip,
"module_
"type_name"
This is second commit to implment in contrail-analytics
Test case: api/alarm- gen in initializing state, api/alarm- gen in initializing state api/alarm- gen is active api/alarm- gen in active state api/alarm- gen in active state api/alarm- gen in active state
3 nodes cluster: n1, n2, n3 run contrail-analytics
(1) n1 stop redis-server:
result: all analytics-
n1 collector in initializing state
(2) n1 stop collector:
result: n1 analytics-
all other nodes analytics-
(3) n1 start redis-server:
result: all analytics-
(4) n1 start collector:
result: all analytics-
(5) shudown n1:
result: all other analytics-
Pending issue 1:
when alarmgen state changed from active to init, will not update
AlarmgenPartition UVE. It will be fixed seperately.(Bug #1794632)
Peding issue 2:
Shutdown one server lead kafka lib callback to down other server's
alarmgen. (Bug #1794904)
Closes-bug: 1733027
Conflicts: collector/ main.cc collector/ viz_collector. cc collector/ viz_collector. h
contrail-
contrail-
contrail-
Change-Id: I46c97553b303cd aa85ac3cac06587 690a3771e44