BigDataBoutique / elasticsearch-cloud-deploy

Deploy Elasticsearch on the cloud easily
https://bigdataboutique.com/services/elasticsearch-consulting
Apache License 2.0
330 stars 146 forks source link

packer fail to build the kibana aim #61

Closed casertap closed 4 years ago

casertap commented 5 years ago

I am currently trying to build the kibana6 aim image on ap-southeast-2. packer build -only=amazon-ebs -var-file=variables.json kibana6-node.packer.json

The build get stuck at: amazon-ebs: Executing /lib/systemd/systemd-sysv-install enable kibana from there it will wait indefinitely

 amazon-ebs: 0 upgraded, 1 newly installed, 0 to remove and 6 not upgraded.
    amazon-ebs: Need to get 208 MB of archives.
    amazon-ebs: After this operation, 503 MB of additional disk space will be used.
    amazon-ebs: Get:1 https://artifacts.elastic.co/packages/6.x/apt stable/main amd64 kibana amd64 6.5.2 [208 MB]
    amazon-ebs: debconf: unable to initialize frontend: Dialog
    amazon-ebs: debconf: (Dialog frontend will not work on a dumb terminal, an emacs shell buffer, or without a controlling terminal.)
    amazon-ebs: debconf: falling back to frontend: Readline
    amazon-ebs: debconf: unable to initialize frontend: Readline
    amazon-ebs: debconf: (This frontend requires a controlling tty.)
    amazon-ebs: Fetched 208 MB in 30s (6,819 kB/s)
    amazon-ebs: debconf: falling back to frontend: Teletype
    amazon-ebs: dpkg-preconfigure: unable to re-open stdin:
    amazon-ebs: Selecting previously unselected package kibana.
    amazon-ebs: (Reading database ... 59295 files and directories currently installed.)
    amazon-ebs: Preparing to unpack .../kibana_6.5.2_amd64.deb ...
    amazon-ebs: Unpacking kibana (6.5.2) ...
    amazon-ebs: Processing triggers for systemd (229-4ubuntu21.10) ...
    amazon-ebs: Processing triggers for ureadahead (0.100.0-19) ...
    amazon-ebs: Setting up kibana (6.5.2) ...
    amazon-ebs: Processing triggers for systemd (229-4ubuntu21.10) ...
    amazon-ebs: Processing triggers for ureadahead (0.100.0-19) ...
    amazon-ebs: Synchronizing state of kibana.service with SysV init with /lib/systemd/systemd-sysv-install...
    amazon-ebs: Executing /lib/systemd/systemd-sysv-install enable kibana

I commented the line: #bin/kibana-plugin install x-pack || true because it was returning an error message but this is not related to the issue I am facing. I tried a t2.large instance with the same result

casertap commented 5 years ago

removing the spot_instances options did not help neither

casertap commented 5 years ago

After further investigation I added some logging:

echo 'Waiting for Kibana to initialize...'
until $(curl --output /dev/null --silent --head --fail http://localhost:5601); do
    echo '.'
    curl http://localhost:5601 || true
    sleep 5
done

the output

  amazon-ebs: 100    30  100    30    0     0   5026      0 --:--:-- --:--:-- --:--:--  6000
    amazon-ebs: Kibana server is not ready yet.
    amazon-ebs:   % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
    amazon-ebs:                                  Dload  Upload   Total   Spent    Left  Speed
    amazon-ebs: 100    30  100    30    0     0  30959      0 --:--:-- --:--:-- --:--:-- 30000
    amazon-ebs: Kibana server is not ready yet.
    amazon-ebs:   % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
    amazon-ebs:                                  Dload  Upload   Total   Spent    Left  Speed
    amazon-ebs: 100    30  100    30    0     0  29469      0 --:--:-- --:--:-- --:--:-- 30000
    amazon-ebs: Kibana server is not ready yet.
    amazon-ebs:   % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
    amazon-ebs:                                  Dload  Upload   Total   Spent    Left  Speed
    amazon-ebs: 100    30  100    30    0     0  30333      0 --:--:-- --:--:-- --:--:-- 30000

So kibana is never ready but the service is running correctly.

Is it possible to start the kibana server at that stage? the Paker builder does not include a local elasticsearch so I do not think kibana can start without an elasticsearch instance to create its internal index .kibana

magomimmo commented 5 years ago

@casertap I have the same problem. Were you able to solve it? Thanks

casertap commented 5 years ago

No I did not solve it. I commented those lines but the aim should still be correctly installed (to be confirmed). I am going to try again soon, I could not have the cluster working last time. Let me know if you solve this issue on your side.

casertap commented 5 years ago

I can confirm that you do not need those last lines for the ami image to work. Cheers

michaelseto commented 5 years ago

I can confirm that you do not need those last lines for the ami image to work. Cheers

Which lines did you comment?

casertap commented 5 years ago

@michaelseto I commented:

# echo 'Waiting for Kibana to initialize...'
# until $(curl --output /dev/null --silent --head --fail http://localhost:5601); do
#     echo '.'
#     curl http://localhost:5601 || true
#     sleep 5
# done
deeco commented 5 years ago

@michaelseto I commented:

# echo 'Waiting for Kibana to initialize...'
# until $(curl --output /dev/null --silent --head --fail http://localhost:5601); do
#     echo '.'
#     curl http://localhost:5601 || true
#     sleep 5
# done

Thanks for that , I also had to amend the grafana install script to below and switch to root

"sudo su - echo "deb https://packagecloud.io/grafana/stable/debian/ jessie main" | tee -a /etc/apt/sources.list curl https://packagecloud.io/gpg.key | apt-key add -

sudo apt-get --allow-unauthenticated update && sudo apt-get --allow-unauthenticated install grafana -y "

JinghaoYJH commented 5 years ago

@deeco It works for me, thank you so much!

tsimonyan commented 4 years ago

Fixed in master. We removed the Kibana initialization step in Packer.