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

Deploy Lightwave on GCE

asakhardande edited this page May 31, 2017 · 39 revisions

Pre-requisites

  • Please follow GCE's gcloud SDK install guide @ https://cloud.google.com/sdk/downloads so that you can manipulate your GCE VM instances with gcloud CLIs including establishing SSH connections to your GCE VM instances.
  • Useful tips: If you happen to forget your passphrase you set to access your SSH key for gcloud compute engine, you may go to $HOME/.ssh directory and remove the files named 'google_compute_engin' and 'google_compute_engine.pub', and issue your 'gcloud ssh' command, which will run through set up passphrase, upload your ssh pub to GCE etc. to update everything.

With Photon OS

1. Set up firewall rules

Only needed if the servers needs to be accessed externally, (by default GCF allow all internal traffic within the VPC)

  • Open lightwave ports - by allowing Ingress connections to following ports udp:53;tcp:53;udp:389; tcp:389; udp:636; tcp:636;tcp:443;udp:88; tcp:88; tcp:2012; tcp:2014; tcp:2020

2. Upload PhotonOS base image built for GCE

Log in to your GCE account and create a project, i.e. named 'lightwave domain'. Go to https://vmware.github.io/photon/ to download PhotonOS image built for GCE and upload it your GCE project. This includes two steps:

  • Upload image to Google Storage: go to 'Storage' to create a bucket under your project and upload your image there.
  • Create customer image: go to 'images' and select 'create an image', where you choose 'cloud storage file' and pick the PhotonOs image you upload previously.

3. Launch a PhotonOS instance

Browse to 'Compute Engine' -> 'VM instances' -> 'CREATE INSTANCE', from where we will set up lightwave domain with first domain controller, i.e. 'lightwave-dc01' and subsequent domain replica, i.e. 'lightwave-dc02' etc.

You should be able to choose '1G' memory, and make sure you choose 'customer image' and browse to your project and choose the PhotonOS image you uploaded in step 2. Click to enable 'http/https'.

4. Set the hostname for the instance

Next, click on the VM instance launched in step 3 and click 'edit' and browse to "Custom metadata" and add two properties:

hostname = FQDN of your host, for instance, "lw-dc01.photon.local' 

Set the following in the startup script section

hostname $(curl --silent http://metadata.google.internal/computeMetadata/v1/instance/attributes/hostname" -H     "Metadata-Flavor: Google")

5. Configure your instance with the right hostname

In this section, we will login to our newly formed instance and configure the hostname correctly

  • ssh into the newly formed instance

    $ sudo su
    
  • Remove docker packages from the photon os instance Run following commands to remove docker from the vm instance.

    # systemctl stop docker 
    # systemctl disable docker
    # tdnf remove docker 
    # ip link del docker0
    
  • Set the hostname using the following command

    # hostnamectl set-hostname lw-dc01
    
  • Update the /etc/hosts file with the following entry

    (use ifconfig to determine your instance's ip address)

      10.138.0.6 lw-dc01.lightwave.local lw-dc01
    
  • Verify that the instance records the short name and fqdn correctly

      # hostname 
        lw-dc01
    
      # hostname -f
        lw-dc01.photon.local
    
  • Set the nameserver to be yourself. Edit /etc/resolv.conf

      nameserver 10.138.0.6
    
  • Restart systemd-networkd and systemd-resolved

      systemctl restart systemd-networkd; systemctl restart systemd-resolved
    

6. Install lightwave

Connect to your VM instance, and run 'sudo su' to be root.

sudo su 
tdnf makecache
tdnf install -y commons-daemon-1.0.15-8.ph1 openjre-1.8.0.112 apache-tomcat-8.5.8 (Require a specific version of 3rd dependency will be fixed in future lightwave server release)
tdnf install -y vmware-lightwave-server-1.2.0

7. Promote your first lightwave domain controller

/opt/vmware/bin/configure-lightwave-server --domain <domain name> --password <password>

8. Deploy 2nd lightwave instance joining to lightwave domain

Repeat Step 3, 4, 5 and 6 where we install and configure another instance.

9. Promote your second lightwave domain controller

/opt/vmware/bin/configure-lightwave-server --domain <domain name>  --password <password> --server <1st_lightwave_server_fqdn>

You can choose to bring up more lightwave domain controllers in the same lightwave domain by repeating step 8 and 9 above.

With Ubuntu

1. Configure the firewall

Follow the step 1 of Photon OS installation as mentioned above to configure the firewall

2. Prepare the host image using Ubuntu 17.04

On the Google Cloud Storage platform, browse to 'Compute Engine' -> 'VM instances' -> 'CREATE INSTANCE', from where we will set up lightwave domain with first domain controller, i.e. 'lightwave-dc01' and subsequent domain replica, i.e. 'lightwave-dc02' etc.

You should be able to choose '1G' memory, and make sure you choose 'Ubuntu 17.04' under boot disk option. Click to enable 'http/https'.

3. Set the hostname for the instance

Follow the step 4 of the Photon OS installation as mentioned above to set the hostname and startup script

4. Install the following dependencies

SSH into the instance created and install the following packages

sudo apt-get install -y tomcat8 libboost-all-dev openjdk-8-jre haveged libsasl2-modules-gssapi-mit libsasl2-modules-ldap libgss3

5. Download Ubuntu packages for lightwave and cyrus_sasl packages from vmware bintray

The packages can be downloaded from the bin tray as follows:

$ wget https://vmware.bintray.com/lightwave-ubuntu/pool/l/lightwave/libsasl2-modules_2.1.27~101-g0780600+dfsg-2ubuntu1_amd64.deb   
$ wget https://vmware.bintray.com/lightwave-ubuntu/pool/l/lightwave/lightwave-client_1.3.0-0_amd64.deb   
$ wget https://vmware.bintray.com/lightwave-ubuntu/pool/l/lightwave/lightwave-server_1.3.0-0_amd64.deb   
$ wget https://vmware.bintray.com/lightwave-ubuntu/pool/l/lightwave/likewise-open_6.2.11-0_amd64.deb

6. Install likewise and lightwave packages

sudo dpkg -i libsasl2-modules_2.1.27~101-g0780600+dfsg-2ubuntu1_amd64.deb
sudo dpkg -i likewise-open_6.2.11-0_amd64.deb
sudo dpkg -i lightwave-client_1.3.0-0_amd64.deb
sudo dpkg -i lightwave-server_1.3.0-0_amd64.deb

7. Configure your instance with the right hostname

Follow step 5 of the photon OS installation to do this. The docker steps mentioned in the installation need not be performed.

8. Promote the host instance as a domain controller

/opt/vmware/bin/ic-promote --domain <domain name> --password <password>

Make sure that the VM is promoted using:

/opt/vmware/bin/domainjoin info

Make sure the services are running:

/opt/likewise/bin/lwsm list
Clone this wiki locally