Puppet Class: cassandra::system::sysctl
- Inherits:
- cassandra::params
- Defined in:
- manifests/system/sysctl.pp
Overview
Set Sysctl (kernel runtime parameters) as suggested in docs.datastax.com/en/landing_page/doc/landing_page/recommendedSettingsLinux.html
If any of the values is set into the target file, the sysctl command will be called with the provided file name as an argument.
24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 |
# File 'manifests/system/sysctl.pp', line 24
class cassandra::system::sysctl (
$sysctl_args = '-p',
$sysctl_file = $cassandra::params::sysctl_file,
$net_core_optmem_max = 40960,
$net_core_rmem_default = 16777216,
$net_core_rmem_max = 16777216,
$net_core_wmem_default = 16777216,
$net_core_wmem_max = 16777216,
$net_ipv4_tcp_rmem = $cassandra::params::net_ipv4_tcp_rmem,
$net_ipv4_tcp_wmem = $cassandra::params::net_ipv4_tcp_wmem,
$vm_max_map_count = 1048575,
) inherits cassandra::params {
ini_setting { "net.core.rmem_max = ${net_core_rmem_max}":
ensure => present,
path => $sysctl_file,
section => '',
setting => 'net.core.rmem_max',
value => $net_core_rmem_max,
notify => Exec['Apply sysctl changes'],
}
ini_setting { "net.core.wmem_max = ${net_core_wmem_max}":
ensure => present,
path => $sysctl_file,
section => '',
setting => 'net.core.wmem_max',
value => $net_core_wmem_max,
notify => Exec['Apply sysctl changes'],
}
ini_setting { "net.core.rmem_default = ${net_core_rmem_default}":
ensure => present,
path => $sysctl_file,
section => '',
setting => 'net.core.rmem_default',
value => $net_core_rmem_default,
notify => Exec['Apply sysctl changes'],
}
ini_setting { "net.core.wmem_default = ${net_core_wmem_default}":
ensure => present,
path => $sysctl_file,
section => '',
setting => 'net.core.wmem_default',
value => $net_core_wmem_default,
notify => Exec['Apply sysctl changes'],
}
ini_setting { "net.core.optmem_max = ${net_core_optmem_max}":
ensure => present,
path => $sysctl_file,
section => '',
setting => 'net.core.optmem_max',
value => $net_core_optmem_max,
notify => Exec['Apply sysctl changes'],
}
ini_setting { "net.ipv4.tcp_rmem = ${net_ipv4_tcp_rmem}":
ensure => present,
path => $sysctl_file,
section => '',
setting => 'net.ipv4.tcp_rmem',
value => $net_ipv4_tcp_rmem,
notify => Exec['Apply sysctl changes'],
}
ini_setting { "net.ipv4.tcp_wmem = ${net_ipv4_tcp_wmem}":
ensure => present,
path => $sysctl_file,
section => '',
setting => 'net.ipv4.tcp_wmem',
value => $net_ipv4_tcp_wmem,
notify => Exec['Apply sysctl changes'],
}
ini_setting { "vm.max_map_count = ${vm_max_map_count}":
ensure => present,
path => $sysctl_file,
section => '',
setting => 'vm.max_map_count',
value => $vm_max_map_count,
notify => Exec['Apply sysctl changes'],
}
exec { 'Apply sysctl changes':
command => "/sbin/sysctl ${sysctl_args} ${sysctl_file}",
refreshonly => true,
}
}
|