Sign inSign up

wpcloud/storage

By wpcloud

•Updated over 10 years ago

Image
0

1.4K

wpcloud/storage repository overview

⁠Notes

  • If a container is started but no volume exists for it, the container's mount must be reran once the volume is created.
  • However, if a container is connected to a volume but then the service goes away, gluster will reconnect to the volume once the service returns.
⁠Starting Production Service
git clone [email protected]:wpCloud/docker-storage.git /opt/sources/wpCloud/docker-storage
service pull wpcloud/storage
fleetctl start  docker/storage/static/storage.service
⁠Manually Starting Gluster 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.

⁠Removing Peer

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
⁠Starting Development Service
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;
⁠Volumes
sudo gluster volume list
⁠Notes

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.

Tag summary

Content type

Image

Digest

sha256:fe01493cb…

Size

136.6 MB

Last updated

over 10 years ago

docker pull wpcloud/storage