DZ105-Deploying and Monitoring Elastic Stack on GCP Speaker: David Pilato
A presentation at Google Cloud Next ’19 UK in November 2019 in London, UK by David Pilato
DZ105-Deploying and Monitoring Elastic Stack on GCP Speaker: David Pilato
David Pilato Developer | Evangelist Elastic @dadoonet https://speaker.pilato.fr/
Deploying on Google Cloud Platform 01
Deploying beats
Deploying beats Elasticsearch Master Nodes (3) Ingest Nodes (X) Data Nodes Hot (X) Data Notes Warm (X)
Deploying beats Elasticsearch Master Nodes (3) Auditbeat Ingest Nodes (X) Packetbeat Data Nodes Hot (X) Metricbeat Data Notes Warm (X) Filebeat
Deploying beats Elasticsearch Master Nodes (3) Auditbeat Auditbeat Ingest Nodes (X) Packetbeat Packetbeat Data Nodes Hot (X) Metricbeat Metricbeat Data Notes Warm (X) Filebeat Filebeat
Deploying beats Elasticsearch Master Nodes (3) Heartbeat Auditbeat Auditbeat Ingest Nodes (X) Packetbeat Packetbeat Data Nodes Hot (X) Metricbeat Metricbeat Data Notes Warm (X) Filebeat Filebeat
Deploying beats Elasticsearch Master Nodes (3) Heartbeat Heartbeat Auditbeat Auditbeat Ingest Nodes (X) Packetbeat Packetbeat Data Nodes Hot (X) Metricbeat Metricbeat Data Notes Warm (X) Filebeat Filebeat
Elastic Platform Beats Elasticsearch Logstash Log Files Wire Data Master Nodes (3) Ingest Nodes (X) Metrics your{beat} Kafka Nodes (X) Redis Data Store Web APIs Social Sensors Messaging Queue Kibana Instances (X) Data Nodes Hot (X) Data Notes Warm (X) Queues Storage Metrics Notification
Elastic Platform Beats Elasticsearch Logstash Log Files Wire Data Master Nodes (3) Ingest Nodes (X) Metrics your{beat} Kafka Nodes (X) Redis Data Store Web APIs Social Sensors Messaging Queue Kibana Instances (X) Data Nodes Hot (X) Data Notes Warm (X) Queues Storage Metrics Notification
Elasticsearch manual deployment 02
Manual deployment Create the first machine $ gcloud beta compute instances create \ gnext-dadoonet-1 \ —machine-type=n1-standard-1 \ —image=debian-9-stretch-v20191115 \ —image-project=debian-cloud \ —boot-disk-size=10GB \ —boot-disk-type=pd-standard \ —boot-disk-device-name=gnext-dadoonet-1
Manual deployment Create the second machine. For High Avaibility. $ gcloud beta compute instances create \ gnext-dadoonet-2 \ —machine-type=n1-standard-1 \ —image=debian-9-stretch-v20191115 \ —image-project=debian-cloud \ —boot-disk-size=10GB \ —boot-disk-type=pd-standard \ —boot-disk-device-name=gnext-dadoonet-2
Manual deployment Create the third machine. To avoid split brain issues. $ gcloud beta compute instances create \ gnext-dadoonet-3 \ —machine-type=n1-standard-1 \ —image=debian-9-stretch-v20191115 \ —image-project=debian-cloud \ —boot-disk-size=10GB \ —boot-disk-type=pd-standard \ —boot-disk-device-name=gnext-dadoonet-3
$ gcloud beta compute instances list NAME INTERNAL_IP STATUS gnext-dadoonet-1 10.154.0.2 RUNNING gnext-dadoonet-2 10.154.0.3 RUNNING gnext-dadoonet-3 10.154.0.4 RUNNING Manual deployment Check that all machines are running
Manual deployment Install Elasticsearch
Manual deployment On the first node $ sudo mkdir /etc/elasticsearch/certs $ sudo cp /usr/share/elasticsearch/*.p12 /etc/elasticsearch/certs $ sudo chmod g+rw /etc/elasticsearch/certs/elasticcertificates.p12
Manual deployment Setup elasticsearch
Manual deployment Start elasticsearch ] [gnext-dadoonet-1] started
Repeat on the 2 other nodes
$ sudo /usr/share/elasticsearch/bin/elasticsearch-setup-passwords interactive Manual deployment Generate stack users
Manual deployment Check the cluster
03 Use discovery-gce plugin
With discovery-gce plugin Install the plugin
machine stop gnext-dadoonet-1 set-scopes gnext-dadoonet-1 \ start gnext-dadoonet-1 With discovery-gce plugin $ gcloud beta compute instances stop gnext-dadoonet-2 $ gcloud beta compute instances set-scopes gnext-dadoonet-2 \ —scopes=default,compute-rw $ gcloud beta compute instances start gnext-dadoonet-2 Stop the VMs and add compute-rw rights $ gcloud beta compute instances stop gnext-dadoonet-3 $ gcloud beta compute instances set-scopes gnext-dadoonet-3 \ —scopes=default,compute-rw $ gcloud beta compute instances start gnext-dadoonet-3
With discovery-gce plugin Check the cluster
Elastic Platform Beats Elasticsearch Logstash Log Files Wire Data Master Nodes (3) Ingest Nodes (X) Metrics your{beat} Kafka Nodes (X) Redis Data Store Web APIs Social Sensors Messaging Queue Kibana Instances (X) Data Nodes Hot (X) Data Notes Warm (X) Queues Storage Metrics Notification
04 Kibana manual deployment
Kibana deployment Create Kibana VM
Manual deployment Install Kibana
Manual deployment Setup and Start Kibana
Manual deployment Open http://35.197.195.120:5601/
Manual deployment Check with Dev Tools GET /
Elastic Platform Beats Elasticsearch Logstash Log Files Wire Data Master Nodes (3) Ingest Nodes (X) Metrics your{beat} Kafka Nodes (X) Redis Data Store Web APIs Social Sensors Messaging Queue Kibana Instances (X) Data Nodes Hot (X) Data Notes Warm (X) Queues Storage Metrics Notification
Using ECK 05
$ gcloud beta container clusters create “gnext-dadoonet” \ —zone “europe-west2-c” —machine-type “n1-standard-4” Kubernetes deployment Create Kubernetes cluster $ gcloud beta container clusters get-credentials gnext-dadoonet \ —zone europe-west2-c
Kubernetes deployment Deploy ECK in Kubernetes
Kubernetes deployment Deploy an Elasticsearch cluster
AGE 1m
Kubernetes deployment
Connect to an Elasticsearch cluster }
Kubernetes deployment Deploy a Kibana instance
Kubernetes deployment Connect to Kibana
Manual deployment Open https://localhost:5601
Manual deployment Check with Dev Tools GET / Check nodes
06 One click install
From Google Cloud Marketplace
Or https://cloud.elastic.co/
One click deploy
One click deploy
DZ105-Deploying and Monitoring Elastic Stack on GCP Speaker: David Pilato