File tree Expand file tree Collapse file tree 1 file changed +2
-5
lines changed Expand file tree Collapse file tree 1 file changed +2
-5
lines changed Original file line number Diff line number Diff line change 13
13
vpcId = '1858a08a-6cc9-4278-8d0c-d536f441fe8e' #vpcId
14
14
ks_access_key_id = '您的ak'
15
15
ks_secret_access_key = '您的sk'
16
- vip = "172.18.0.253" #改成您的本机内网 VIP
17
16
DestinationCidrBlock = '172.18.0.253/32' #修改为VIP
18
17
thisInstanceId = '1cf963ff-7847-4859-8462-5405f0facc1d' #当前主机的Id
19
- thatInstanceId = 'b141da5f-8e3e-44c0-ac0f-a0feccba78c7' #迁移前所在主机Id
20
- thisInstanceIp = "172.18.0.13" #当前机器IP
21
18
##################需修改部分End######################
22
19
23
20
log = open ('/var/log/keepalived.log' , 'a+' )
24
- state_file = open ('/var/keepalived/state' , 'r' )
21
+ # state_file = open('/var/keepalived/state', 'r')
25
22
26
23
def get_now_time ():
27
24
return time .strftime ('[%Y-%m-%d %H:%M:%S]' ,time .localtime (time .time ())) + '[pid' + str (os .getpid ()) + ']'
@@ -46,7 +43,7 @@ def migrateVip():
46
43
r = findRoute ()
47
44
if r :
48
45
print vpcClient .delete_route (RouteId = r )
49
- log_write (" now change the nexthop of vip to this host." + thisInstanceIp )
46
+ log_write (" now change the nexthop of vip to this host." + thisInstanceId )
50
47
if vpcClient .create_route (** param ):
51
48
log_write ('migrating vip success' )
52
49
You can’t perform that action at this time.
0 commit comments