浏览代码

天津注册中心初始化

larry 5 年之前
父节点
当前提交
01d85ef693
共有 3 个文件被更改,包括 59 次插入10 次删除
  1. 8 0
      LICENSE
  2. 7 1
      README.md
  3. 44 9
      src/main/resources/application.yml

+ 8 - 0
LICENSE

@@ -0,0 +1,8 @@
1
+MIT License
2
+Copyright (c) <year> <copyright holders>
3
+
4
+Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
5
+
6
+The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
7
+
8
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

+ 7 - 1
README.md

@@ -1,3 +1,4 @@
1
+<<<<<<< HEAD
1 2
 ## spring-cloud-eureka-server
2 3
 
3 4
 这是一个公共的服务注册中心项目
@@ -5,4 +6,9 @@
5 6
 地址为 localhost:9001  您也可以进行修改。
6 7
 
7 8
 如果您想做到高可用,那么请复制一份代码进行相互注册。eureka 会自动将本工程数据复制到注册的的eureka中。
8
-例如您可以这么做: 三台:A->B->C->A   两台:A<->B
9
+例如您可以这么做: 三台:A->B->C->A   两台:A<->B
10
+=======
11
+# depot-eureka-tianjin
12
+
13
+注册中心eureka
14
+>>>>>>> 7cf65c3710626fd146d101c33ca906aea622db40

+ 44 - 9
src/main/resources/application.yml

@@ -1,18 +1,53 @@
1
+spring:
2
+  profiles:
3
+    active: local_dev
1 4
 server:
2
-  port: 9001
3
-
5
+  port: 9811
6
+---
7
+# 本地开发环境
8
+spring:
9
+  profiles: local_dev
10
+#eurekaServer
11
+eureka:
12
+  instance:
13
+    prefer-ip-address: true
14
+    # 仅测试使用,部署上线不使用
15
+    status-page-url-path: /swagger-ui.html
16
+  client:
17
+    register-with-eureka: false
18
+    fetch-registry: false
19
+    service-url:
20
+      defaultZone: http://172.16.0.4:9811/eureka/
21
+  server:
22
+    # 关闭自我保护机制(不关闭会在所有服务连接异常85%后不在注销服务)
23
+    enable-self-preservation: false
24
+    # 每隔30s扫描服务列表,移除失效服务(默认60000)
25
+    eviction-interval-timer-in-ms: 30000
26
+management:
27
+  endpoints:
28
+    web:
29
+      exposure:
30
+        include: '*'
31
+#  endpoint:
32
+#    health:
33
+#      show-details: always
34
+---
35
+# 部署环境
4 36
 spring:
5
-  application:
6
-    name: eureka
7
-# register-with-eureka  自身并不注册到自身,eureka 是一个服务端,但又是一个客户端.所以需要关闭自注册
37
+  profiles: prod
8 38
 eureka:
39
+  instance:
40
+    prefer-ip-address: true
9 41
   client:
10 42
     register-with-eureka: false
11 43
     fetch-registry: false
12 44
     service-url:
13
-      defaultZone: http://localhost:9001/eureka
14
-  # server.enable-self-preservation 关闭自我保护,默认为true。 开发环境可以这样设置,生成环境需要设置为true
45
+      defaultZone: http://${spring.cloud.client.ip-address}:${server.port}/eureka/
15 46
   server:
16 47
     enable-self-preservation: false
17
-logging:
18
-  path: ./log
48
+    eviction-interval-timer-in-ms: 30000
49
+management:
50
+  endpoints:
51
+    web:
52
+      exposure:
53
+        include: '*'