Package com.netflix.eureka.aws
Class ElasticNetworkInterfaceBinder
- java.lang.Object
-
- com.netflix.eureka.aws.ElasticNetworkInterfaceBinder
-
- All Implemented Interfaces:
AwsBinder
public class ElasticNetworkInterfaceBinder extends java.lang.Object implements AwsBinder
Amazon ENI binder for instances. Candidate ENI's discovery is done using the same mechanism as Elastic ip binder, via dns records or service urls. The dns records and the service urls should use the ENI private dns or private ip Dns record examples txt.us-east-1.eureka="us-east-1a.eureka" "us-east-1b.eureka" txt.us-east-1a.eureka="ip-172-31-y-y.ec2.internal" txt.us-east-1b.eureka="ip-172-31-x-x.ec2.internal" where "ip-172-31-x-x.ec2.internal" is the ENI private dns Service url example: eureka.serviceUrl.us-east-1a=http://ip-172-31-x-x.ec2.internal:7001/eureka/v2/ ENI Binding strategy should be configured via property like: eureka.awsBindingStrategy=ENI If there are no available ENI's for the availability zone, it will not attach any already attached ENI
-
-
Constructor Summary
Constructors Constructor Description ElasticNetworkInterfaceBinder(EurekaServerConfig serverConfig, com.netflix.discovery.EurekaClientConfig clientConfig, PeerAwareInstanceRegistry registry, com.netflix.appinfo.ApplicationInfoManager applicationInfoManager)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanalreadyBound()voidbind()Binds an ENI to the instance.java.util.List<java.lang.String>getCandidateIps()Based on shouldUseDnsForFetchingServiceUrls configuration, either retrieves candidates from dns records or from configuration properties.voidshutdown()voidstart()voidunbind()Unbind the IP that this instance is associated with.
-
-
-
Constructor Detail
-
ElasticNetworkInterfaceBinder
@Inject public ElasticNetworkInterfaceBinder(EurekaServerConfig serverConfig, com.netflix.discovery.EurekaClientConfig clientConfig, PeerAwareInstanceRegistry registry, com.netflix.appinfo.ApplicationInfoManager applicationInfoManager)
-
-
Method Detail
-
alreadyBound
public boolean alreadyBound() throws java.net.MalformedURLException- Throws:
java.net.MalformedURLException
-
bind
public void bind() throws java.net.MalformedURLExceptionBinds an ENI to the instance. The candidate ENI's are deduced in the same wa the EIP binder works: Via dns records or via service urls, depending on configuration. It will try to attach the first ENI that is: Available For this subnet In the list of candidate ENI's- Throws:
java.net.MalformedURLException
-
unbind
public void unbind() throws java.lang.ExceptionUnbind the IP that this instance is associated with.- Throws:
java.lang.Exception
-
getCandidateIps
public java.util.List<java.lang.String> getCandidateIps() throws java.net.MalformedURLExceptionBased on shouldUseDnsForFetchingServiceUrls configuration, either retrieves candidates from dns records or from configuration properties.- Throws:
java.net.MalformedURLException
-
-