Revisão | f55a0c1a5d9ce09594250a24bec6dbb0d55a5e18 (tree) |
---|---|
Hora | 2013-05-14 13:33:15 |
Autor | Hiroaki Nakano <nakano.hiroaki@nttc...> |
Commiter | Hiroaki Nakano |
thread id output to logfile for debug.
@@ -37,34 +37,34 @@ group grpUltraMonkey \ | ||
37 | 37 | ### Primitive Configuration ### |
38 | 38 | primitive prmVIPcheck ocf:heartbeat:VIPcheck \ |
39 | 39 | params \ |
40 | - target_ip="MODIFY_TARGET_VIP" \ | |
40 | + target_ip="" \ | |
41 | 41 | count="1" \ |
42 | 42 | wait="10" \ |
43 | - op start interval="0s" timeout="90s" on-fail="restart" start_delay="4s" | |
43 | + op start interval="0s" timeout="90s" on-fail="restart" start_delay="4s“ | |
44 | 44 | |
45 | -primitive prmVIP ocf:heartbeat:IPaddr2 \ | |
45 | +primitive prmVIP1 ocf:heartbeat:IPaddr2 \ | |
46 | 46 | params \ |
47 | - ip="MODIFY_VIP_IP" \ | |
48 | - nic="MODIFY_VIP_NIC" \ | |
49 | - cidr_netmask="MODIFY_VIP_NETMASK" \ | |
47 | + ip="" \ | |
48 | + nic="" \ | |
49 | + cidr_netmask="" \ | |
50 | 50 | op start interval="0s" timeout="60s" on-fail="restart" \ |
51 | 51 | op monitor interval="10s" timeout="60s" on-fail="restart" \ |
52 | - op stop interval="0s" timeout="60s" on-fail="block" | |
52 | + op stop interval="0s" timeout="60s" on-fail="fence" | |
53 | 53 | |
54 | 54 | primitive prmL7directord ocf:heartbeat:L7directord \ |
55 | 55 | op start interval="0s" timeout="60s" on-fail="restart" \ |
56 | 56 | op monitor interval="10s" timeout="60s" on-fail="restart" \ |
57 | - op stop interval="0s" timeout="60s" on-fail="block" | |
57 | + op stop interval="0s" timeout="60s" on-fail="fence" | |
58 | 58 | |
59 | 59 | primitive prmL7vsd ocf:heartbeat:L7vsd \ |
60 | 60 | op start interval="0s" timeout="60s" on-fail="restart" \ |
61 | 61 | op monitor interval="10s" timeout="60s" on-fail="restart" \ |
62 | - op stop interval="0s" timeout="60s" on-fail="block" | |
62 | + op stop interval="0s" timeout="60s" on-fail="fence" | |
63 | 63 | |
64 | 64 | primitive prmPingd ocf:pacemaker:pingd \ |
65 | 65 | params \ |
66 | 66 | name="default_ping_set" \ |
67 | - host_list="MODIFY_PING_TARGET_IP" \ | |
67 | + host_list="" \ | |
68 | 68 | multiplier="100" \ |
69 | 69 | op start interval="0s" timeout="60s" on-fail="restart" \ |
70 | 70 | op monitor interval="10s" timeout="60s" on-fail="restart" \ |
@@ -73,7 +73,7 @@ primitive prmPingd ocf:pacemaker:pingd \ | ||
73 | 73 | primitive prmDiskd ocf:pacemaker:diskd \ |
74 | 74 | params \ |
75 | 75 | name="diskcheck_status_internal" \ |
76 | - device="MODIFY_TARGET_DISK_DEV" \ | |
76 | + device="" \ | |
77 | 77 | interval="10" \ |
78 | 78 | op start interval="0s" timeout="60s" on-fail="restart" \ |
79 | 79 | op monitor interval="10s" timeout="60s" on-fail="restart" \ |
@@ -83,8 +83,8 @@ primitive prmDiskd ocf:pacemaker:diskd \ | ||
83 | 83 | # params \ |
84 | 84 | # priority="1" \ |
85 | 85 | # stonith-timeout="40s" \ |
86 | -# hostlist="MODIFY_PRYMARY_HOST" \ | |
87 | -# dead_check_target="MODIFY_TARGET_IP MODIFY_TARGET_IP ..." \ | |
86 | +# hostlist="" \ | |
87 | +# dead_check_target="" \ | |
88 | 88 | # standby_check_command="/usr/sbin/crm_resource -r prmVIP -W | grep -q `hostname`" \ |
89 | 89 | # op start interval="0s" timeout="60s" \ |
90 | 90 | # op monitor interval="10s" timeout="60s" \ |
@@ -92,12 +92,12 @@ primitive prmDiskd ocf:pacemaker:diskd \ | ||
92 | 92 | |
93 | 93 | #primitive prmStonith1-2 stonith:external/ipmi \ |
94 | 94 | # params \ |
95 | -# passwd="MODIFY_IPMI_PASSWORD" \ | |
96 | -# ipaddr="MODIFY_IPMI_IP" \ | |
95 | +# passwd="" \ | |
96 | +# ipaddr="" \ | |
97 | 97 | # priority="2" \ |
98 | -# userid="MODIFY_IPMI_USER" \ | |
99 | -# hostname="MODIFY_PRYMARY_HOST" \ | |
100 | -# interface="MODIFY_IPMI_INTERFACE" \ | |
98 | +# userid="" \ | |
99 | +# hostname="" \ | |
100 | +# interface="" \ | |
101 | 101 | # stonith-timeout="60s" \ |
102 | 102 | # op start interval="0s" timeout="60s" \ |
103 | 103 | # op monitor interval="3600s" timeout="60s" \ |
@@ -107,7 +107,7 @@ primitive prmDiskd ocf:pacemaker:diskd \ | ||
107 | 107 | # params \ |
108 | 108 | # priority="3" \ |
109 | 109 | # stonith-timeout="600s" \ |
110 | -# hostlist="MODIFY_PRYMARY_HOST" \ | |
110 | +# hostlist="" \ | |
111 | 111 | # op start interval="0s" timeout="60s" \ |
112 | 112 | # op monitor interval="3600s" timeout="60s" \ |
113 | 113 | # op stop interval="0s" timeout="60s" |
@@ -116,8 +116,8 @@ primitive prmDiskd ocf:pacemaker:diskd \ | ||
116 | 116 | # params \ |
117 | 117 | # priority="1" \ |
118 | 118 | # stonith-timeout="40s" \ |
119 | -# hostlist="MODIFY_SECONDARY_HOST" \ | |
120 | -# dead_check_target="MODIFY_TARGET_IP MODIFY_TARGET_IP ..." \ | |
119 | +# hostlist="" \ | |
120 | +# dead_check_target="" \ | |
121 | 121 | # standby_check_command="/usr/sbin/crm_resource -r prmVIP -W | grep -q `hostname`" \ |
122 | 122 | # op start interval="0s" timeout="60s" \ |
123 | 123 | # op monitor interval="10s" timeout="60s" \ |
@@ -125,12 +125,12 @@ primitive prmDiskd ocf:pacemaker:diskd \ | ||
125 | 125 | |
126 | 126 | #primitive prmStonith2-2 stonith:external/ipmi \ |
127 | 127 | # params \ |
128 | -# passwd="MODIFY_IPMI_PASSWORD" \ | |
129 | -# ipaddr="MODIFY_IPMI_IP" \ | |
128 | +# passwd="" \ | |
129 | +# ipaddr="" \ | |
130 | 130 | # priority="2" \ |
131 | -# userid="MODIFY_IPMI_USER" \ | |
132 | -# hostname="MODIFY_SECONDARY_HOST" \ | |
133 | -# interface="MODIFY_IPMI_INTERFACE" \ | |
131 | +# userid="" \ | |
132 | +# hostname="" \ | |
133 | +# interface="" \ | |
134 | 134 | # stonith-timeout="60s" \ |
135 | 135 | # op start interval="0s" timeout="60s" \ |
136 | 136 | # op monitor interval="3600s" timeout="60s" \ |
@@ -140,21 +140,21 @@ primitive prmDiskd ocf:pacemaker:diskd \ | ||
140 | 140 | # params \ |
141 | 141 | # priority="3" \ |
142 | 142 | # stonith-timeout="600s" \ |
143 | -# hostlist="MODIFY_SECONDARY_HOST" \ | |
143 | +# hostlist="" \ | |
144 | 144 | # op start interval="0s" timeout="60s" \ |
145 | 145 | # op monitor interval="3600s" timeout="60s" \ |
146 | 146 | # op stop interval="0s" timeout="60s" |
147 | 147 | |
148 | 148 | ### Resource Location ### |
149 | 149 | location rsc_location-grpUltraMonkey-1 grpUltraMonkey \ |
150 | - rule 200: #uname eq MODIFY_PRYMARY_HOST \ | |
151 | - rule 100: #uname eq MODIFY_SECONDARY_HOST \ | |
150 | + rule 200: #uname eq \ | |
151 | + rule 100: #uname eq \ | |
152 | 152 | rule -INFINITY: not_defined default_ping_set or default_ping_set lt 100 \ |
153 | 153 | rule -INFINITY: not_defined diskcheck_status_internal or diskcheck_status_internal eq ERROR |
154 | 154 | #location rsc_location-grpStonith1-2 grpStonith1 \ |
155 | -# rule -INFINITY: #uname eq MODIFY_PRYMARY_HOST | |
155 | +# rule -INFINITY: #uname eq | |
156 | 156 | #location rsc_location-grpStonith2-3 grpStonith2 \ |
157 | -# rule -INFINITY: #uname eq MODIFY_SECONDARY_HOST | |
157 | +# rule -INFINITY: #uname eq | |
158 | 158 | |
159 | 159 | ### Resource Colocation ### |
160 | 160 | colocation rsc_colocation-grpUltraMonkey-clnPingd-1 INFINITY: grpUltraMonkey clnPingd |
@@ -0,0 +1,31 @@ | ||
1 | +#ifndef GETTID_H | |
2 | +#define GETTID_H | |
3 | + | |
4 | +#include <unistd.h> | |
5 | +#include <sys/syscall.h> | |
6 | +#include <sys/types.h> | |
7 | + | |
8 | +#include <boost/noncopyable.hpp> | |
9 | + | |
10 | +namespace l7vs | |
11 | +{ | |
12 | + | |
13 | +class get_tid : boost::noncopyable | |
14 | +{ | |
15 | +public: | |
16 | + static pid_t gettid(void) { | |
17 | + return syscall(SYS_gettid); | |
18 | + }; | |
19 | +}; | |
20 | + | |
21 | +/* | |
22 | +extern "C" | |
23 | +pid_t gettid(void) | |
24 | +{ | |
25 | + return syscall(SYS_gettid); | |
26 | +} | |
27 | +*/ | |
28 | + | |
29 | +} | |
30 | + | |
31 | +#endif |
@@ -35,6 +35,7 @@ | ||
35 | 35 | #include "error_code.h" |
36 | 36 | #include "snmpagent.h" |
37 | 37 | #include "snmpfunc.h" |
38 | +#include "gettid.h" | |
38 | 39 | #define PARAM_SCHED_ALGORITHM "task_scheduler_algorithm" |
39 | 40 | #define PARAM_SCHED_PRIORITY "task_scheduler_priority" |
40 | 41 | #define TRAP_TIME_STRING_MAX_SIZE (20) |
@@ -191,6 +192,9 @@ void l7vsd::list_virtual_service_verbose(l7vsd_response *response, error_code | ||
191 | 192 | //! @param[out] error_code |
192 | 193 | void l7vsd::add_virtual_service(const virtualservice_element *in_vselement, error_code &err) |
193 | 194 | { |
195 | + pid_t tid; | |
196 | + tid = get_tid::gettid(); | |
197 | + | |
194 | 198 | Logger logger(LOG_CAT_L7VSD_MAINTHREAD, 7, "l7vsd::add_virtual_service", __FILE__, __LINE__); |
195 | 199 | |
196 | 200 | boost::mutex::scoped_lock command_lock(command_mutex); |
@@ -207,6 +211,7 @@ void l7vsd::add_virtual_service(const virtualservice_element *in_vselement, e | ||
207 | 211 | if (LOG_LV_DEBUG == Logger::getLogLevel(LOG_CAT_L7VSD_MAINTHREAD)) { |
208 | 212 | std::stringstream debugstr; |
209 | 213 | debugstr << "l7vsd::add_virtual_service arguments:"; |
214 | + debugstr << boost::format("tid=%d") % tid; | |
210 | 215 | debugstr << boost::format("*in_vselement=%s") % *in_vselement; |
211 | 216 | Logger::putLogDebug(LOG_CAT_L7VSD_MAINTHREAD, 8, debugstr.str(), __FILE__, __LINE__); |
212 | 217 | } |
@@ -323,6 +328,9 @@ void l7vsd::add_virtual_service(const virtualservice_element *in_vselement, e | ||
323 | 328 | //! @param[out] error_code |
324 | 329 | void l7vsd::del_virtual_service(const virtualservice_element *in_vselement, error_code &err) |
325 | 330 | { |
331 | + pid_t tid; | |
332 | + tid = get_tid::gettid(); | |
333 | + | |
326 | 334 | Logger logger(LOG_CAT_L7VSD_MAINTHREAD, 9, "l7vsd::del_virtual_service", __FILE__, __LINE__); |
327 | 335 | |
328 | 336 | boost::mutex::scoped_lock command_lock(command_mutex); |
@@ -339,6 +347,7 @@ void l7vsd::del_virtual_service(const virtualservice_element *in_vselement, e | ||
339 | 347 | if (LOG_LV_DEBUG == Logger::getLogLevel(LOG_CAT_L7VSD_MAINTHREAD)) { |
340 | 348 | std::stringstream debugstr; |
341 | 349 | debugstr << "l7vsd::del_virtual_service arguments:"; |
350 | + debugstr << boost::format("tid=%d") % tid; | |
342 | 351 | debugstr << boost::format("*in_vselement=%s") % *in_vselement; |
343 | 352 | Logger::putLogDebug(LOG_CAT_L7VSD_MAINTHREAD, 10, debugstr.str(), __FILE__, __LINE__); |
344 | 353 | } |
@@ -1471,7 +1480,13 @@ std::string l7vsd::usage() | ||
1471 | 1480 | //! signal handler function |
1472 | 1481 | void l7vsd::sig_exit_handler() |
1473 | 1482 | { |
1474 | - Logger logger(LOG_CAT_L7VSD_MAINTHREAD, 40, "l7vsd::sig_exit_handler", __FILE__, __LINE__); | |
1483 | + pid_t tid; | |
1484 | + tid = get_tid::gettid(); | |
1485 | + | |
1486 | + std::stringstream debugstr; | |
1487 | + debugstr << "l7vsd::sig_exit_handler "; | |
1488 | + debugstr << boost::format("Thread id=%d") % tid; | |
1489 | + Logger logger(LOG_CAT_L7VSD_MAINTHREAD, 40, debugstr.str(), __FILE__, __LINE__); | |
1475 | 1490 | |
1476 | 1491 | sigset_t sigmask; |
1477 | 1492 | sigemptyset(&sigmask); |
@@ -26,6 +26,7 @@ | ||
26 | 26 | #include "session_thread_control.h" |
27 | 27 | |
28 | 28 | #include "utility.h" |
29 | +#include "gettid.h" | |
29 | 30 | |
30 | 31 | namespace l7vs |
31 | 32 | { |
@@ -66,8 +67,12 @@ void session_thread_control::start_thread() | ||
66 | 67 | // |
67 | 68 | void session_thread_control::upstream_run() |
68 | 69 | { |
70 | + pid_t tid; | |
71 | + tid = get_tid::gettid(); | |
72 | + | |
69 | 73 | if (unlikely(LOG_LV_DEBUG == Logger::getLogLevel(LOG_CAT_L7VSD_VIRTUALSERVICE))) { |
70 | - boost::format fmt("in_function : void session_thread_control::upstream_run()"); | |
74 | + boost::format fmt("in_function[%d] : void session_thread_control::upstream_run()"); | |
75 | + fmt % tid; | |
71 | 76 | Logger::putLogDebug(LOG_CAT_L7VSD_VIRTUALSERVICE, 1, fmt.str(), __FILE__, __LINE__); |
72 | 77 | } |
73 | 78 |
@@ -130,8 +135,12 @@ void session_thread_control::upstream_run() | ||
130 | 135 | // |
131 | 136 | void session_thread_control::downstream_run() |
132 | 137 | { |
138 | + pid_t tid; | |
139 | + tid = get_tid::gettid(); | |
140 | + | |
133 | 141 | if (unlikely(LOG_LV_DEBUG == Logger::getLogLevel(LOG_CAT_L7VSD_VIRTUALSERVICE))) { |
134 | - boost::format fmt("in_function : void session_thread_control::downstream_run()"); | |
142 | + boost::format fmt("in_function[%d] : void session_thread_control::downstream_run()"); | |
143 | + fmt % tid; | |
135 | 144 | Logger::putLogDebug(LOG_CAT_L7VSD_VIRTUALSERVICE, 4, fmt.str(), __FILE__, __LINE__); |
136 | 145 | } |
137 | 146 | cpu_set_t mask; |
@@ -293,7 +302,7 @@ void session_thread_control::join() | ||
293 | 302 | downthread_joining_condition.wait(down_lk); |
294 | 303 | |
295 | 304 | if (unlikely(LOG_LV_DEBUG == l7vs::Logger::getLogLevel(l7vs::LOG_CAT_L7VSD_VIRTUALSERVICE))) { |
296 | - boost::format fmt("out_function : void session_thread_control::stopdownstream() : up_status = %d / down_status = %d"); | |
305 | + boost::format fmt("out_function : void session_thread_control::join() : up_status = %d / down_status = %d"); | |
297 | 306 | fmt % upthread_state % downthread_state; |
298 | 307 | l7vs::Logger::putLogDebug(l7vs::LOG_CAT_L7VSD_VIRTUALSERVICE, 16, fmt.str(), __FILE__, __LINE__); |
299 | 308 | } |
@@ -38,6 +38,7 @@ | ||
38 | 38 | #include "snmpagent.h" |
39 | 39 | #include "utility.h" |
40 | 40 | #include "logger_access_manager.h" |
41 | +#include "gettid.h" | |
41 | 42 | |
42 | 43 | // implementation for virtualservice_tcp |
43 | 44 | /*! |
@@ -1542,6 +1543,9 @@ void l7vs::virtualservice_tcp::del_realserver(const l7vs::virtualservice_element | ||
1542 | 1543 | */ |
1543 | 1544 | void l7vs::virtualservice_tcp::run() |
1544 | 1545 | { |
1546 | + pid_t tid; | |
1547 | + tid = get_tid::gettid(); | |
1548 | + | |
1545 | 1549 | Logger funcLog(LOG_CAT_L7VSD_VIRTUALSERVICE, 80, "function: void virtualservice_tcp::run()", |
1546 | 1550 | __FILE__, __LINE__); |
1547 | 1551 |
@@ -1619,6 +1623,13 @@ void l7vs::virtualservice_tcp::run() | ||
1619 | 1623 | schedmod_rep_timer->async_wait(boost::bind(&virtualservice_tcp::handle_schedmod_replication, |
1620 | 1624 | this, boost::asio::placeholders::error)); |
1621 | 1625 | |
1626 | + if (unlikely(LOG_LV_DEBUG == Logger::getLogLevel(LOG_CAT_L7VSD_VIRTUALSERVICE))) { | |
1627 | + boost::format formatter("function: void virtualservice_tcp::run() " | |
1628 | + "thread id = %d"); | |
1629 | + formatter % tid; | |
1630 | + Logger::putLogDebug(LOG_CAT_L7VSD_VIRTUALSERVICE, 82, formatter.str(), __FILE__, __LINE__); | |
1631 | + } | |
1632 | + | |
1622 | 1633 | //run dispatcher(start io_service loop) |
1623 | 1634 | work.reset(new boost::asio::io_service::work(*dispatcher)); |
1624 | 1635 | boost::thread_group dispatcher_thread_group; |