git clone [email protected]:wpCloud/docker-storage.git /opt/sources/wpCloud/docker-storage
service pull wpcloud/storage
fleetctl start docker/storage/static/storage.service
On machine in cluster:
sudo gluster peer probe ${NEW_HOST}
sudo gluster peer status
sudo gluster pool list
So if "10.151.10.208" machine was rebooted, after its back up, we need to "peer probe" it from one of the machines that is on, that will cause the restarted machine to rejoin.
If a machine was taken out from our wpCloud cluster completely but keeps hanging in the "peer list", remove it like so from any machine in cluster;
gluster peer detach 10.151.10.208
On new machine:
To make the Gluster directories show up in /var/storage run:
sudo mount -t glusterfs ${COREOS_PRIVATE_IPV4}:storage /var/storage
sudo mount -t glusterfs 10.151.10.208:/gluster/storage /var/storage
or
sudo mount -t glusterfs ${COREOS_PRIVATE_IPV4}:${GLUSTER_VOL} ${GLUSTER_VOL_MOUNT_PATH}
To get /var/data to work run:
sudo mount -t glusterfs ${COREOS_PRIVATE_IPV4}:/data /var/data
docker --host=unix:///var/run/dockerServices.sock rm -fv storage; docker --host=unix:///var/run/dockerServices.sock run -id \
--name=storage \
--net=host \
--memory=4g \
--privileged=true \
--volume=/etc/hosts:/etc/hosts:rw \
--volume=/home/core/.ssh:/home/core/.ssh \
--volume=/opt/storage:/opt/storage \
--env=COREOS_PUBLIC_IPV4=${COREOS_PUBLIC_IPV4} \
--env=COREOS_PRIVATE_IPV4=${COREOS_PRIVATE_IPV4} \
wpcloud/storage
docker --host=unix:///var/run/dockerServices.sock logs -ft storage;
sudo gluster volume list
Manually create/start a new volume:
sudo gluster volume create storage replica 2 transport tcp $(hostname -i):/gluster/storage2 10.0.0.0:/gluster/storage force
sudo gluster volume start storage
This seems to work if volume was lost for some reason but a /gluster/storage exists on the second machine (not sure if it matters if its on first.) After running the above command both machines will have the volume available on them and a sync starts. Existing Docker clients connected to this volume start working and don't need to be restarted themselves.
Content type
Image
Digest
sha256:fe01493cb…
Size
136.6 MB
Last updated
over 10 years ago
docker pull wpcloud/storage