docker-compose-cluster.yml 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195
  1. version: '2'
  2. services:
  3. zookeeper1:
  4. hostname: zookeeper1
  5. image: 'zookeeper'
  6. environment:
  7. ZOO_MY_ID: 1
  8. ZOO_SERVERS: server.1=zookeeper1:2888:3888 server.2=zookeeper2:2888:3888 server.3=zookeeper3:2888:3888
  9. zookeeper2:
  10. hostname: zookeeper2
  11. image: 'zookeeper'
  12. environment:
  13. ZOO_MY_ID: 2
  14. ZOO_SERVERS: server.1=zookeeper1:2888:3888 server.2=zookeeper2:2888:3888 server.3=zookeeper3:2888:3888
  15. zookeeper3:
  16. hostname: zookeeper3
  17. image: 'zookeeper'
  18. environment:
  19. ZOO_MY_ID: 3
  20. ZOO_SERVERS: server.1=zookeeper1:2888:3888 server.2=zookeeper2:2888:3888 server.3=zookeeper3:2888:3888
  21. kafka1:
  22. container_name: kafka1
  23. image: 'wurstmeister/kafka'
  24. ports:
  25. - 9091:9091
  26. environment:
  27. KAFKA_BROKER_ID: 1
  28. KAFKA_ADVERTISED_PORT: 9091
  29. KAFKA_AUTO_CREATE_TOPICS: "true"
  30. KAFKA_DELETE_TOPIC_ENABLE: "false"
  31. KAFKA_LOG_RETENTION_HOURS: 720
  32. KAFKA_NUM_PARTITIONS: 3
  33. KAFKA_REPLICATION_FACTOR: 3
  34. KAFKA_ZOOKEEPER_CONNECT: zookeeper1:2181,zookeeper2:2181,zookeeper3:2181
  35. KAFKA_LISTENERS: PLAINTEXT://kafka1:9091
  36. KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://kafka1:9091
  37. depends_on:
  38. - zookeeper1
  39. - zookeeper2
  40. - zookeeper3
  41. links:
  42. - 'zookeeper1'
  43. - 'zookeeper2'
  44. - 'zookeeper3'
  45. kafka2:
  46. container_name: kafka2
  47. image: 'wurstmeister/kafka'
  48. ports:
  49. - 9092:9092
  50. environment:
  51. KAFKA_BROKER_ID: 2
  52. KAFKA_ADVERTISED_PORT: 9092
  53. KAFKA_AUTO_CREATE_TOPICS: "true"
  54. KAFKA_DELETE_TOPIC_ENABLE: "false"
  55. KAFKA_LOG_RETENTION_HOURS: 720
  56. KAFKA_NUM_PARTITIONS: 3
  57. KAFKA_REPLICATION_FACTOR: 3
  58. KAFKA_ZOOKEEPER_CONNECT: zookeeper1:2181,zookeeper2:2181,zookeeper3:2181
  59. KAFKA_LISTENERS: PLAINTEXT://kafka2:9092
  60. KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://kafka2:9092
  61. depends_on:
  62. - zookeeper1
  63. - zookeeper2
  64. - zookeeper3
  65. links:
  66. - 'zookeeper1'
  67. - 'zookeeper2'
  68. - 'zookeeper3'
  69. kafka3:
  70. container_name: kafka3
  71. image: 'wurstmeister/kafka'
  72. ports:
  73. - 9093:9093
  74. environment:
  75. KAFKA_BROKER_ID: 3
  76. KAFKA_ADVERTISED_PORT: 9093
  77. KAFKA_AUTO_CREATE_TOPICS: "true"
  78. KAFKA_DELETE_TOPIC_ENABLE: "false"
  79. KAFKA_LOG_RETENTION_HOURS: 720
  80. KAFKA_NUM_PARTITIONS: 3
  81. KAFKA_REPLICATION_FACTOR: 3
  82. KAFKA_ZOOKEEPER_CONNECT: zookeeper1:2181,zookeeper2:2181,zookeeper3:2181
  83. KAFKA_LISTENERS: PLAINTEXT://kafka3:9093
  84. KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://kafka3:9093
  85. depends_on:
  86. - zookeeper1
  87. - zookeeper2
  88. - zookeeper3
  89. links:
  90. - 'zookeeper1'
  91. - 'zookeeper2'
  92. - 'zookeeper3'
  93. redis:
  94. image: 'docker.finogeeks.club/finochat/dendrite-redis'
  95. ports:
  96. - 6379:6379
  97. #volumes:
  98. #- /mnt/data/dendrite/redis/db:/data
  99. #- /root/dendrite/db:/data
  100. #- /Users/taoruifu/work/fino/chat/dendrite/db:/data
  101. #- /Users/huguanrui/git/src/github.com/matrix-org/dendrite/db:/data
  102. #- /Users/teril/GolandProjects/finochat/dendrite/db:/data
  103. #- /Users/fadeace/GolandProjects/dendrite/db:/data
  104. #- /Users/tom/Documents/dendrite/db:/opt/redis/data
  105. #- /Users/huguanrui/git/src/github.com/matrix-org/dendrite/db:/data
  106. pg-master:
  107. image: 'docker.finogeeks.club/finochat/dendrite-db'
  108. #command: 'postgres -c max_connections=1000 -c shared_buffers=2048MB -c temp_buffers=1024MB -c work_mem=128MB -c maintenance_work_mem=1024MB -c fsync=off -c commit_delay=10 -c commit_siblings=100 -c max_wal_size=4GB'
  109. environment:
  110. POSTGRES_USER: 'postgres'
  111. POSTGRES_PASSWORD: 'postgres'
  112. POSTGRES_DB: 'postgres'
  113. PGDATA: '/var/lib/postgresql/data'
  114. REDIS_SERVER: 'redis'
  115. #network_mode: host
  116. depends_on:
  117. - redis
  118. #ports:
  119. #- 15432:5432
  120. #volumes:
  121. #- /mnt/data/dendrite/pg-master/data:/var/lib/postgresql/data
  122. links:
  123. - 'redis'
  124. pg-slave:
  125. image: 'docker.finogeeks.club/finochat/dendrite-db'
  126. #command: 'postgres -c max_connections=1000 -c shared_buffers=2048MB -c temp_buffers=1024MB -c work_mem=128MB -c maintenance_work_mem=1024MB -c fsync=off -c commit_delay=10 -c commit_siblings=100 -c max_wal_size=4GB'
  127. environment:
  128. POSTGRES_USER: 'postgres'
  129. POSTGRES_PASSWORD: 'postgres'
  130. POSTGRES_DB: 'postgres'
  131. PGDATA: '/var/lib/postgresql/data'
  132. REPLICATE_FROM: 'pg-master'
  133. depends_on:
  134. - pg-master
  135. #ports:
  136. #- 15431:5432
  137. #volumes:
  138. #- /mnt/data/dendrite/pg-slave/data:/var/lib/postgresql/data
  139. links:
  140. - 'pg-master'
  141. nats:
  142. image: 'docker.finogeeks.club/finochat/nats'
  143. ports:
  144. - 4222:4222
  145. pg-pool:
  146. image: 'docker.finogeeks.club/finochat/pgpool'
  147. environment:
  148. PG_PRIMARY_SERVICE_NAME: 'pg-master'
  149. PG_REPLICA_SERVICE_NAME: 'pg-slave'
  150. PG_USERNAME: 'dendrite'
  151. PG_PASSWORD: 'finochat'
  152. #PG_DATABASE: 'dendrite_roomserver'
  153. depends_on:
  154. - pg-master
  155. - pg-slave
  156. ports:
  157. - 15432:5432
  158. #volumes:
  159. #- ./config/pgpool.conf:/pgconf/pgpoolconfigdir/pgpool.conf
  160. #- ./config/pool_hba.conf:/pgconf/pgpoolconfigdir/pool_hba.conf
  161. #- ./config/pool_passwd:/pgconf/pgpoolconfigdir/pool_passwd
  162. links:
  163. - 'pg-master'
  164. # push-service:
  165. # image: "docker.finogeeks.club/finochat/push-service:1.1.3"
  166. # privileged: true
  167. # environment:
  168. # prometheus_multiproc_dir: prometheus
  169. # staff_ios_appid: com.finogeeks.finchat.oa
  170. # staff_apns_pem: https://finogeeks:fino123321@git.finogeeks.club/catalog/finochat/raw/master/templates/finochat/apns_finochat.pem
  171. # retail_ios_appid: com.finogeeks.finchat
  172. # retail_apns_pem: https://finogeeks:fino123321@git.finogeeks.club/catalog/finochat/raw/master/templates/finochat/apns_finchat.pem
  173. # ports:
  174. # - 5000:5000
  175. # dendrite:
  176. # image: docker.finogeeks.club/finochat/dendrite
  177. # ports:
  178. # - 8008:8008
  179. # - 8448:8448
  180. # environment:
  181. # CFG: "test"
  182. # volumes:
  183. # - /Users/huguanrui/git/src/github.com/matrix-org/dendrite/log:/opt/dendrite/log
  184. # depends_on:
  185. # - pg-pool
  186. # - kafka
  187. # - zookeeper
  188. # - nats
  189. # links:
  190. # - 'pg-master'
  191. # - 'kafka'
  192. # - 'zookeeper'
  193. # - 'nats'