In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)05/31 Report--
This article shows you how to run the Naming module, the content is concise and easy to understand, it will definitely brighten your eyes. I hope you can get something through the detailed introduction of this article.
Naming module-how to run the article
The Naming module is actually the core module of the service governance function in the Nacos framework. This module has many core functions. This time, we first analyze how to run it.
1 how to start the Naming service
First of all, Naming is an independent SpringBoot application service, which is started by @ SpringBootApplication and main function. I will not analyze the principle of SpringBoot here. Do you know by default?
/ * *
* Hello world!
*
* @ author xxc
, /
@ EnableScheduling
@ SpringBootApplication
Public class NamingApp {
Public static void main (String [] args) {
SpringApplication.run (NamingApp.class, args)
}
}
@ EnableScheduling is the annotation of the Spring framework, and anyone who has used this annotation knows that this is a scheduled task in stand-alone mode that comes with the framework.
The @ SpringBootApplication annotation will start the entire application for specific logic. Please refer to the SpringBoot source framework.
So we know here that the Naming module is a separate SpringBoot service that can be started separately.
2 start resources
What resources are loaded by the Naming module during startup?
Load RestfulAPI, such as CatalogController, ClusterController, DistroController, HealthController, InstanceController, OperatorController, RaftController, ServiceController and ApiController, package path: com.alibaba.nacos.naming.controllers, so you can see here that the communication mechanism of the Naming module is HTTP.
Consistency algorithm of service cluster Raft (CP mode) and memory-based AP mode, packet path: com.alibaba.nacos.naming.consistency
Context and running configuration, such as RunningConfig and SpringContext
Core functions of cluster management, such as subscription management, instance management and service management, etc. The package path is as follows: com.alibaba.nacos.naming.core
Health check, package path: com.alibaba.nacos.naming.healthcheck
Global exception response exception handling: ResponseExceptionHandler
Metrics monitoring and performance metrics monitoring, such as MetricsMonitor and PerformanceLoggerThread
Push service: PushService
Of course, there is not a list of all the startup resources, there are some resources, we will not list them one by one.
The above is how the Naming module works. Have you learned the knowledge or skills? If you want to learn more skills or enrich your knowledge reserve, you are welcome to follow the industry information channel.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.