Unable to install elasticsearch

I am trying to setup a elasticsearch cluster. I choose Rocky Linux 8 image. When I try to install elasticsearch (7.6.0) using rpm -ivh elasticsearch-7.6.0-x86_64.rpm, I am receiving following error -

Verifying...                          ################################# [100%]
Preparing...                          ################################# [100%]
Creating elasticsearch group... OK
Creating elasticsearch user... OK
Updating / installing...
   1:elasticsearch-0:7.6.0-1          ################################# [100%]
### NOT starting on installation, please execute the following statements to configure elasticsearch service to start automatically using systemd
 sudo systemctl daemon-reload
 sudo systemctl enable elasticsearch.service
### You can start elasticsearch service by executing
 sudo systemctl start elasticsearch.service
Created elasticsearch keystore in /etc/elasticsearch
Couldn't write '0' to 'kernel/yama/ptrace_scope', ignoring: Permission denied
Couldn't write '|/usr/lib/systemd/systemd-coredump %P %u %g %s %t %c %h %e' to 'kernel/core_pattern', ignoring: Permission denied
Couldn't write '16' to 'kernel/core_pipe_limit', ignoring: Permission denied
Couldn't write '16' to 'kernel/sysrq', ignoring: Permission denied
Couldn't write '1' to 'kernel/core_uses_pid', ignoring: Permission denied
Couldn't write '1' to 'kernel/kptr_restrict', ignoring: Permission denied
Couldn't write '0 2147483647' to 'net/ipv4/ping_group_range', ignoring: Invalid argument
Couldn't write 'fq_codel' to 'net/core/default_qdisc', ignoring: No such file or directory
Couldn't write '1' to 'fs/protected_hardlinks', ignoring: Permission denied
Couldn't write '1' to 'fs/protected_symlinks', ignoring: Permission denied
Couldn't write '81920' to 'net/core/optmem_max', ignoring: No such file or directory
Couldn't write '4194304' to 'kernel/pid_max', ignoring: Permission denied
Couldn't write '262144' to 'vm/max_map_count', ignoring: Permission denied
[/usr/lib/tmpfiles.d/elasticsearch.conf:1] Line references path below legacy directory /var/run/, updating /var/run/elasticsearch → /run/elasticsearch; please update the tmpfiles.d/ drop-in file accordingly.

I appreciate any assistance on this!

Hi @mrrabinhalder,
Have a look at that post, https://github.com/lxc/lxd/issues/2544
Instead of those warnings, you can start the elasticsearch service without any hitch.
Regards.

I sometimes manually apply those failed settings to host if I want to have them applied (e.g. if they’re related to networking, for example).

Definitely @sean, it should prevent those messages.
Regards.

It probably won’t prevent them per se (unless the installer attempts to set those settings only if they’re not already set), but at least you’ll have them present on the host.
I think some of those host settings will reflect in the guest as well.

Unprivileged containers cant change kernel settings but privileged or vm can solve the related warnings.
Regards.