You can also use provider other than VirtualBox, then you should however check how to setup memory for it because the memory setup above might not work.

Let’s boot it up!

1

2

vagrant up;

vagrant ssh;

Install ElasticSearch and Kibana

Now we need to install java, setup YUM repository for elasticsearch, start the service and then check whether it is up and running. You can simly use following script.

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

35

36

37

38

39

40

#!/bin/bash

rpm--import https://artifacts.elastic.co/GPG-KEY-elasticsearch

echo"Adding Elasticsearch repository elastic.repo."

touch'/etc/yum.repos.d/elastic.repo'

echo"[elasticsearch-5.x]

name=Elasticsearch repository for5.xpackages

baseurl=https://packages.elastic.co/elasticsearch/5.x/centos

gpgcheck=1

gpgkey=https://packages.elastic.co/GPG-KEY-elasticsearch

enabled=1">'/etc/yum.repos.d/elastic.repo'

yum install-yjava elasticsearch

echo"Making sure Elastic-Search service starts automatically on system bootup"

systemctl daemon-reload

systemctl enable elasticsearch.service

echo"Start Elastic-Search service"

systemctl start elasticsearch.service

service elasticsearch status

echo"Now I will sleep for 11 seconds and then verify if elastic search API is reachable."

n=0

while(($n<=11));

do

echo-n".";

sleep1;

((n++));

done

ifcurl-XGET http://127.0.0.1:9200;

then

echo"Seems like ElasticSearch is up and running. Don't forget to set up whatever is needed in /etc/elasticsearch/"

exit0;

else

echo"ERROR: Can't reach ElasticSearch!"

exit1;

fi;

Similarly, for Kibana you can use following script

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

35

36

37

38

39

40

41

42

#!/bin/bash

rpm--import https://artifacts.elastic.co/GPG-KEY-elasticsearch

echo"Adding Kibana repository kibana.repo."

touch'/etc/yum.repos.d/kibana.repo'

echo"[kibana-5.x]

name=Kibana repository for5.xpackages

baseurl=https://artifacts.elastic.co/packages/5.x/yum

gpgcheck=1

gpgkey=https://artifacts.elastic.co/GPG-KEY-elasticsearch

enabled=1

autorefresh=1

type=rpm-md">'/etc/yum.repos.d/kibana.repo'

yum install-ykibana

# Making sure Kibana service starts automatically on system bootup

systemctl daemon-reload

systemctl enable kibana.service

# Start Kibana

systemctl start kibana.service

service kibana status

echo"Now I will sleep for 11 seconds and then verify if elastic search API is reachable."

n=0

while(($n<=11));

do

echo-n".";

sleep1;

((n++));

done

ifcurl-XGET http://127.0.0.1:5601;

then

echo"Seems like Kibana is up and running. Don't forget to set up whatever is needed in /etc/kibana/"

exit0;

else

echo"ERROR: Can't reach Kibana!"

exit1;

fi;

Configure ElasticSearch and Kibana

The ElasticSearch configuration is located at /etc/elasticsearch/elasticsearch.yml
The minimal change required to configuration is to set following value

1

network.host:0.0.0.0

By default the value is 127.0.0.1, which however prevents to access from outside the machine. Learn here why is that.

Kibana confiruation file is similarly located at /etc/kibana/kibana.yml and the values you have to modify are

1

2

server.host:0.0.0.0

elasticsearch.url:"http://localhost:9200"

After modifying configuration, you need to restart elasticsearch and kibana service.

1

2

service elasticsearch restart

service kibana restart

You can wait few seconds and make sure they are truly still up and running.

1

2

service elasticsearch status

service kibana status

If some of the services failed, you can investigate why that happend by running

1

2

journalctl-uelasticsearch-f--lines200

journalctl-ukibana-f--lines200

Otherwise, if everything is fine, you can navigate to http://localhost:5602 in your browser – your Kibana should be there.
However, Kibana will first of all ask you for index pattern. To get going quickly, you can post some sample data to ES, which will also by default create index and mapping.