Ok thanks.. didn't know.
Posts by stan92
-
-
Hi,
I've just switched the network cards on some of my VPS from Vlan100Mbps to a Vlan 1Gbps.
(I removed the 100Mbps card and added the new one, reboot the server)But when I try to ping another VPS (that still use the 100mbps netword card), I get an error "a destination host unreachable"
The VPS runs on Ubuntu 20.04 and use Netplan.
Any help (or Guide)? -
I finally found the solution after reading some posts on the forum
If that can help.
First of all, (I didn't know) for using the API, I had to activate it...and generate password.
I update my keepalived.conf like thisFor the master
Code
Display Moreglobal_defs {} vrrp_script chk_api { script "/bin/systemctl status my-service.service" interval 2 } vrrp_instance VI_1 { state MASTER interface eth0 virtual_router_id 101 priority 101 advert_int 1 authentication { auth_type PASS auth_pass 1111 } virtual_ipaddress { xx.xx.xx.xx } track_script { chk_api } notify_fault "/etc/keepalived/failover.sh" }
For the slave
Code
Display Moreglobal_defs { } vrrp_script chk_api { script "/bin/systemctl status my-service.service" interval 2 } vrrp_instance VI_1 { state BACKUP interface eth0 virtual_router_id 101 priority 100 advert_int 1 authentication { auth_type PASS auth_pass 1111 } virtual_ipaddress { xx.xx.xx.xx } track_script { chk_api } notify_fault "/etc/keepalived/failover.sh" }
And my failover.sh script looks like this
Code#!/usr/bin/env bash CURL_BODY='<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://enduser.service.web.vcp.netcup.de/"><SOAP-ENV:Body><ns1:changeIPRouting><loginName>LOGIN_NAME</loginName><password>PASSWIRD</password><routedIP>FAILOVERIP</routedIP><routedMask>32</routedMask> <destinationVserverName>SERVER_NAME</destinationVserverName><destinationInterfaceMAC>SERVER_NAME_MAC_ADDR</destinationInterfaceMAC></ns1:changeIPRouting></SOAP-ENV:Body></SOAP-ENV:Envelope>' CURL_OUTPUT=$(curl -s -H "Content-Type: text/xml; charset=utf-8" -H "SOAPAction:" -d "$CURL_BODY" -X POST https://www.servercontrolpanel.de:443/WSEndUser?xsd=1) echo "Failover IP basculee " | mail -s "Basculement IP" stan@email.com
I have to write a better a script especially for handling the response of the API.
-
Netcup has an API you need to inform about the VPS being down, then the Failover IP will switch to the other VPS.
You can find a (German) documentation here: https://www.netcup-wiki.de/wik…ebservice#changeIPRouting
I thank you... Does it mean I have to create a kind a daemon that checks if the VPS is down, and if it is, invoke the changeIPRouting method?
-
Hi,
I am running a couple of VPS at netcup and try to add a failover Ip support on 2 VPS.
Currently, all my VPS are under Ubuntu 18.04
I installed keepalived and configured the netplan config file by adding my Failover IP on both VPS.
I expected when I shutdown my master VPS, the Failover IP automatically switches to the the slave VPS but it's not the case..
It only works if I assign the Failover IP using the SCP.
Any help?
-
Hi,
Just get a VPS at netcup..and I can't figure out how to install Ubuntu
From the Control Panel Server -> Media -> Images, I select Ubuntu 18.04 and get a green progress bar 2/4
Is there a additional step? (it seems it's blocked at 2/4)Regard