Leave a Comment
docker-compose example for ceph, kafka, postgres cluster
That is how it can be done:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 |
# BEFORE FIRST START # sudo mkdir -p /private/var/lib/my-api/postgresql && sudo chmod 0777 /private/var/lib/my-api/postgresql # $ createdb my_user -h localhost -p 6432 -U my_user # $ psql -h localhost -p 6432 -U my_user < ./master.sql # $ createdb my_user -h localhost -p 6433 -U my_user # $ psql -h localhost -p 6433 -U my_user < ./shard_full.sql # # To clear db data just do this: # rm -rf /private/var/lib/my-api/postgresql version: '3.2' services: dbmaster: image: postgres restart: always volumes: - type: bind source: /private/var/lib/my-api/postgresql/master target: /var/lib/postgresql - type: bind source: /private/var/lib/my-api/postgresql/master/data target: /var/lib/postgresql/data ports: - "6432:5432" environment: POSTGRES_USER: my_user POSTGRES_PASSWORD: pass POSTGRES_DB: my_user dbshard: image: postgres restart: always volumes: - type: bind source: /private/var/lib/my-api/postgresql/shard target: /var/lib/postgresql - type: bind source: /private/var/lib/my-api/postgresql/shard/data target: /var/lib/postgresql/data ports: - "6433:5432" environment: POSTGRES_USER: my_user POSTGRES_PASSWORD: pass POSTGRES_DB: platform_chat_api kafka: image: wurstmeister/kafka ports: - "9092:9092" - "7203:7203" links: - zookeeper:zk environment: KAFKA_ADVERTISED_HOST_NAME: 127.0.0.1 KAFKA_ZOOKEEPER_CONNECT: zk:2181 KAFKA_ADVERTISED_PORT: 9092 zookeeper: image: wurstmeister/zookeeper ports: - "2181:2181" ceph: image: qnib/ceph-mono ports: - "7480:7480" - "8500:8500" |
Similar Posts
LEAVE A COMMENT
Для отправки комментария вам необходимо авторизоваться.