Skip to content

Commit

Permalink
Add network-related settings for potential AWS ELB connection issues
Browse files Browse the repository at this point in the history
  • Loading branch information
hammerhead committed May 9, 2024
1 parent 0a5435c commit f33216a
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
11 changes: 11 additions & 0 deletions aws/scripts/cloud-init-cratedb-rpm.tftpl
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,19 @@ write_files:
owner: root:root
path: /etc/default/crate
permissions: "0755"
- content: |
# Certain load balancers (i.e. AWS NLB) terminate idle connections.
# We set explicit TCP keepalives so that this does not happen.
# https://github.com/crate/crate-operator/commit/383c5f4795e58fe1a61fab0cfdfba4e294953f9f
net.ipv4.tcp_keepalive_time = 120
net.ipv4.tcp_keepalive_intvl = 30
net.ipv4.tcp_keepalive_probes = 6
owner: root:root
path: /etc/sysctl.d/90-crate-net.conf
permissions: "0644"

runcmd:
- sysctl -p /etc/sysctl.d/90-crate-net.conf
- openssl pkcs12 -export -in /etc/crate/certificate.pem -inkey /etc/crate/private_key.pem -certfile /etc/crate/certificate.pem -out /etc/crate/keystore.p12 -passout pass:changeit
- rm /etc/crate/certificate.pem && rm /etc/crate/private_key.pem
- dnf install -y crate
Expand Down
13 changes: 13 additions & 0 deletions aws/scripts/cloud-init-cratedb-tar.tftpl
Original file line number Diff line number Diff line change
Expand Up @@ -140,8 +140,21 @@ write_files:
owner: root:root
path: /usr/lib/systemd/system/crate.service
permissions: "0444"
- content: |
vm.max_map_count = 262144

# Certain load balancers (i.e. AWS NLB) terminate idle connections.
# We set explicit TCP keepalives so that this does not happen.
# https://github.com/crate/crate-operator/commit/383c5f4795e58fe1a61fab0cfdfba4e294953f9f
net.ipv4.tcp_keepalive_time = 120
net.ipv4.tcp_keepalive_intvl = 30
net.ipv4.tcp_keepalive_probes = 6
owner: root:root
path: /etc/sysctl.d/90-crate-net.conf
permissions: "0644"

runcmd:
- sysctl -p /etc/sysctl.d/90-crate-net.conf
- groupadd -r crate
- useradd -r -g crate -d /opt/crate -s /sbin/nologin -c "Dude, it's a storage!" crate
- chown -R crate:crate /opt/data
Expand Down

0 comments on commit f33216a

Please sign in to comment.