当前位置:网站首页>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 :
边栏推荐
- Is the rolling update of pod similar to Canary deployment or blue-green deployment?
- 2022 年有哪些流行的技术?
- How can win11 system be reinstalled with one click?
- Sharing of 40 completed projects of high-quality information management specialty [source code + Thesis] (VI)
- Using MySQL master-slave replication delay to save erroneously deleted data
- [basic course of flight control development 2] crazy shell · open source formation UAV - timer (LED flight information light and indicator light flash)
- 导数、微分、偏导数、全微分、方向导数、梯度的定义与关系
- Win11怎么重新安装系统?
- Quickly build a development platform for enterprise applications
- Analysis of the advantages of eolink and JMeter interface testing
猜你喜欢

The principle of reliable transmission in TCP protocol

【开发教程7】疯壳·开源蓝牙心率防水运动手环-电容触摸

Pyqt5 rapid development and practice 3.4 signal and slot correlation

Method and voltage setting of exciting vibrating wire sensor with hand-held vibrating wire collector

Alibaba Cloud Toolkit —— 项目一键部署工具

2022-2023 topic recommendation of information management graduation project
![[ctfshow web] deserialization](/img/cd/b76e148adfc4d61049ab2cf429d4d7.png)
[ctfshow web] deserialization

2022-2023 信息管理毕业设计选题题目推荐
![[Development Tutorial 9] crazy shell arm function mobile phone-i2c tutorial](/img/9d/2a1deca934e6d56d729922b1d9e515.png)
[Development Tutorial 9] crazy shell arm function mobile phone-i2c tutorial

Marketing guide | several common micro blog marketing methods
随机推荐
营销指南 | 几种常见的微博营销打法
Method and voltage setting of exciting vibrating wire sensor with hand-held vibrating wire collector
抓包与发流软件与网络诊断
Can TCP and UDP use the same port?
Batch normalization batch_ normalization
After Australia, New Zealand announced the ban on Huawei 5g! Huawei official response
京东三面:我要查询千万级数据量的表,怎么操作?
37.【重载运算符的类别】
Redis persistence - detailed analysis of RDB source code | nanny level analysis! The most complete network
Implementing DDD based on ABP -- aggregation and aggregation root practice
极大似然估计
6种方法帮你搞定SimpleDateFormat类不是线程安全的问题
PXE efficient batch network installation
Is it safe for Guosen Securities to open an account? How can I find the account manager
Definition and relationship of derivative, differential, partial derivative, total derivative, directional derivative and gradient
[Luogu p8063] shortest paths (graph theory)
It turns out that cappuccino information security association does this. Let's have a look.
中金证券vip账户找谁开安全啊?
[daily3] vgg16 learning
Current limiting comparison: how to choose sentinel vs hystrix?