Advertisement
Guest User

Untitled

a guest
May 9th, 2020
8
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.14 KB | None | 0 0
  1. 1. docker-compose.yaml:
  2. version: "3.8"
  3.  
  4. services:
  5. redis-1:
  6. build: ./redis-server
  7. volumes:
  8. - ./redis-server/conf/dev.conf:/usr/local/etc/redis/redis.conf
  9.  
  10. redis-2:
  11. build: ./redis-server
  12. volumes:
  13. - ./redis-server/conf/dev.conf:/usr/local/etc/redis/redis.conf
  14.  
  15. redis-3:
  16. build: ./redis-server
  17. volumes:
  18. - /home/h0tw4t3r/2-docker/redis-cluster/redis/conf/dev.conf:/usr/local/etc/redis/redis.conf
  19.  
  20. sentinel-1:
  21. build: ./redis-sentinel
  22. volumes:
  23. - ./redis-sentinel/conf:/bitnami/redis-sentinel/conf
  24. ports:
  25. - "26379:26379"
  26.  
  27. sentinel-2:
  28. build: ./redis-sentinel
  29. volumes:
  30. - ./redis-sentinel/conf:/bitnami/redis-sentinel/conf
  31. ports:
  32. - "26380:26379"
  33.  
  34. sentinel-3:
  35. build: ./redis-sentinel
  36. volumes:
  37. - ./redis-sentinel/conf:/bitnami/redis-sentinel/conf
  38. ports:
  39. - "26381:26379"
  40.  
  41. networks:
  42. default:
  43. name: redis_cluster
  44.  
  45. 2. Tree
  46. .
  47. ├── dev-rm.sh
  48. ├── dev-start.sh
  49. ├── docker-compose.yaml
  50. ├── prod-rm.sh
  51. ├── prod-start.sh
  52. ├── redis-sentinel
  53. │   ├── conf
  54. │   │   └── dev.conf
  55. │   └── Dockerfile
  56. └── redis-server
  57. ├── conf
  58. │   ├── dev.conf
  59. │   └── prod.conf
  60. └── Dockerfile
  61.  
  62. 4 directories, 10 files
  63.  
  64. 3. Sentinel Dockerfile
  65. # syntax=docker/dockerfile:latest
  66.  
  67. FROM bitnami/redis-sentinel
  68.  
  69. EXPOSE 6973/tcp
  70. ENTRYPOINT redis-sentinel /usr/local/etc/sentinel/sentinel.conf
  71.  
  72. 4. Result
  73. # docker-compose run sentinel-1
  74. 6:X 09 May 2020 14:06:53.215 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
  75. 6:X 09 May 2020 14:06:53.215 # Redis version=6.0.1, bits=64, commit=00000000, modified=0, pid=6, just started
  76. 6:X 09 May 2020 14:06:53.215 # Warning: no config file specified, using the default config. In order to specify a config file use redis-sentinel /path/to/sentinel.conf
  77. _._
  78. _.-``__ ''-._
  79. _.-`` `. `_. ''-._ Redis 6.0.1 (00000000/0) 64 bit
  80. .-`` .-```. ```\/ _.,_ ''-._
  81. ( ' , .-` | `, ) Running in sentinel mode
  82. |`-._`-...-` __...-.``-._|'` _.-'| Port: 26379
  83. | `-._ `._ / _.-' | PID: 6
  84. `-._ `-._ `-./ _.-' _.-'
  85. |`-._`-._ `-.__.-' _.-'_.-'|
  86. | `-._`-._ _.-'_.-' | http://redis.io
  87. `-._ `-._`-.__.-'_.-' _.-'
  88. |`-._`-._ `-.__.-' _.-'_.-'|
  89. | `-._`-._ _.-'_.-' |
  90. `-._ `-._`-.__.-'_.-' _.-'
  91. `-._ `-.__.-' _.-'
  92. `-._ _.-'
  93. `-.__.-'
  94.  
  95. 6:X 09 May 2020 14:06:53.219 # Sentinel started without a config file. Exiting...
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement