Nacos Native Quick Start
Nacos Quick Start
This quick start guide is designed to help you quickly download, install, and use Nacos on your computer.
System Requirements
Nacos Native is a version of Nacos built using the GraalVM, and it no longer depends on a separate JDK installation. Nacos Native currently provides executable files for Linux (GNU) and macOS. The current version of Nacos Native corresponds to Java Nacos version 2.4.0. Executable binaries can be downloaded from the corresponding release page. It is recommended to run Nacos Native on a complete 64-bit operating system that includes the libstdc++
library.
Download and Extract the Package
After downloading the program package from the appropriate page, extract it and verify the files:
- On Linux operating systems, the extracted files should include the
nacos-server
binary, thelibinstrument.so
symlink, and other related configurations. - On macOS, the extracted files should include the
nacos-server
binary and other related configurations.
If a Nacos Native version for other operating systems is not available, you can manually compile the source code on that operating system to obtain the Nacos Native binary package.
Starting the Server
It is recommended to run Nacos Native on a machine with at least 1 CPU core, 2 GB of RAM, and 60 GB of storage. On Linux/Unix/macOS, you can start Nacos Native using the following command:
If you want to start Nacos Native in cluster mode, make sure to have a cluster.conf
file in the conf
directory. This process is the same as with Java Nacos. After starting Nacos Native in cluster mode, it will automatically scan and retrieve the cluster IP addresses.
Stopping the Server
To stop the Nacos Native server on Linux/Unix/macOS, use the following command:
Viewing Logs
For Linux/Unix operating systems, Nacos Native’s runtime logs are recorded in the /root/nacos/logs
directory. The log structure is consistent with that of Java Nacos.
Building Native Nacos
Nacos Native provides build configurations for different operating systems. You can quickly build the Nacos Native executable for a specific OS using Maven. Follow the instructions below to build Nacos Native:
The -Pnative
configuration provides the basic native build settings, while -Pnative-<os type>
specifies the operating system type. This configuration ensures that the RocksDB library is correctly packaged into Nacos Native. It’s important to note that while Nacos Native offers a musl
-based build configuration, GraalVM itself still requires compilation on a GNU-supported operating system, so using musl
for compilation is not recommended.
After a successful build, the relevant files will be published in the /console/target
directory. You can refer to the “Download and Extract the Package” section to verify the completeness of the build and retrieve the compiled files.