Bug 52349 - Проблема соединения: на клиенте Failed to open TCP connection
Summary: Проблема соединения: на клиенте Failed to open TCP connection
Status: NEW
Alias: None
Product: Sisyphus
Classification: Development
Component: puppet (show other bugs)
Version: unstable
Hardware: x86_64 Linux
: P5 normal
Assignee: majioa@altlinux.org
QA Contact: qa-sisyphus
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-12-05 11:51 MSK by Tatyana Gagina
Modified: 2024-12-05 11:51 MSK (History)
9 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tatyana Gagina 2024-12-05 11:51:44 MSK
Cтенды, обновлённые до Sisyphus:
ALT Server x86-64 - мастер (сервер)
ALT Workstation x86-64 - клиент

puppet-agent - это служба puppet из пакета puppet
Версия: puppet-8.4.0-alt2

Шаги: 
1) Настроить сервер:
# echo "$(hostname -i) puppetdb" >>/etc/hosts
# hostnamectl set-hostname master
# reboot

* запустить postgresql и создать пользователя и базу:
# /etc/init.d/postgresql initdb
# systemctl enable --now postgresql
# echo "listen_addresses = 'localhost'" >> /var/lib/pgsql/data/postgresql.conf
# echo "host puppetdb puppetdb 127.0.0.1/32 md5" >> /var/lib/pgsql/data/pg_hba.conf
# systemctl restart postgresql
# echo "CREATE EXTENSION pg_trgm;" | psql -U postgres
# createuser -U postgres -DRSP puppetdb
# createdb -U postgres -O puppetdb puppetdb
# psql -h 127.0.0.1 -p 5432 -U puppetdb -W puppetdb

2) Настроить клиента: 
# echo -e "[agent]\nserver=master" >/etc/puppet/puppet.conf
# echo "<master_ip> master" >>/etc/hosts
# puppet agent --test

Результат: 
Error: Connection to https://master:8140/puppet-ca/v1 failed, trying next route: Request to https://master:8140/puppet-ca/v1 failed after 0.003 seconds: 
Failed to open TCP connection to master:8140 (Connection refused - connect(2) for "master" port 8140)
Замечено также здесь https://github.com/zulip/zulip/issues/10874?ysclid=m4b26u06wm391041361

Детали: 
# systemctl status puppetserver
active (running) 

Workaround:
Проверить, открыт ли порт:
# apt-get install nmap && nmap -p 8140 master

Starting Nmap 7.94 ( https://nmap.org ) at 2024-12-05 11:28 MSK
Failed to resolve "master".
WARNING: No targets were specified, so 0 hosts scanned.
Nmap done: 0 IP addresses (0 hosts up) scanned in 0.16 seconds

Проверено на клиенте: мастер не пингуется.

Просмотреть список портов:
# firewall-cmd --list-all
public (default, active)
  target: default
  ingress-priority: 0
  egress-priority: 0
  icmp-block-inversion: no
  interfaces: 
  sources: 
  services: dhcpv6-client ssh
  ports: 
  protocols: 
  forward: yes
  masquerade: no
  forward-ports: 
  source-ports: 
  icmp-blocks: 
  rich rules:

Чтобы открыть порт 8140 было выполнено: 
# firewall-cmd --add-port=8140/tcp --permanent
success

# firewall-cmd --reload
success

Теперь порт открыт: 
# firewall-cmd --list-all
public (default, active)
  target: default
  ingress-priority: 0
  egress-priority: 0
  icmp-block-inversion: no
  interfaces: 
  sources: 
  services: dhcpv6-client ssh
  ports: 8140/tcp
  protocols: 
  forward: yes
  masquerade: no
  forward-ports: 
  source-ports: 
  icmp-blocks: 
  rich rules: 

Ожидаемый результат: при работе с puppet не закрывается TCP соединение, нет ошибки Failed to open TCP connection при выполнении # puppet agent --test