The current document describes how to install a highly available Nacos cluster with one click through the cloud native application management platform Rainbond.This method is suitable for users who are not familiar with complex technologies such as Kubernetes and containerization, and lowers the threshold for deploying Nacos in Kubernetes.
The combination of Rainbond and Nacos
Rainbond is an easy-to-use open source cloud-native application management platform.With it, users can complete the deployment and operation and maintenance of microservices in a graphical interface.With the help of the capabilities of Kubernetes and containerization technology, automatic operation and maintenance capabilities such as fault self-healing and elastic scaling can be empowered to users' businesses.
Rainbond has a built-in native Service Mesh microservice framework, and also has a good integration experience with other microservice frameworks such as Spring Cloud and Dubbo.Therefore, a large number of Rainbond users may also be users of the Nacos microservice registry.Such users no longer need to care about how to deploy Nacos clusters. The Rainbond team made Nacos into an application template that can be deployed with one click, which can be downloaded and installed by open source users for free.This installation method greatly reduces the deployment burden of users using Nacos cluster, and currently supports versions 1.4.2 and 2.0.4.
About Application Templates
The application template is an installation package for the Rainbond cloud-native application management platform. Based on it, users can install business systems into their own Rainbond with one click.No matter how complex the business system is, the application template will abstract it into an application, and install it together with the images, configuration information of all components in the application, and the relationship between all components.
Preconditions
The deployed Rainbond cloud-native application management platform,Quick Experience Version can run in a personal PC environment at the cost of starting a container.
Internet connection.
quick start
- Access to the built-in open source app store
Select the application market tab on the left, switch to the open source application store tab on the page, and search for the keyword nacos to find the Nacos-cluster application.
- A key installation
Click to install on the right side of Nacos-cluster to enter the installation page. After filling in the simple information, click to confirm to start the installation. The page automatically jumps to the topology view.
parameter description:
options | illustrate |
---|---|
Team Name | User-created workspace, isolated by namespace |
cluster name | Select which K8s cluster Nacos is deployed to |
Choose an application | Select which application Nacos is deployed to, the application contains several related components |
App version | Select the version of Nacos, currently available versions are 1.4.2, 2.0.4 |
After a few minutes, the Nacos cluster will be installed and running.
- test
Other microservice components that need to perform service registration can use ${NACOS_HOST}:${NACOS_PORT}
to connect to the Nacos cluster after establishingdependenciesfor Nacos.
service registration
curl -X PUT "http://${NACOS_HOST}:${NACOS_PORT}/nacos/v1/ns/instance?serviceName=nacos.naming.serviceName&ip=20.18.7.10&port=8080"
service discovery
curl -X GET "http://${NACOS_HOST}:${NACOS_PORT}/nacos/v1/ns/instance/list?serviceName=nacos.naming.serviceName"
publish configuration
curl -X POST "http://${NACOS_HOST}:${NACOS_PORT}/nacos/v1/cs/configs?dataId=nacos.cfg.dataId&group=test&content=helloWorld"
get configuration
curl -X GET "http://${NACOS_HOST}:${NACOS_PORT}/nacos/v1/cs/configs?dataId=nacos.cfg.dataId&group=test"
Advanced Features
- The Nacos cluster installed with one click contains 3 instances, and the operation of self-organization and election is automatically completed by initializing the plug-in.
- By default, Mysql is integrated as a data source.Configure the following environment variables in the environment configuration of the Nacos-server-2.0.4 component to switch to other external data sources.
name | necessary | describe |
---|---|---|
MYSQL_SERVICE_HOST | Y | database address |
MYSQL_SERVICE_PORT | Y | database port |
MYSQL_SERVICE_USER | Y | database username |
MYSQL_SERVICE_PASSWORD | Y | database password |
MYSQL_SERVICE_DB_NAME | Y | data storage name |
- The data persistence directory of Nacos-server-2.0.4 is generated by default.
- By default, the health check mechanism of Nacos-server-2.0.4 is configured to ensure that the instance goes offline automatically when it fails, and goes online automatically after recovery.