@Singleton public class EIPManager extends java.lang.Object implements AwsBinder
IP address.
Eureka clients talk to Eureka servers bound with well known
IP addresses since that is the most reliable mechanism to
discover the Eureka servers. When Eureka servers come up they bind
themselves to a well known elastic ip
This binding mechanism gravitates towards one eureka server per zone for resilience. At least one elastic ip should be slotted for each eureka server in a zone. If more than eureka server is launched per zone and there are not enough elastic ips slotted, the server tries to pick a free EIP slotted for other zones and if it still cannot find a free EIP, waits and keeps trying.
| Constructor and Description |
|---|
EIPManager(EurekaServerConfig serverConfig,
com.netflix.discovery.EurekaClientConfig clientConfig,
PeerAwareInstanceRegistry registry,
com.netflix.appinfo.ApplicationInfoManager applicationInfoManager) |
| Modifier and Type | Method and Description |
|---|---|
void |
bindEIP()
Checks if an EIP is bound and optionally binds the EIP.
|
java.util.Collection<java.lang.String> |
getCandidateEIPs(java.lang.String myInstanceId,
java.lang.String myZone)
Get the list of EIPs in the order of preference depending on instance zone.
|
boolean |
isEIPBound()
Checks if an EIP is already bound to the instance.
|
void |
shutdown() |
void |
start() |
void |
unbindEIP()
Unbind the EIP that this instance is associated with.
|
@Inject public EIPManager(EurekaServerConfig serverConfig, com.netflix.discovery.EurekaClientConfig clientConfig, PeerAwareInstanceRegistry registry, com.netflix.appinfo.ApplicationInfoManager applicationInfoManager)
public boolean isEIPBound()
public void bindEIP()
public void unbindEIP()
throws java.lang.Exception
java.lang.Exceptionpublic java.util.Collection<java.lang.String> getCandidateEIPs(java.lang.String myInstanceId,
java.lang.String myZone)
myInstanceId - the instance id for this instancemyZone - the zone where this instance is in