Very slow start springboot project solutions on mac

When the project started springboot will pause a long time to start printing log.

For obsessive-compulsive disorder This is intolerable.

  Log View the first line of print.

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

This line logs can see that it's time to resolve hostname spent more than 5 seconds.

Here it is explained to parse the hosts file. macOS machines may need to add entries to / etc / hosts

 

1. What is the view of the machine hostname

~ hostname
han.sun-mac-pro.local

2, what configuration the hosts file to see inside

broadcasthost
~ vim  /private/etc/hosts


127.0.0.1                localhost
255.255.255.255        broadcasthost
::1                      localhost  

3. Copy the hostname

127.0 . 0.1               localhost your machine name .local
 255.255 . 255.255       broadcasthost 
:: 1                     localhost your machine name .local

4,: wq or: x may not modify the file

: In ! sudo  tee %

 5, go to Start springboot project quickly became a

 

Guess you like

Origin www.cnblogs.com/han-sun/p/12627850.html