当前位置:网站首页>Establishment of Eureka registration center Eureka server
Establishment of Eureka registration center Eureka server
2022-07-26 17:16:00 【Liu Chu, Ge Nian】
List of articles
1. build eureka-server
First of all, you need to register a central server :eureka-server, This must be an independent microservice , Enabled separately
1.1 establish eureka-server service
Under your parent project , Create a sub module :

Fill in the module information :
Then fill in the service information :
1.2 introduce eureka rely on
introduce SpringCloud by eureka Provided starter rely on :
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-netflix-eureka-server</artifactId>
</dependency>

1.3 Write the startup class
to eureka-server Write a startup class for the service , Be sure to add a @EnableEurekaServer annotation , Turn on eureka The registry function of :
package com.yyl.eureka;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.netflix.eureka.server.EnableEurekaServer;
@SpringBootApplication
@EnableEurekaServer
public class EurekaApplication {
public static void main(String[] args) {
SpringApplication.run(EurekaApplication.class, args);
}
}
1.4 Writing configuration files
Write a application.yml file , The contents are as follows :
server:
port: 10086
spring:
application:
name: eureka-server
eureka:
client:
service-url:
defaultZone: http://127.0.0.1:10086/eureka
1.5 Start the service
Start microservices , Then visit the :http://127.0.0.1:10086
See the following results should be successful :
边栏推荐
- Win11自动删除文件设置方法
- [express receives get, post, and route request parameters]
- The principle of reliable transmission in TCP protocol
- 极大似然估计
- [ctfshow web] deserialization
- Recurrence of historical loopholes in ThinkPHP
- Alibaba side: analysis of ten classic interview questions
- Stop supporting Huawei! Signing 640billion 5g orders in Germany and 270billion 5g orders in the Middle East is pure nonsense!
- After Oracle creates a table partition, the partition is not given during the query, but the value specified for the partition field will be automatically queried according to the partition?
- regular expression
猜你喜欢

Oracle创建表分区后,查询的时候不给出partition,但是会给分区字段指定的值,会不会自动按照分区查询?

IDEA 阿里云多模块部署
![37. [categories of overloaded operators]](/img/67/b821270079589c53b9c38b0ca033ac.png)
37. [categories of overloaded operators]

Can TCP and UDP use the same port?

Matlab论文插图绘制模板第40期—带偏移扇区的饼图

Win11怎么自动清理回收站?

Stop using xshell and try this more modern terminal connection tool

机器学习-什么是机器学习、监督学习和无监督学习

Pyqt5 rapid development and practice 3.4 signal and slot correlation
![Sharing of 40 completed projects of high-quality information management specialty [source code + Thesis] (VI)](/img/b9/629449d3c946b017075ed42eaa81bf.png)
Sharing of 40 completed projects of high-quality information management specialty [source code + Thesis] (VI)
随机推荐
接口比较器
Operating system migration practice: deploying MySQL database on openeuler
Win11怎么自动清理回收站?
什么是分布式定时任务框架?
In May, 2022, video user insight: user use time increased, and the platform achieved initial results in cost reduction and efficiency increase
How to use C language nested linked list to realize student achievement management system
【开发教程9】疯壳·ARM功能手机-I2C教程
[untitled]
极大似然估计
[flight control development basic tutorial 3] crazy shell · open source formation UAV - serial port (basic transceiver)
The first case in Guangdong! A company in Guangzhou was punished by the police for failing to fulfill its obligation of data security protection
Matlab paper illustration drawing template issue 40 - pie chart with offset sector
How to use different tools to analyze and optimize code performance when CPU utilization is high
[Luogu p8063] shortest paths (graph theory)
【无标题】
Tcpdump命令详解
After Australia, New Zealand announced the ban on Huawei 5g! Huawei official response
Are CRM and ERP the same thing? What's the difference?
浅谈云原生边缘计算框架演进
UPC 2022 summer personal training game 07 (part)