title: eureka-js-client Why I cant use the same hostname for two service instances?
body: <p>I am deploying two instances for the same service and the two are running on the same machine at different ports. Since it's a Nodejs application so i use eureka-js-client for regitering. My client config yml file are as follows:</p>
  <pre><code>eureka:
    heartbeatInterval: 30000
    registryFetchInterval: 30000
    host: 'username:passwor@ipAdrress'
    port: 8000
    servicePath: '/eureka/apps/'
    preferIpAddress: true
  
  instance:
    app: 'nodejs-service'
    hostName: 'localhost'
    ipAddr: 'localhost'
    statusPageUrl: 'http://localhost:3000'
    port:
      '$': 3000
      '@enabled': 'true'
  
    vipAddress: 'nodejs-service'
    dataCenterInfo:
      '@class': 'com.netflix.appinfo.InstanceInfo$DefaultDataCenterInfo'
      name: 'MyOwn'
  </code></pre>
  <p>And for the other instance, I simply change the port to 4000. When I register 3000 and 4000, it only shows 4000 instance on the eureka page. That's to say, only one instance is registered.While after i change one of the hostName value to something else, it works fine - two are registered. However, I need the hostNames be the same, because they are deployed on the same machine. For java, the same hostName is Ok, I am wondering is this problem caused by my yaml config file. Ask for help, thank you!</p>