首页 > 编程语言 > 详细

mac上启动springboot项目很慢的解决方案

时间:2020-04-03 17:50:57      阅读:1079      评论:0      收藏:0      [点我收藏+]

在启动springboot项目的时候,会停顿好长时间才开始打印日志。

对于强迫症这是受不了的。

  查看第一行的日志打印。

InetAddress.getLocalHost().getHostName() took 5004 milliseconds to respond. Please verify your network configuration (macOS machines may need to add entries to /etc/hosts).

这行日志可以看出它去解析hostname的时间就花了5秒多。

这里说明了它去解析了hosts文件。   macOS machines may need to add entries to /etc/hosts

 

1、查看本机的hostname是什么

~ hostname
han.sun-mac-pro.local

2、查看hosts文件里面配置的是什么

broadcasthost
~ vim  /private/etc/hosts


127.0.0.1                localhost
255.255.255.255        broadcasthost
::1                      localhost  

3、复制hostname

127.0.0.1              localhost      你的机器名.local
255.255.255.255      broadcasthost
::1                    localhost      你的机器名.local

4、:wq或者:x可能修改不了文件

:w !sudo tee %

 5、再去启动springboot项目就变得飞快了

 

mac上启动springboot项目很慢的解决方案

原文:https://www.cnblogs.com/han-sun/p/12627850.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!