24小时在线平台

当前位置: 24小时在线平台 > 部署教程大全 > 文章页

Quick Start for Nacos

时间:2025-06-19 13:32来源: 作者:admin 点击: 6 次
This topic is about how to set up and use Nacos.

Quick Start for Nacos

This topic is about how to set up and use Nacos.

0.Choose Version

Nacos 1.X is old version. Recommend you use 2.X version. Please move to document.

You can see the introduction of each version at release notes or blog, the current recommended version is 2.1.1.

1.Prerequisites

Before you begin, install the following:

64bit OS: Linux/Unix/Mac/Windows supported, Linux/Unix/Mac recommended.

64bit JDK 1.8+: downloads, JAVA_HOME settings.

Maven 3.2.x+: downloads, settings.

2.Download & Build from Release

There are two ways to get Nacos.

1)Download source code from Github git clone https://github.com/alibaba/nacos.git cd nacos/ mvn -Prelease-nacos -Dmaven.test.skip=true clean install -U ls -al distribution/target/ // change the $version to your actual path cd distribution/target/nacos-server-$version/nacos/bin 2)Download run package

Select the latest stable version from https://github.com/alibaba/nacos/releases

unzip nacos-server-$version.zip OR tar -xvf nacos-server-$version.tar.gz cd nacos/bin 3.Start Server Linux/Unix/Mac

Run the following command to start(standalone means non-cluster mode):

sh startup.sh -m standalone

If you are using a ubuntu system, or encounter this error message [[symbol not found, try running as follows:

bash startup.sh -m standalone

Windows

Run the following command to start(standalone means non-cluster mode):

cmd startup.cmd -m standalone

4.Service & Configuration Management Service registration

curl -X POST 'http://127.0.0.1:8848/nacos/v1/ns/instance?serviceName=nacos.naming.serviceName&ip=20.18.7.10&port=8080'

Service discovery

curl -X GET 'http://127.0.0.1:8848/nacos/v1/ns/instance/list?serviceName=nacos.naming.serviceName'

Publish config

curl -X POST ":8848/nacos/v1/cs/configs?dataId=nacos.cfg.dataId&group=test&content=helloWorld"

Get config

curl -X GET ":8848/nacos/v1/cs/configs?dataId=nacos.cfg.dataId&group=test"

5.Shutdown Servers Linux/Unix/Mac

sh shutdown.sh

Windows

cmd shutdown.cmd

Or click the shutdown.cmd file operation.

(责任编辑:)
------分隔线----------------------------
发表评论
请自觉遵守互联网相关的政策法规,严禁发布色情、暴力、反动的言论。
评价:
表情:
用户名: 验证码:
发布者资料
查看详细资料 发送留言 加为好友 用户等级: 注册时间:2025-06-22 23:06 最后登录:2025-06-22 23:06
栏目列表
推荐内容