Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Running Spring Clound Config and Eureka on same server

We are trying to create a dashboard for our application as a single point of entry/configuration. For this we will build and UI and would like to run Spring Cloud Config and Eureka on same instance. Is there any reason why we should not do this and if not is it possible?

like image 382
mvlupan Avatar asked Jan 07 '23 06:01

mvlupan


1 Answers

@mvlupan, there is nothing keeping you from using together. That is one of the reasons we created @EnableEurekaServer and @EnableConfigServer.

pom.xml snippet.

<parent>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-parent</artifactId>
    <version>1.2.7.RELEASE</version>
    <relativePath/> <!-- lookup parent from repository -->
</parent>

<dependencies>
    <dependency>
        <groupId>org.springframework.cloud</groupId>
        <artifactId>spring-cloud-config-server</artifactId>
    </dependency>
    <dependency>
        <groupId>org.springframework.cloud</groupId>
        <artifactId>spring-cloud-starter-eureka-server</artifactId>
    </dependency>
</dependencies>

Application.java snippet

@EnableEurekaServer
@EnableConfigServer
@SpringBootApplication
public class DemoconfigandeurekaserverApplication { /*...*/}

application.properties snippet (so eureka and config server don't clash).

spring.cloud.config.server.prefix=/config
like image 63
spencergibb Avatar answered Jan 26 '23 19:01

spencergibb