Skip navigation

When you look at AWS, it has a possibility to create rather easily an Elastic Search Cluster. With a few simple clicks you have a cluster up and running.

Unfortunately the Oracle Cloud Infrastructure doesn't have this feature yet, but that doesn't mean you can't setup Elastic Search on OCI . Using the magic Terraform wand magic is about to happen...

 

Get the terraform Elastic Search OCI Plugin

 

On github there is an OCI ELK plugin available on https://github.com/cloud-partners/oci-elasticsearch, so perform an easy

 

git clone https://github.com/cloud-partners/oci-elasticsearch.git

 

for a local repository download, which leaves you with a bunch of files:

 

in the env-vars you will have tot set your region, compartment and userid, and also you fingerprint and ssh keypairs which wasj generated with

ssh-keygen -b 2048 -t rsa

and left the keypairs in the .ssh directory, so the env-vars would look like this

 

Some other files could acquire my attention:

  • variables.tf where I can specify VCN, shapes and VM image location, I chose shape VM.Standard1.8

other files specified loadbalancer, compute nodes, storage etc.

 

Next run the env-vars script, another way is to put it into your bash_profile

 

. ./env-vars
terraform plan

 

Immediately it returned some errors like:

error: oci_core instance.Bastion Host: "image": required field is not set 

 

To debug this error, I set the terraform loglevel to trace

export TF_LOG=TRACE

 

Still, this did not bring me al lot of new information, until I performed terraform version, which gave the out put that the current version for this provider was outdated.

To upgrade the provided, the binary had to be dowloaded and replaced

https://releases.hashicorp.com/terraform/0.11.10/terraform_0.11.10_linux_amd64.zip

After download

sudo cp -p terraform /usr/local/bin/

 

and in the directory of the oci elk provider:

terraform init

which upgraded the provider.

Finally, explicitly the version had to be set in the provider.tf:

 

When ready the terraform plan and terraform apply went well and gave me a fully running ELK cluster on OCI.

 

In part 2, I will dive deeper in how to setup Elasic Search, Kibana and Logstash.