Last active
August 18, 2021 18:44
-
-
Save kordless/5f4aafb2b44286dada66ce8def225281 to your computer and use it in GitHub Desktop.
Script to start Lucidworks Fusion from Google Cloud Console
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
NEW_UUID=$(cat /dev/urandom | tr -dc 'a-z0-9' | fold -w 4 | head -n 1) | |
gcloud compute instances create fusion-server-$NEW_UUID \ | |
--machine-type "n1-standard-8" \ | |
--image "ubuntu-1604-xenial-v20170811" \ | |
--image-project "ubuntu-os-cloud" \ | |
--boot-disk-size "50" \ | |
--boot-disk-type "pd-ssd" \ | |
--boot-disk-device-name "$NEW_UUID" \ | |
--zone us-west1-b \ | |
--labels ready=true \ | |
--preemptible \ | |
--metadata startup-script='#! /bin/bash | |
sudo su - | |
apt-get update -y | |
apt-get install default-jre -y | |
wget https://download.lucidworks.com/fusion-3.1.0/fusion-3.1.0.tar.gz | |
tar xvfz fusion*.tar.gz | |
/fusion/3.1.0/bin/fusion start | |
' | |
IP=$(gcloud compute instances describe fusion-server-$NEW_UUID | grep natIP | cut -d: -f2 | sed 's/^[ \t]*//;s/[ \t]*$//') | |
echo "Fusion UI will be available at http://$IP:8764 in a few minutes." |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment