Skip to content
This repository has been archived by the owner on Jan 20, 2023. It is now read-only.

Lightwave Container

wfu8 edited this page Nov 22, 2016 · 1 revision

Lightwave supports container deployment. Lightwave container encapsulate all the necessary configurations that require for server/client to function, i.e. promoting a lightwave server when deploying a lightwave server container; joining a lightwave client when deploying a lightwave client container etc.

We also support lightwave container upgrade by separating business/data logic so that we can upgrade from one version to another properly preserving lightwave states.

Example shell script for promoting a docker container (single node with host networking) See example code

#!/bin/bash

systemctl start docker
systemctl enable docker

# Define Domain Parameters
LIGHTWAVE_DOMAIN='yourdomain.com'
LIGHTWAVE_PASSWORD='P@ssw0rd'
LIGHTWAVE_SITE='Default-first-site'

LIGHTWAVE_CONFIG_DIR='/var/lib/vmware/config'
LIGHTWAVE_CONFIG_PATH="${LIGHTWAVE_CONFIG_DIR}/lightwave-server.cfg"

# Optional: If using a custom container tar, load it into docker
# docker load < /tmp/vmware-lightwave-sts.tar
mkdir -p $LIGHTWAVE_CONFIG_DIR

# Create config file
cat <<END > $LIGHTWAVE_CONFIG_PATH
deployment=standalone
domain=$LIGHTWAVE_DOMAIN
admin=Administrator
password=$LIGHTWAVE_PASSWORD
site-name=$LIGHTWAVE_SITE
first-instance=true
hostname=\$(hostname -f)
END

# Start Container instance 
docker run -d --name lightwave --privileged --net=host \
            -v /sys/fs/cgroup:/sys/fs/cgroup:ro \
            -v $LIGHTWAVE_CONFIG_DIR:/var/lib/vmware/config \
            vmware/lightwave-sts

Example shell script for promoting a docker container (two nodes with bridged networking)

#!/bin/bash

systemctl start docker
systemctl enable docker

# Create docker network
docker network create \
    --subnet=192.168.114.0/27 \
    -o com.docker.network.bridge.enable_ip_masquerade=false \
    lightwave

# Define Domain Parameters
LIGHTWAVE_DOMAIN='yourdomain.com'
LIGHTWAVE_PASSWORD='P@ssw0rd'
LIGHTWAVE_SITE='Default-first-site'
LIGHTWAVE_CONFIG_DIR='/var/lib/vmware/config-lw-0'
LIGHTWAVE_CONFIG_PATH="${LIGHTWAVE_CONFIG_DIR}/lightwave-server.cfg"

systemctl start docker
# Optional: If using a custom container tar, load it into docker
# docker load < /tmp/vmware-lightwave-sts.tar
mkdir -p $LIGHTWAVE_CONFIG_DIR

# Create config file
cat <<END > $LIGHTWAVE_CONFIG_PATH
deployment=standalone
domain=$LIGHTWAVE_DOMAIN
admin=Administrator
password=$LIGHTWAVE_PASSWORD
site-name=$LIGHTWAVE_SITE
hostname=lw-0.$LIGHTWAVE_DOMAIN
first-instance=true
END

# Start First Container instance 
docker run -d \
       --name lightwave-lw-0 \
       --privileged \
       --net lightwave \
       --hostname lw-0.$LIGHTWAVE_DOMAIN \
       --ip 192.168.114.3 \
       --dns 192.168.114.3 \
       --dns-search $LIGHTWAVE_DOMAIN \
       -v /sys/fs/cgroup:/sys/fs/cgroup:ro \
       -v $LIGHTWAVE_CONFIG_DIR:/var/lib/vmware/config \
       vmware/lightwave-sts

# Add additional replica containers
LIGHTWAVE_PARTNER_IP=`docker inspect lightwave-lw-0| grep \"IPAddress\" | gawk '{print $2}' | sed 's/\"\(.*\)\",/\1/' | sed '/^$/d' | sort | uniq`
LIGHTWAVE_CONFIG_DIR=/var/lib/vmware/config-lw-2LIGHTWAVE_CONFIG_PATH=$LIGHTWAVE_CONFIG_DIR/lightwave-server.cfg

cat << EOF > $LIGHTWAVE_CONFIG_PATH
deployment=partner
domain=$LIGHTWAVE_DOMAIN
admin=Administrator
password=$LIGHTWAVE_PASSWORD
site-name=$LIGHTWAVE_SITE
first-instance=false
replication-partner-hostname=$LIGHTWAVE_PARTNER_IP
hostname=lw-1.$LIGHTWAVE_DOMAIN
EOF

# Start replica container
docker run -d \
       --name lightwave-lw-1 \
       --privileged \
       --net lightwave \
       --hostname lw-1.$LIGHTWAVE_DOMAIN \
       --ip 192.168.114.4 \
       --dns 192.168.114.3 \
       --dns-search $LIGHTWAVE_DOMAIN \
       -v /sys/fs/cgroup:/sys/fs/cgroup:ro \
       -v /var/lib/vmware/config2:/var/lib/vmware/config \
       vmware/lightwave-sts

Lightwave Container [Upgrade] (https://github.com/vmware/lightwave/blob/dev/STS- CONTAINER-UPGRADE-BACKUP-RESTORE.md)

Clone this wiki locally