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

Snap will not pickup reset kernel parameters after reboot. #39

Closed
ethanmye-rs opened this issue Jun 22, 2023 · 2 comments
Closed

Snap will not pickup reset kernel parameters after reboot. #39

ethanmye-rs opened this issue Jun 22, 2023 · 2 comments
Labels
bug Something isn't working

Comments

@ethanmye-rs
Copy link
Member

ethanmye-rs commented Jun 22, 2023

Steps to reproduce

  1. Run tutorial, using lxd backing cloud.
  2. Reboot
  3. Set kernel parameters with sudo sysctl -w vm.max_map_count=262144 vm.swappiness=0 net.ipv4.tcp_retries2=5 as they were reset after reboot
  4. Verify kernel parameters actually changed: sudo sysctl -a | grep -E 'swappiness|max_map_count|tcp_retries2'
  5. Error message: Juju stuck with 'net.ipv4.tcp_retries2 should be 5'

I've exposed the opensearch service, but I don't think that matters here.

Expected behavior

The tutorial (and my experience) says this should work OK. The other parameters are successfully set. A reboot of the container results in the same error message.

Actual behavior

Juju does not recognize net.ipv4.tcp_retries2 as being reset. I've tried rebooting the containers without any luck. I suspect this is more of a juju problem than an opensearch problem, but it would be nice to figure out how to unstick juju.

Versions

opensearch active 1 opensearch 2/edge 26 yes
Operating system:
22.04

Happy to provide any logs required.

@ethanmye-rs ethanmye-rs added the bug Something isn't working label Jun 22, 2023
@github-actions
Copy link

@Mehdi-Bendriss
Copy link
Contributor

Mehdi-Bendriss commented May 23, 2024

Hi @ethanmye-rs Thanks for reporting! and apologies for the delay in responding - we just go to clean up old issues etc..

Those kernel parameters are ephemeral and get reset after a reboot when set using sysctl. Should you want these to be persisted across reboots you need to set them in /etc/sysctl.conf, i.e:

On the host:

sudo tee -a /etc/sysctl.conf > /dev/null <<EOT
vm.max_map_count=262144
vm.swappiness=0
net.ipv4.tcp_retries2=5
fs.file-max=1048576
EOT

sudo sysctl -p

For the juju units when creating the model:

cat <<EOF > cloudinit-userdata.yaml
cloudinit-userdata: |
  postruncmd:
    - [ 'echo', 'vm.max_map_count=262144', '>>', '/etc/sysctl.conf' ]
    - [ 'echo', 'vm.swappiness=0', '>>', '/etc/sysctl.conf' ]
    - [ 'echo', 'net.ipv4.tcp_retries2=5', '>>', '/etc/sysctl.conf' ]
    - [ 'echo', 'fs.file-max=1048576', '>>', '/etc/sysctl.conf' ]
    - [ 'sysctl', '-p' ]
EOF

juju model-config --file=./cloudinit-userdata.yaml

We had updated the README - but looks like we missed the discourse docs, which I updated now.

Please reopen this issue if it persists.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants