Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Elastic-Agent] Test to make sure persisted install works #19946

Closed
ph opened this issue Jul 15, 2020 · 6 comments
Closed

[Elastic-Agent] Test to make sure persisted install works #19946

ph opened this issue Jul 15, 2020 · 6 comments
Assignees

Comments

@ph
Copy link
Contributor

ph commented Jul 15, 2020

We are depending on the beats packaging system to package the elastic-agent correctly, we need to test and ensure that following is working correctly.

  • Windows with a powershell installer script.
  • Linux DEB package
  • Linux RPM package

We need to ensure that the elastic-agent works with the above artifacts:

  • Can run Filebeat
  • Can run Metricbeat
  • Can install Endpoint and run it.
  • Data is correctly saved in the appropriate path.
@elasticmachine
Copy link
Collaborator

Pinging @elastic/ingest-management (Team:Ingest Management)

@blakerouse
Copy link
Contributor

Testing on Ubuntu 20.04 from DEB results in configuration being read from the wrong location.

blake@blake-ubnt-20-vm:~/Downloads$ sudo elastic-agent enroll http://192.168.150.1:5601 ejVQNFRYTUI4d014NkZvT25KMDU6S0IySk5CV3JRcW1od1l3VWVFUlBEUQ
The Elastic Agent is currently in BETA and should not be used in production
could not read configuration file /usr/share/elastic-agent/elastic-agent.yml: open /usr/share/elastic-agent/elastic-agent.yml: no such file or directory

Looking at the installed script in path, looks like path.config is set correctly. But the binary is not reading that option it seems.

blake@blake-ubnt-20-vm:~/Downloads$ cat /usr/bin/elastic-agent
#!/usr/bin/env bash

# Script to run Elastic-Agent in foreground with the same path settings that
# the init script / systemd unit file would do.

exec /usr/share/elastic-agent/bin/elastic-agent \
  --path.home /usr/share/elastic-agent \
  --path.config /etc/elastic-agent \
  --path.data /var/lib/elastic-agent \
  --path.logs /var/log/elastic-agent \
  "$@"

The installer does place the config in the correct path.

blake@blake-ubnt-20-vm:~/Downloads$ ls -l /etc/elastic-agent/elastic-agent.yml
-rw------- 1 root root 7749 Jul 15 10:06 /etc/elastic-agent/elastic-agent.yml

@blakerouse
Copy link
Contributor

With --path.config fixed enrollment worked, but starting the service fails on Ubuntu 20.04:

$ systemctl enable elastic-agent
$ systemctl start elastic-agent
Jul 15 12:21:28 blake-ubnt-20-vm systemd[1]: elastic-agent.service: Main process exited, code=exited, status=1/FAILURE
Jul 15 12:21:28 blake-ubnt-20-vm systemd[1]: elastic-agent.service: Failed with result 'exit-code'.
Jul 15 12:21:28 blake-ubnt-20-vm systemd[1]: elastic-agent.service: Scheduled restart job, restart counter is at 4.
Jul 15 12:21:28 blake-ubnt-20-vm systemd[1]: Stopped Agent manages other beats based on configuration provided..
Jul 15 12:21:28 blake-ubnt-20-vm systemd[1]: Started Agent manages other beats based on configuration provided..
Jul 15 12:21:28 blake-ubnt-20-vm elastic-agent[68780]: Error: unknown command "systemd" for "elastic-agent"
Jul 15 12:21:28 blake-ubnt-20-vm elastic-agent[68780]: Run 'elastic-agent --help' for usage.
Jul 15 12:21:28 blake-ubnt-20-vm elastic-agent[68780]: unknown command "systemd" for "elastic-agent"

@blakerouse
Copy link
Contributor

I have confirmed that on Windows the install-service-elastic-agent.ps1 and uninstall-service-elastic-agent.ps1 also work.

Closing this bug, because the DEB and RPM's are fixed and Windows works correctly.

@EricDavisX
Copy link
Contributor

I have confirmed again this is working from BC5 with Windows x64 and Ubuntu 18 - feeling pretty good about it. thanks for all the effort

@georgifundrecs
Copy link

Using rpm with 7.9.2 throws an error as the elastic-agent does not have command "test config"

I have removed the test command to enable the service to work.

sed -i 's/$user_wrapper $user_wrapperopts "$agent $args $test_args"/echo 0/' /etc/init.d/elastic-agent

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants