Microservice building 1: nacos uses source code to build the server

Nacos server construction

The construction method is to use source code packaging to build. I pulled the code from the code cloud. The download will be faster-link: https://gitee.com/mirrors/Nacos?_from=gitee_search. After downloading, you only need to run the consule module , Is fine, but it will report an error if you run it directly.

The reason is that nacos default startup is cluster mode, cluster mode needs to load database configuration, and another startup mode is stand-alone mode. Just add a parameter to the Vm options of idea startup.

-Dnacos.standalone=true

Just start it again, and the console will print out the location of the log.

Note: When compiling and running, it will report that the import com.alibaba.nacos.consistency.entity package is missing , the bottom line of https://nacos.io/zh-cn/docs/faq.html , as shown in the figure:

nacos root directory execute  mvn compile it

Continue to build cluster mode

Delete Vm options on -Dnacos.standalone=true

Let go of the database configuration in application.properties

Find the mysql database script in the config template, create the database, the database needs mysql5.7 or higher

Start the console project normally

There is a directory of /home/*/nacos in the console, which is the default data storage directory of nacos. You can watch the log later, and then start the service normally, type two packages, and the port numbers are 8848 and 8860. Okay, visit http://localhost:8848/nacos/

The default account nacos/nacos login nacos cluster server has been set up, you can go to /home/*/nacos/conf/cluster.conf to look at the text content, there will be cluster ip