将 spring cloud 项目部署到 docker 容器中后,虽然可以配置容器的端口映射到宿主机的端口 但是在 eureka 界面显示的instance id 是一串随机的字符串,类似于 d97d725bf6ae 这样的 但是,事实上,我们想让他显示出 IP ,这样我们可以直接点击而打开 info 端点信息
service 模块 links server 模块,再起个别名 traffic-service-eureka ,因为我配置文件里配置的是 traffic-service-eureka, 这样 service 模块就可以通过 server 或者 traffic-service-eureka 来访问 server 了
另外,配置的 hostname,可以进入 容器中查看 /etc/hosts 该配置会在 文件中生成一个容器的 ip 和 hostname 的记录
// Runnable decorator to user-level FutureTask, if different privatefinal Map<Runnable, Object> decoratedTaskMap = newConcurrentReferenceHashMap<>(16, ConcurrentReferenceHashMap.ReferenceType.WEAK);
public ThreadPoolExecutor getThreadPoolExecutor()throws IllegalStateException { Assert.state(this.threadPoolExecutor != null, "ThreadPoolTaskExecutor not initialized"); returnthis.threadPoolExecutor; }
publicintgetPoolSize() { if (this.threadPoolExecutor == null) { // Not initialized yet: assume core pool size. returnthis.corePoolSize; } returnthis.threadPoolExecutor.getPoolSize(); }
publicintgetActiveCount() { if (this.threadPoolExecutor == null) { // Not initialized yet: assume no active threads. return0; } returnthis.threadPoolExecutor.getActiveCount(); }
Commands: auth-retry t : Auth failure retry mode (none,interact,nointeract). bytecount n : Show bytes in/out, update every n secs (0=off). echo [on|off] [N|all] : Like log, but only show messages in echo buffer. exit|quit : Close management session. forget-passwords : Forget passwords entered so far. help : Print this message. hold [on|off|release] : Set/show hold flag to on/off state, or release current hold and start tunnel. kill cn : Kill the client instance(s) having common name cn. kill IP:port : Kill the client instance connecting from IP:port. load-stats : Show global server load stats. log [on|off] [N|all] : Turn on/off realtime log display + show last N lines or 'all' for entire history. mute [n] : Set log mute level to n, or show level if n is absent. needok type action : Enter confirmation for NEED-OK request of 'type', where action = 'ok' or 'cancel'. needstr type action : Enter confirmation for NEED-STR request of 'type', where action is reply string. net : (Windows only) Show network info and routing table. password type p : Enter password p for a queried OpenVPN password. remote type [host port] : Override remote directive, type=ACCEPT|MOD|SKIP. proxy type [host port flags] : Enter dynamic proxy server info. pid : Show process ID of the current OpenVPN process. client-auth CID KID : Authenticate client-id/key-id CID/KID (MULTILINE) client-auth-nt CID KID : Authenticate client-id/key-id CID/KID client-deny CID KID R [CR] : Deny auth client-id/key-id CID/KID with log reason text R and optional client reason text CR client-kill CID [M] : Kill client instance CID with message M (def=RESTART) env-filter [level] : Set env-var filter level client-pf CID : Define packet filter for client CID (MULTILINE) rsa-sig : Enter an RSA signature in response to >RSA_SIGN challenge Enter signature base64 on subsequent lines followed by END certificate : Enter a client certificate in response to >NEED-CERT challenge Enter certificate base64 on subsequent lines followed by END signal s : Send signal s to daemon, s = SIGHUP|SIGTERM|SIGUSR1|SIGUSR2. state [on|off] [N|all] : Like log, but show state history. status [n] : Show current daemon status info using format #n. test n : Produce n lines of output for testing/debugging. username type u : Enter username u for a queried OpenVPN username. verb [n] : Set log verbosity level to n, or show if n is absent. version : Show current version number. END