server = app.listen(5000,function(){var port = server.address()。port;console.log(‘聆听%s’,端口);});
首先我在运行docker run -it -p 8761:8761之后尝试了本地 springcloud </跨度> 锟斤拷
您需要包含一个instanceId,它应该是此实例的唯一标识符。
const eureka = new Eureka({ instance: { instanceId:'sheila', app: 'sheila', hostName: 'localhost', ipAddr: '127.0.0.1', statusPageUrl: 'http://localhost:5000', healthCheckUrl: 'http://localhost:5000/health', port: { '$': 5000, '@enabled': 'true', }, vipAddress: 'myvip', dataCenterInfo: { '@Class': 'com.netflix.appinfo.InstanceInfo$DefaultDataCenterInfo', name: 'MyOwn', }, }, eureka: { host: 'localhost', port: 8761, servicePath: '/eureka/apps/', }, });