Deploy an InfluxDB Enterprise cluster on Google Cloud Platform (GCP) Compute Engine virtual machines with Google Deployment Manager (DM) templates.
There are two ways to use the templates in this repository:
- Subscribe to the InfluxDB Enterprise offer on Google Cloud Marketplace and follow the instructions to deploy a cluster. All VMs created through GCP Marketplace are automatically licensed.
- Obtain an InfluxDB Enterprise license key and follow the instructions to deploy with a license.
Subscribe to InfluxDB Enterprise on GCP Marketplace. After subscribing, all VMs deployed using InfluxDB Enterprise images from GCP Marketplace will automatically include a license billed to the associated GCP account.
After subscribing to the offer, a cluster can be deployed directly from the GCP console UI.
Alternatively, the templates in this repository can also be used to deploy an
InfluxDB Enterprise cluster from the command line using Google Cloud
Shell or the gcloud
CLI tool from the
Google Cloud SDK, which also required cloning
this repo.
Then run the following command to deploy a cluster:
git clone https://github.com/influxdata/google-deployment-manager-influxdb-enterprise.git
cd google-deployment-manager-influxdb-enterprise
gcloud deployment-manager deployments create influxdb-enterprise-0 \
--template src/influxdb-enterprise.jinja \
--automatic-rollback-on-error
Note:
gcloud
must have an active configuration with a project and compute zone name defined.
Once the cluster has successfully deployed, learn how to access and manage InfluxDB Enterprise on GCP.
If you have InfluxDB Enterprise license key from InfluxData or a trial sign-up, the templates in this repository can be used to deploy a cluster in Google Cloud Platform (no GCP Marketplace subscription required).
You will need to build images for InfluxDB Enterprise in your GCP account using
Hashicorp's Packer tool and
the templates in the packer/
directory.
Run the following commands to generate a Google service account key for Packer and then build the images:
# Replace "your-gcp-project" with the name of the Google Cloud project
export GOOGLE_CLOUD_PROJECT="your-gcp-project"
# File where the Google Service Account key will be stored
export GOOGLE_SERVICE_ACCOUNT_KEY="key.json"
# Ensure the Google Cloud SDK is authenticated
gcloud auth login
# Generate a Google Service Account for Packer with the
# "compute.instanceAdmin.v1" and "iam.serviceAccountUser" roles
./packer/generate-google-service-account-key.sh "${GOOGLE_CLOUD_PROJECT}" "${GOOGLE_SERVICE_ACCOUNT_KEY}"
# Build images
packer build packer/influxdb.json
Once the build is complete, Packer outputs the InfluxDB Enterprise image names
to the terminal and the manifest.json
file.
==> Builds finished. The artifacts of successful builds are:
--> enterprise-data: A disk image was created: influxdb-enterprise-data-1-8-2-ubuntu-1611160220
--> enterprise-meta: A disk image was created: influxdb-enterprise-meta-1-8-2-ubuntu-1611160220
The portion of the image name after influxdb-enterprise-data-
can be used as
the sourceImageVersion property when deploying the DM templates, e.g.
1-8-2-ubuntu-1611160220
.
Run the following command to deploy an InfluxDB Enterprise cluster with the images created by Packer.
# Replace "your-gcp-project" with the name of the Google Cloud project
export GOOGLE_CLOUD_PROJECT="your-gcp-project"
# Set this to your InfluxDB Enterprise license key
export INFLUXDB_ENTERPRISE_LICENSE_KEY="xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxx"
# Set this to the version string obtained when building the images
export INFLUXDB_ENTERPRISE_IMAGE_VERSION="1-8-2-ubuntu-xxxxxxxx"
gcloud deployment-manager deployments create influxdb-enterprise-0 \
--template src/influxdb-enterprise.jinja \
--properties "licenseKey:'${INFLUXDB_ENTERPRISE_LICENSE_KEY}',\
sourceImageProject:'${GOOGLE_CLOUD_PROJECT}',\
sourceImageVersion:'${INFLUXDB_ENTERPRISE_IMAGE_NAME}'" \
--automatic-rollback-on-error
To delete the cluster, run the following command:
gcloud deployment-manager delete influxdb-enterprise-0