Skip to content

Commit ac1e05c

Browse files
author
金山云SDK
authored
Merge pull request KscSDK#99 from KscSDK/trunk
Trunk
2 parents 509246e + 014b918 commit ac1e05c

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

examples/nexthop.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,12 @@
1313
vpcId = '1858a08a-6cc9-4278-8d0c-d536f441fe8e' #vpcId
1414
ks_access_key_id = '您的ak'
1515
ks_secret_access_key = '您的sk'
16-
vip = "172.18.0.253" #改成您的本机内网 VIP
1716
DestinationCidrBlock = '172.18.0.253/32' #修改为VIP
1817
thisInstanceId = '1cf963ff-7847-4859-8462-5405f0facc1d' #当前主机的Id
19-
thatInstanceId = 'b141da5f-8e3e-44c0-ac0f-a0feccba78c7' #迁移前所在主机Id
20-
thisInstanceIp = "172.18.0.13" #当前机器IP
2118
##################需修改部分End######################
2219

2320
log = open('/var/log/keepalived.log', 'a+')
24-
state_file = open('/var/keepalived/state', 'r')
21+
#state_file = open('/var/keepalived/state', 'r')
2522

2623
def get_now_time():
2724
return time.strftime('[%Y-%m-%d %H:%M:%S]',time.localtime(time.time())) + '[pid' + str(os.getpid()) + ']'
@@ -46,7 +43,7 @@ def migrateVip():
4643
r = findRoute()
4744
if r:
4845
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)
5047
if vpcClient.create_route(**param):
5148
log_write('migrating vip success')
5249

0 commit comments

Comments
 (0)