Class 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
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean alreadyBound()  
      void bind()
      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.
      void shutdown()  
      void start()  
      void unbind()
      Unbind the IP that this instance is associated with.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ElasticNetworkInterfaceBinder

        @Inject
        public ElasticNetworkInterfaceBinder​(EurekaServerConfig serverConfig,
                                             com.netflix.discovery.EurekaClientConfig clientConfig,
                                             PeerAwareInstanceRegistry registry,
                                             com.netflix.appinfo.ApplicationInfoManager applicationInfoManager)
    • Method Detail

      • start

        @PostConstruct
        public void start()
        Specified by:
        start in interface AwsBinder
      • shutdown

        @PreDestroy
        public void shutdown()
        Specified by:
        shutdown in interface AwsBinder
      • alreadyBound

        public boolean alreadyBound()
                             throws java.net.MalformedURLException
        Throws:
        java.net.MalformedURLException
      • bind

        public void bind()
                  throws java.net.MalformedURLException
        Binds 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.Exception
        Unbind the IP that this instance is associated with.
        Throws:
        java.lang.Exception
      • getCandidateIps

        public java.util.List<java.lang.String> getCandidateIps()
                                                         throws java.net.MalformedURLException
        Based on shouldUseDnsForFetchingServiceUrls configuration, either retrieves candidates from dns records or from configuration properties.
        Throws:
        java.net.MalformedURLException