eruke注册中心搭建
配置pom.xml
-
<dependencyManagement>
-
<dependencies>
-
<dependency>
-
<groupId>org.springframework.cloud</groupId>
-
<artifactId>spring-cloud-netflix</artifactId>
-
<version>1.0.7.RELEASE</version>
-
<type>pom</type>
-
<scope>import</scope>
-
</dependency>
-
</dependencies>
-
</dependencyManagement>
-
<dependencies>
-
<dependency>
-
<groupId>org.springframework.cloud</groupId>
-
<artifactId>spring-cloud-starter-eureka-server</artifactId>
-
</dependency>
-
<!--表示为web工程-->
-
<dependency>
-
<groupId>org.springframework.boot</groupId>
-
<artifactId>spring-boot-starter-web</artifactId>
-
</dependency>
-
<!--暴露各种指标-->
-
<dependency>
-
<groupId>org.springframework.boot</groupId>
-
<artifactId>spring-boot-starter-actuator</artifactId>
-
</dependency>
-
</dependencies>
-
<repositories>
-
<repository>
-
<id>spring-milestones</id>
-
<name>Spring Milestones</name>
-
<url>http://repo.spring.io/milestone</url>
-
<snapshots>
-
<enabled>false</enabled>
-
</snapshots>
-
</repository>
-
</repositories>
-
<pluginRepositories>
-
<pluginRepository>
-
<id>spring-milestones</id>
-
<name>Spring Milestones</name>
-
<url>http://repo.spring.io/milestone</url>
-
<snapshots>
-
<enabled>false</enabled>
-
</snapshots>
-
</pluginRepository>
-
</pluginRepositories>
-
<build>
-
<plugins>
-
<plugin>
-
<groupId>org.springframework.boot</groupId>
-
<artifactId>spring-boot-maven-plugin</artifactId>
-
</plugin>
-
</plugins>
-
</build>
配置properties.
取消其客户端的属性,只作为服务端
-
server:
-
port: 8761
-
eureka:
-
instance:
-
hostname: localhost
-
client:
-
registerWithEureka: false
-
fetchRegistry: false
-
serviceUrl:
-
defaultZone: http://${eureka.instance.hostname}:${server.port}/eureka/
配置启动类
-
/**
-
* eureka-server
-
* @author WangD
-
*
-
*/
-
@EnableEurekaServer
-
@SpringBootApplication
-
public class CloudAplication {
-
/** 开启程序 */
-
public static void main(String[] args) {
-
SpringApplication.run(CloudAplication.class, args);
-
}
-
}
修改其注册服务中心界面
将其jar包里面的templete模板和js,images服务放入自己的resources下面自定义修改ftl模板