docker-compose.redis-sentinel.yml 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. #
  2. # Copyright © 2016-2023 The Thingsboard Authors
  3. #
  4. # Licensed under the Apache License, Version 2.0 (the "License");
  5. # you may not use this file except in compliance with the License.
  6. # You may obtain a copy of the License at
  7. #
  8. # http://www.apache.org/licenses/LICENSE-2.0
  9. #
  10. # Unless required by applicable law or agreed to in writing, software
  11. # distributed under the License is distributed on an "AS IS" BASIS,
  12. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. # See the License for the specific language governing permissions and
  14. # limitations under the License.
  15. #
  16. version: '3.0'
  17. services:
  18. # Redis sentinel
  19. redis-master:
  20. image: 'bitnami/redis:7.0'
  21. volumes:
  22. - ./tb-node/redis-sentinel-data-master:/bitnami/redis/data
  23. environment:
  24. - 'REDIS_REPLICATION_MODE=master'
  25. - 'REDIS_PASSWORD=thingsboard'
  26. redis-slave:
  27. image: 'bitnami/redis:7.0'
  28. volumes:
  29. - ./tb-node/redis-sentinel-data-slave:/bitnami/redis/data
  30. environment:
  31. - 'REDIS_REPLICATION_MODE=slave'
  32. - 'REDIS_MASTER_HOST=redis-master'
  33. - 'REDIS_MASTER_PASSWORD=thingsboard'
  34. - 'REDIS_PASSWORD=thingsboard'
  35. depends_on:
  36. - redis-master
  37. redis-sentinel:
  38. image: 'bitnami/redis-sentinel:7.0'
  39. volumes:
  40. - ./tb-node/redis-sentinel-data-sentinel:/bitnami/redis/data
  41. environment:
  42. - 'REDIS_MASTER_HOST=redis-master'
  43. - 'REDIS_MASTER_SET=mymaster'
  44. - 'REDIS_SENTINEL_PASSWORD=sentinel'
  45. - 'REDIS_MASTER_PASSWORD=thingsboard'
  46. depends_on:
  47. - redis-master
  48. - redis-slave
  49. # ThingsBoard setup to use redis-sentinel
  50. tb-core1:
  51. env_file:
  52. - cache-redis-sentinel.env
  53. depends_on:
  54. - redis-sentinel
  55. tb-core2:
  56. env_file:
  57. - cache-redis-sentinel.env
  58. depends_on:
  59. - redis-sentinel
  60. tb-rule-engine1:
  61. env_file:
  62. - cache-redis-sentinel.env
  63. depends_on:
  64. - redis-sentinel
  65. tb-rule-engine2:
  66. env_file:
  67. - cache-redis-sentinel.env
  68. depends_on:
  69. - redis-sentinel
  70. tb-mqtt-transport1:
  71. env_file:
  72. - cache-redis-sentinel.env
  73. depends_on:
  74. - redis-sentinel
  75. tb-mqtt-transport2:
  76. env_file:
  77. - cache-redis-sentinel.env
  78. depends_on:
  79. - redis-sentinel
  80. tb-http-transport1:
  81. env_file:
  82. - cache-redis-sentinel.env
  83. depends_on:
  84. - redis-sentinel
  85. tb-http-transport2:
  86. env_file:
  87. - cache-redis-sentinel.env
  88. depends_on:
  89. - redis-sentinel
  90. tb-coap-transport:
  91. env_file:
  92. - cache-redis-sentinel.env
  93. depends_on:
  94. - redis-sentinel
  95. tb-lwm2m-transport:
  96. env_file:
  97. - cache-redis-sentinel.env
  98. depends_on:
  99. - redis-sentinel
  100. tb-snmp-transport:
  101. env_file:
  102. - cache-redis-sentinel.env
  103. depends_on:
  104. - redis-sentinel
  105. tb-vc-executor1:
  106. env_file:
  107. - cache-redis-sentinel.env
  108. depends_on:
  109. - redis-sentinel
  110. tb-vc-executor2:
  111. env_file:
  112. - cache-redis-sentinel.env
  113. depends_on:
  114. - redis-sentinel