Here is the compose file on rancher that actually works:
It’s different in the sense that it knows how to assign public and private IPs to eventstore configuration, and uses labels to assign specific nodes to specific hosts.
version: ‘2’
services:
eventstore3:
image: eventstore/eventstore:release-4.0.3
environment:
EVENTSTORE_CLUSTER_DNS: eventstore1
EVENTSTORE_CLUSTER_GOSSIP_PORT: ‘2112’
EVENTSTORE_CLUSTER_SIZE: ‘3’
EVENTSTORE_EXT_HTTP_PORT: ‘2113’
EVENTSTORE_EXT_HTTP_PREFIXES: http://*:2113/
EVENTSTORE_EXT_TCP_PORT: ‘1113’
EVENTSTORE_INT_HTTP_PORT: ‘2112’
EVENTSTORE_INT_HTTP_PREFIXES: http://*:2112/
EVENTSTORE_INT_TCP_PORT: ‘1112’
EVENTSTORE_RUN_PROJECTIONS: All
EVENTSTORE_START_STANDARD_PROJECTIONS: ‘True’
entrypoint:
volumes:
ports:
-
2113:2113/tcp
-
1113:1113/tcp
command:
&& grep -q -F “IntIpAdvertiseAs: $$(hostname -i)” /etc/eventstore/eventstore.conf ||
echo “IntIpAdvertiseAs: $$(hostname -i)” >> /etc/eventstore/eventstore.conf &&
grep -q -F “ExtIpAdvertiseAs: $$HOST_PUBLIC_IP” /etc/eventstore/eventstore.conf ||
echo “ExtIpAdvertiseAs: $$HOST_PUBLIC_IP” >> /etc/eventstore/eventstore.conf
&& /entrypoint.sh’
labels:
io.rancher.scheduler.affinity:host_label: eventstore=eventstore3
io.rancher.scheduler.global: ‘true’
eventstore1:
image: eventstore/eventstore:release-4.0.3
environment:
EVENTSTORE_CLUSTER_DNS: eventstore1
EVENTSTORE_CLUSTER_GOSSIP_PORT: ‘2112’
EVENTSTORE_CLUSTER_SIZE: ‘3’
EVENTSTORE_EXT_HTTP_PORT: ‘2113’
EVENTSTORE_EXT_HTTP_PREFIXES: http://*:2113/
EVENTSTORE_EXT_TCP_PORT: ‘1113’
EVENTSTORE_INT_HTTP_PORT: ‘2112’
EVENTSTORE_INT_HTTP_PREFIXES: http://*:2112/
EVENTSTORE_INT_TCP_PORT: ‘1112’
EVENTSTORE_RUN_PROJECTIONS: All
EVENTSTORE_START_STANDARD_PROJECTIONS: ‘True’
entrypoint:
volumes:
ports:
-
2113:2113/tcp
-
1113:1113/tcp
command:
&& grep -q -F “IntIpAdvertiseAs: $$(hostname -i)” /etc/eventstore/eventstore.conf ||
echo “IntIpAdvertiseAs: $$(hostname -i)” >> /etc/eventstore/eventstore.conf &&
grep -q -F “ExtIpAdvertiseAs: $$HOST_PUBLIC_IP” /etc/eventstore/eventstore.conf ||
echo “ExtIpAdvertiseAs: $$HOST_PUBLIC_IP” >> /etc/eventstore/eventstore.conf
&& /entrypoint.sh’
labels:
io.rancher.scheduler.affinity:host_label: eventstore=eventstore1
io.rancher.scheduler.global: ‘true’
eventstore2:
image: eventstore/eventstore:release-4.0.3
environment:
EVENTSTORE_CLUSTER_DNS: eventstore1
EVENTSTORE_CLUSTER_GOSSIP_PORT: ‘2112’
EVENTSTORE_CLUSTER_SIZE: ‘3’
EVENTSTORE_EXT_HTTP_PORT: ‘2113’
EVENTSTORE_EXT_HTTP_PREFIXES: http://*:2113/
EVENTSTORE_EXT_TCP_PORT: ‘1113’
EVENTSTORE_INT_HTTP_PORT: ‘2112’
EVENTSTORE_INT_HTTP_PREFIXES: http://*:2112/
EVENTSTORE_INT_TCP_PORT: ‘1112’
EVENTSTORE_RUN_PROJECTIONS: All
EVENTSTORE_START_STANDARD_PROJECTIONS: ‘True’
entrypoint:
volumes:
ports:
-
2113:2113/tcp
-
1113:1113/tcp
command:
&& grep -q -F “IntIpAdvertiseAs: $$(hostname -i)” /etc/eventstore/eventstore.conf ||
echo “IntIpAdvertiseAs: $$(hostname -i)” >> /etc/eventstore/eventstore.conf &&
grep -q -F “ExtIpAdvertiseAs: $$HOST_PUBLIC_IP” /etc/eventstore/eventstore.conf ||
echo “ExtIpAdvertiseAs: $$HOST_PUBLIC_IP” >> /etc/eventstore/eventstore.conf
&& /entrypoint.sh’
labels:
io.rancher.scheduler.affinity:host_label: eventstore=eventstore2
io.rancher.scheduler.global: ‘true’