How to install elasticsearch on GCP

Oksana B.
1 min readOct 15, 2020

--

Additional:

wget -V

If wget not found:

sudo apt-get install wget

Step1. Go through the official elasticsearch instruction:

wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-7.9.2-linux-x86_64.tar.gz

wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-7.9.2-linux-x86_64.tar.gz.sha512

shasum -a 512 -c elasticsearch-7.9.2-linux-x86_64.tar.gz.sha512

tar -xzf elasticsearch-7.9.2-linux-x86_64.tar.gz

cd elasticsearch-7.9.2/

Step2. Change config

cd /elasticsearch-7.9.2/config

vi elasticsearch.yml

Set config to:

network.host: 0.0.0.0

Step3. Run elasticsearch

./bin/elasticsearch

Step 4. Create firewall rule

Network: default (the network your GCP instance is in)

Priority: 1000

Direction: Ingress

Action on match: Allow

Source filters: IP ranges 0.0.0.0/0

Tags: http, https

Open in browser

external_IP:9200

{
"name" : "instance-1",
"cluster_name" : "elasticsearch",
"cluster_uuid" : "ESa1GSc_ROSMn3Wk1Xn8Jw",
"version" : {
"number" : "7.9.2",
"build_flavor" : "default",
"build_type" : "tar",
"build_hash" : "d34da0ea4a966c4e49417f2da2f244e3e97b4e6e",
"build_date" : "2020-09-23T00:45:33.626720Z",
"build_snapshot" : false,
"lucene_version" : "8.6.2",
"minimum_wire_compatibility_version" : "6.8.0",
"minimum_index_compatibility_version" : "6.0.0-beta1"
},
"tagline" : "You Know, for Search"
}

--

--