当前位置:网站首页>Nacos installation and service registration
Nacos installation and service registration
2022-07-06 09:08:00 【look-word】
Nacos Installation of and registration of services
We all know naocs It's a registry , So what is the Registration Center ?
- What is a registry ?
- It is similar to an intermediary role ( Free conscience intermediary ), Play the role of a link in microservices , It provides the mapping relationship between service and service address , The producer registers the service name and address here ,
consumer
according toThe service name
Get a responseAccess address
.
- It is similar to an intermediary role ( Free conscience intermediary ), Play the role of a link in microservices , It provides the mapping relationship between service and service address , The producer registers the service name and address here ,
- Why use the registry
- When there is no registry , The caller needs to know when invoking the service
domain name
andport
, When modified by the caller , You need to change the code , When there are many services called , Then we need to modify a lot of code , It is undoubtedly increasing our workload .
- When there is no registry , The caller needs to know when invoking the service
So how does he work on earth ?
working principle :
- producer ( Service providers ) Register your domain name and port with the registry
- Consumers pull the service list from the Registration Center , And make a remote call
- The registration center and service providers ensure that services can be provided normally by regularly checking the heartbeat
Nacos Prepare before use
Download after decompression We need to get into bin Directory start nacos service
Do not double-click to start
naocs It will be java Written stay target Under the table of contents You can see jar file
start-up :
In the search bar above Input cmd Enter the black window
command :startup.cmd -m standalone
When the bottom appears Program start time Just explain
Successful launch
了
We came to the browser Input localhost:8848 You can see naocs The running interface We will carry out a series of configurations in it
- The username and password are both
naocs
All the services we register will appear in
List of services
in , Services can be offline and other operations !
Service registration
nacos There are three steps in the registration process
- Add dependency
- To configure nacos
- Start the service
Add dependency
<!-- Service registration -->
<dependency>
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
</dependency>
To configure nacos
# Spring
spring:
application:
# apply name
name: project-xxxx
cloud:
nacos:
discovery:
# Service registration address ip Add slogan
server-addr: 127.0.0.1:8848
Start the service
You can see , The service just started has appeared in the service list
边栏推荐
- The ECU of 21 Audi q5l 45tfsi brushes is upgraded to master special adjustment, and the horsepower is safely and stably increased to 305 horsepower
- Detailed explanation of dynamic planning
- LeetCode:236. 二叉树的最近公共祖先
- 项目连接数据库遇到的问题及解决
- Mongodb installation and basic operation
- Problems encountered in connecting the database of the project and their solutions
- Advanced Computer Network Review(3)——BBR
- LeetCode:剑指 Offer 48. 最长不含重复字符的子字符串
- Selenium+pytest automated test framework practice
- LeetCode:162. 寻找峰值
猜你喜欢
[OC-Foundation框架]--<Copy对象复制>
Intel Distiller工具包-量化实现1
The carousel component of ant design calls prev and next methods in TS (typescript) environment
[oc]- < getting started with UI> -- common controls uibutton
Intel distiller Toolkit - Quantitative implementation 2
[OC foundation framework] - string and date and time >
Mise en œuvre de la quantification post - formation du bminf
Post training quantification of bminf
MySQL uninstallation and installation methods
MYSQL卸载方法与安装方法
随机推荐
[embedded] cortex m4f DSP Library
[oc]- < getting started with UI> -- learning common controls
MongoDB 的安装和基本操作
什么是MySQL?MySql的学习之路是怎样的
LeetCode41——First Missing Positive——hashing in place & swap
Selenium+Pytest自动化测试框架实战(下)
postman之参数化详解
The ECU of 21 Audi q5l 45tfsi brushes is upgraded to master special adjustment, and the horsepower is safely and stably increased to 305 horsepower
多元聚类分析
[sword finger offer] serialized binary tree
Digital people anchor 618 sign language with goods, convenient for 27.8 million people with hearing impairment
一篇文章带你了解-selenium工作原理详解
KDD 2022论文合集(持续更新中)
Detailed explanation of dynamic planning
Pytest parameterization some tips you don't know / pytest you don't know
Selenium+pytest automated test framework practice
Advance Computer Network Review(1)——FatTree
【剑指offer】序列化二叉树
pytorch查看张量占用内存大小
LeetCode:剑指 Offer 03. 数组中重复的数字