postgresql_cluster
postgresql_cluster copied to clipboard
Task - Setting kernel parameters
Target VMs:
lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 22.04.1 LTS
Release: 22.04
Codename: jammy
Ansible:
ansible --version
ansible [core 2.13.2]
config file = /<CUT>/postgresql_cluster/ansible.cfg
configured module search path = ['/<CUT>/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
ansible python module location = /opt/homebrew/Cellar/ansible/6.2.0/libexec/lib/python3.10/site-packages/ansible
ansible collection location = /<CUT>/.ansible/collections:/usr/share/ansible/collections
executable location = /opt/homebrew/bin/ansible
python version = 3.10.5 (main, Jun 23 2022, 17:14:57) [Clang 13.1.6 (clang-1316.0.21.2.5)]
jinja version = 3.1.2
libyaml = True
I set up a cluster. During the installation process, the following error appeared (it was ignored):
TASK [sysctl : Setting kernel parameters] ************************************************************************************************************
fatal: [172.31.24.217]: FAILED! => {"msg": "The task includes an option with an undefined variable. The error was: 'str object' has no attribute 'name'\n\nThe error appears to be in '/<CUT>/postgresql_cluster/roles/sysctl/tasks/main.yml': line 12, column 7, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n\n - name: Setting kernel parameters\n ^ here\n"}
...ignoring
fatal: [172.31.25.36]: FAILED! => {"msg": "The task includes an option with an undefined variable. The error was: 'str object' has no attribute 'name'\n\nThe error appears to be in '/<CUT>/postgresql_cluster/roles/sysctl/tasks/main.yml': line 12, column 7, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n\n - name: Setting kernel parameters\n ^ here\n"}
...ignoring
fatal: [172.31.25.51]: FAILED! => {"msg": "The task includes an option with an undefined variable. The error was: 'str object' has no attribute 'name'\n\nThe error appears to be in '/<CUT>/postgresql_cluster/roles/sysctl/tasks/main.yml': line 12, column 7, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n\n - name: Setting kernel parameters\n ^ here\n"}
...ignoring
In file system.yml I have default values:
...........
sysctl_conf:
etcd_cluster: []
master: []
replica: []
postgres_cluster:
- {name: "vm.overcommit_memory", value: "2"}
- {name: "vm.swappiness", value: "1"}
- {name: "vm.min_free_kbytes", value: "102400"}
- {name: "vm.dirty_expire_centisecs", value: "1000"}
- {name: "vm.dirty_background_bytes", value: "67108864"}
- {name: "vm.dirty_bytes", value: "536870912"}
# - {name: "vm.nr_hugepages", value: "9510"} # example "9510
- {name: "vm.zone_reclaim_mode", value: "0"}
- {name: "kernel.numa_balancing", value: "0"}
- {name: "kernel.sched_migration_cost_ns", value: "5000000"}
- {name: "kernel.sched_autogroup_enabled", value: "0"}
- {name: "net.ipv4.ip_nonlocal_bind", value: "1"}
- {name: "net.ipv4.ip_forward", value: "1"}
- {name: "net.ipv4.ip_local_port_range", value: "10000 65535
- {name: "net.netfilter.nf_conntrack_max", value: "1048576"}
- {name: "net.core.netdev_max_backlog", value: "10000"}
- {name: "net.ipv4.tcp_max_syn_backlog", value: "8192"}
- {name: "net.core.somaxconn", value: "65535"}
- {name: "net.ipv4.tcp_tw_reuse", value: "1"}
# - {name: "", value: ""}
balancers:
- {name: "net.ipv4.ip_nonlocal_bind", value: "1"}
- {name: "net.ipv4.ip_forward", value: "1"}
- {name: "net.ipv4.ip_local_port_range", value: "10000 65535
- {name: "net.netfilter.nf_conntrack_max", value: "1048576"}
- {name: "net.core.netdev_max_backlog", value: "10000"}
- {name: "net.ipv4.tcp_max_syn_backlog", value: "8192"}
- {name: "net.core.somaxconn", value: "65535"}
- {name: "net.ipv4.tcp_tw_reuse", value: "1"}
# - {name: "", value: ""}
..........
The cluster works, but the error is annoying....
Hi @torquemada163
In your example is missing the "} for "net.ipv4.ip_local_port_range"
See https://github.com/vitabaks/postgresql_cluster/blob/master/vars/system.yml#L59