Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Once the Cloud SDK is installed and verified to be working, create a new Linux VM using the following commands:

Code Block
titleOn Linux
export INSTANCE_NAME=joget6
export IMAGE_ID=ubuntu-1604-xenial-v20170307
export IMAGE_PROJECT=ubuntu-os-cloud
export MACHINE_TYPE=f1-micro
export JOGET_VERSION=6.0-BETA1
export MYSQL_VERSION=5.7
export MYSQL_PASSWORD=root

echo "== Create VM instance $INSTANCE_NAME for $IMAGE_ID on $MACHINE_TYPE =="
gcloud compute instances create $INSTANCE_NAME --image $IMAGE_ID --image-project $IMAGE_PROJECT --machine-type=$MACHINE_TYPE
Code Block
titleOn Windows
set INSTANCE_NAME=joget6
set IMAGE_ID=ubuntu-1604-xenial-v20170307
set IMAGE_PROJECT=ubuntu-os-cloud
set MACHINE_TYPE=f1-micro
set JOGET_VERSION=6.0-BETA1
set MYSQL_VERSION=5.7
set MYSQL_PASSWORD=root
 
echo "== Create VM instance %INSTANCE_NAME% for %IMAGE_ID% on %MACHINE_TYPE% =="
gcloud compute instances create %INSTANCE_NAME% --image %IMAGE_ID% --image-project %IMAGE_PROJECT% --machine-type=%MACHINE_TYPE%

 

If you are using a low-memory machine type (e.g. f1-micro), then you will need to add swap space:

Code Block
titleOn Linux
echo "== Add swap file (required for low memory machine types eg f1-micro) =="
gcloud compute ssh $INSTANCE_NAME -- "\
sudo fallocate -l 1G /swapfile;\
sudo chmod 600 /swapfile;\
sudo mkswap /swapfile;\
sudo swapon /swapfile;\
sudo swapon -s"
Code Block
titleOn Windows
echo "== Add swap file (required for low memory machine types eg f1-micro) =="
gcloud compute ssh %INSTANCE_NAME% --command="sudo fallocate -l 1G /swapfile; sudo chmod 600 /swapfile; sudo mkswap /swapfile; sudo swapon /swapfile; sudo swapon -s;"


Step 4: Deploy Joget Workflow in the VM


Run the following commands to download and install Joget Workflow Enterprise Edition:

Code Block
titleOn Linux
echo "== Deploy Joget Workflow =="
gcloud compute ssh $INSTANCE_NAME -- "\
    echo === Install Java ===;\
    sudo apt-get install -y openjdk-8-jdk-headless;\
    echo === Install MySQL ===;\
    sudo debconf-set-selections <<< \"mysql-server-$MYSQL_VERSION mysql-server/root_password password $MYSQL_PASSWORD\";\
    sudo debconf-set-selections <<< \"mysql-server-$MYSQL_VERSION mysql-server/root_password_again password $MYSQL_PASSWORD\";\
    sudo apt-get -y install mysql-server-$MYSQL_VERSION;\
    sudo -E apt-get -q -y install mysql-server;\
    echo === Download Joget Workflow $JOGET_VERSION ===;\
    cd ~;\
    wget https://dev.joget.org/downloads/enterprise/joget-enterprise-linux-$JOGET_VERSION.tar.gz;\
    echo === Extract Bundle ===;\
    tar xvfz joget-enterprise-linux-$JOGET_VERSION.tar.gz;\
    cd joget-enterprise-linux-$JOGET_VERSION;\
    echo === Setup Datasource ===;\
    apache-ant-1.7.1/bin/ant setup -Dprofile.name=default -Ddb.name=jwdb -Ddb.host=localhost -Ddb.port=3306 -Ddb.user=root -Ddb.password=$MYSQL_PASSWORD;\
    echo === Reduce JAVA VM Memory Allocation ===;\
    sed -i -e 's/512/256/g' tomcat8.sh;\
    echo === Clean Bundle ===;\
    cd ..;\
    rm -r joget-enterprise-linux-$JOGET_VERSION.tar.gz;\
    echo === Start Joget Workflow $JOGET_VERSION ===;\
    cd joget-enterprise-linux-$JOGET_VERSION;\
    ./tomcat8.sh start"
Code Block
titleOn Windows
echo "== Deploy Joget Workflow =="
gcloud compute ssh %INSTANCE_NAME% --command="echo === Install Java ===;sudo apt-get install -y openjdk-8-jdk-headless;    echo === Install MySQL ===;    sudo debconf-set-selections ^<^<^< \"mysql-server-%MYSQL_VERSION% mysql-server/root_password password %MYSQL_PASSWORD%\";    sudo debconf-set-selections ^<^<^< \"mysql-server-%MYSQL_VERSION% mysql-server/root_password_again password %MYSQL_PASSWORD%\";    sudo apt-get -y install mysql-server-%MYSQL_VERSION%;    sudo -E apt-get -q -y install mysql-server;    echo === Download Joget Workflow %JOGET_VERSION% ===;    cd ~;    wget https://dev.joget.org/downloads/enterprise/joget-enterprise-linux-%JOGET_VERSION%.tar.gz;    echo === Extract Bundle ===;    tar xvfz joget-enterprise-linux-%JOGET_VERSION%.tar.gz;    cd joget-enterprise-linux-%JOGET_VERSION%;    echo === Setup Datasource ===;    apache-ant-1.7.1/bin/ant setup -Dprofile.name=default -Ddb.name=jwdb -Ddb.host=localhost -Ddb.port=3306 -Ddb.user=root -Ddb.password=%MYSQL_PASSWORD%;    echo === Reduce JAVA VM Memory Allocation ===;    sed -i -e 's/512/256/g' tomcat8.sh;    echo === Clean Bundle ===;    cd ..;    rm -r joget-enterprise-linux-%JOGET_VERSION%.tar.gz;    echo === Start Joget Workflow %JOGET_VERSION% ===;    cd joget-enterprise-linux-%JOGET_VERSION%;    ./tomcat8.sh start"

 

Deployment may take several minutes (depending on the type of VM) so be patient.

Monitor the logs using:

Code Block
titleOn Linux
echo "== Tail Logs =="
gcloud compute ssh $INSTANCE_NAME -- "tail -f ~/joget-enterprise-linux-*/apache-tomcat-*/logs/catalina.out"
Code Block
titleOn Windows
echo "== Tail Logs =="
gcloud compute ssh %INSTANCE_NAME% --command="tail -f ~/joget-enterprise-linux-*/apache-tomcat-*/logs/catalina.out"

 

The deployment is complete once you see the following in the logs:

...

More information available at https://cloud.google.com/compute/docs/networking#addingafirewall

 

Step 6: Access Joget Workflow installation

...