application.yaml 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. spring.profiles.active: dev
  2. spring:
  3. cache:
  4. guava:
  5. spec: expireAfterWrite=30s
  6. datasource:
  7. driver-class-name: com.mysql.jdbc.Driver
  8. # Keep the connection alive if idle for a long time (needed in production)
  9. testWhileIdle: true
  10. validationQuery: SELECT 1
  11. # Show or not log for each sql query
  12. jpa:
  13. show-sql: true
  14. # Hibernate ddl auto (create, create-drop, update)
  15. hibernate:
  16. ddl-auto: validate
  17. #hbm2ddl.auto: update
  18. # Naming strategy
  19. naming-strategy: org.hibernate.cfg.ImprovedNamingStrategy
  20. # The SQL dialect makes Hibernate generate better SQL for the chosen database
  21. properties.hibernate.dialect: org.hibernate.dialect.MySQL5Dialect
  22. ---
  23. # 开发环境
  24. spring:
  25. profiles: dev
  26. datasource:
  27. url: jdbc:mysql://127.0.0.1:3306/mooctest_user?useUnicode=yes&characterEncoding=UTF-8
  28. username: root
  29. password: zhangxin
  30. dubbo:
  31. application.name: user-service-provider
  32. registry.address: zookeeper://118.178.131.206:2181
  33. protocol.name: dubbo
  34. protocol.port: 20900
  35. # protocol.host: 127.0.0.1
  36. scan: cn.iselab.mooctest.user.rpc
  37. monitor.protocal: registry
  38. provider.timeout: 120000
  39. # provider.retries: 0
  40. server:
  41. port: 8081
  42. logging.config: classpath:log4j2.yaml
  43. ---
  44. # 测试服务环境
  45. spring:
  46. profiles: test
  47. datasource:
  48. url: jdbc:mysql://127.0.0.1:3306/mooctest_user # please modify manually
  49. username: test-username # please modify manually
  50. password: test-password # please modify manually
  51. dubbo:
  52. application.name: user-service-provider
  53. registry.address: zookeeper://127.0.0.1:2181
  54. protocol.name: dubbo
  55. protocol.port: 20878
  56. protocol.host: 127.0.0.1
  57. scan: cn.iselab.mooctest.user.rpc
  58. monitor.protocal: registry
  59. provider.timeout: 120000
  60. provider.retries: 0
  61. logging.config: classpath:log4j2.test.yaml
  62. logging.access.directory: /home/share/log
  63. spring.jpa.show-sql: false
  64. ---
  65. # 线上服务环境
  66. spring:
  67. profiles: online
  68. datasource:
  69. url: jdbc:mysql://127.0.0.1:3306/mooctest_user?useUnicode=yes&characterEncoding=UTF-8
  70. username: mooctest
  71. password: secr3t!
  72. dubbo:
  73. application.name: user-service-provider
  74. registry.address: zookeeper://118.178.131.206:2181
  75. protocol.name: dubbo
  76. protocol.port: 20890
  77. protocol.host:
  78. scan: cn.iselab.mooctest.user.rpc
  79. monitor.protocal: registry
  80. provider.timeout: 120000
  81. provider.retries: 0
  82. server:
  83. port: 8088
  84. logging.config: classpath:log4j2.online.yaml
  85. logging.access.directory: /home/share/log
  86. spring.jpa.show-sql: false