Вторичный сервер FreeIPA и настройка репликации

Необходимо проинсталлировать реплику сервера FreeIPA, настроить синхронизацию и произвести переключение ролей Replica <-> Master FreeIPA. Поехали

Первоначальная настройка сервера

Установим время

Синхронизация времени важна, поэтому установим утилиту chrony

Зададим FQDN имя

Настроим правила фаервола

Отключим SELinux

Установка службы FreeIPA в качестве реплики

Устанавливаем freeipa-server

Далее все операции производятся на сервере реплике

После установки пакетов ipa-server и ipa-server-dns можно переходить к подключению к основному серверу. Так будет производиться репликация каталога и ДНС, то установим пакет ipa-server-dns. Для этого выполним конфигурирование клиента. Перед этим необходимо внести изменения в /etc/resolv.conf, указав в качестве ДНС первый сервер или внести в файл /etc/hosts соответствие имени и адреса первого сервера. Например так

Настроим клиент следующей командой

Лог установки
[root@freeipa02 ~]# ipa-client-install —mkhomedir
This program will set up IPA client.
Version 4.12.2

Discovery was successful!
Do you want to configure chrony with NTP server or pool address? [no]:
Client hostname: freeipa02.datastore.center
Realm: DATASTORE.CENTER
DNS Domain: datastore.center
IPA Server: freeipa01.datastore.center
BaseDN: dc=datastore,dc=center

Continue to configure the system with these values? [no]: yes
Synchronizing time
No SRV records of NTP servers found and no NTP server or pool address was provided.
Using default chrony configuration.
Attempting to sync time with chronyc.
Time synchronization was successful.
User authorized to enroll computers: admin
Password for admin@DATASTORE.CENTER:
Successfully retrieved CA cert
Subject: CN=Certificate Authority,O=DATASTORE.CENTER
Issuer: CN=Certificate Authority,O=DATASTORE.CENTER
Valid From: 2025-01-11 13:10:31+00:00
Valid Until: 2045-01-11 13:10:31+00:00

Enrolled in IPA realm DATASTORE.CENTER
Created /etc/ipa/default.conf
Configured /etc/sssd/sssd.conf
Systemwide CA database updated.
Hostname (freeipa02.datastore.center) does not have A/AAAA record.
Missing reverse record(s) for address(es): 10.10.88.44.
Adding SSH public key from /etc/ssh/ssh_host_rsa_key.pub
Adding SSH public key from /etc/ssh/ssh_host_ed25519_key.pub
Adding SSH public key from /etc/ssh/ssh_host_ecdsa_key.pub
SSSD enabled
Configured /etc/openldap/ldap.conf
Configured /etc/ssh/ssh_config
Configured /etc/ssh/sshd_config.d/04-ipa.conf
Configuring datastore.center as NIS domain.
Configured /etc/krb5.conf for IPA realm DATASTORE.CENTER
Client configuration complete.
The ipa-client-install command was successful

Проверка получения билета

Добавление вторичного сервера ipaservers

Лог установки
[root@freeipa02 ~]# ipa hostgroup-add-member ipaservers —hosts freeipa02.datastore.center
Группа узлов: ipaservers
Описание: IPA server hosts
Узлы-участники: freeipa01.datastore.center, freeipa02.datastore.center
————————————
Количество добавленных участников 1
————————————

Настройка репликации

Лог установки
[root@freeipa02 ~]# ipa-replica-install —setup-dns —no-forwarders
Lookup failed: Preferred host freeipa02.datastore.center does not provide DNS.
Reverse DNS resolution of address 10.10.88.44 (freeipa02.datastore.center) failed. Clients may not function properly. Please check your DNS setup. (Note that this check queries IPA DNS directly and ignores /etc/hosts.)
Continue? [no]: yes
Run connection check to master
Connection check OK
Disabled p11-kit-proxy
Configuring directory server (dirsrv). Estimated time: 30 seconds
[1/40]: creating directory server instance
Validate installation settings …
Create file system structures …
Perform SELinux labeling …
Create database backend: dc=datastore,dc=center …
Perform post-installation tasks …
[2/40]: tune ldbm plugin
[3/40]: adding default schema
[4/40]: enabling memberof plugin
[5/40]: enabling winsync plugin
[6/40]: configure password logging
[7/40]: configuring replication version plugin
[8/40]: enabling IPA enrollment plugin
[9/40]: configuring uniqueness plugin
[10/40]: configuring uuid plugin
[11/40]: configuring modrdn plugin
[12/40]: configuring DNS plugin
[13/40]: enabling entryUSN plugin
[14/40]: configuring lockout plugin
[15/40]: configuring graceperiod plugin
[16/40]: configuring topology plugin
[17/40]: creating indices
[18/40]: enabling referential integrity plugin
[19/40]: configuring certmap.conf
[20/40]: configure new location for managed entries
[21/40]: configure dirsrv ccache and keytab
[22/40]: enabling SASL mapping fallback
[23/40]: restarting directory server
[24/40]: creating DS keytab
[25/40]: ignore time skew for initial replication
[26/40]: setting up initial replication
Starting replication, please wait until this has completed.
Update in progress, 15 seconds elapsed
Update succeeded

[27/40]: prevent time skew after initial replication
[28/40]: adding sasl mappings to the directory
[29/40]: updating schema
[30/40]: setting Auto Member configuration
[31/40]: enabling S4U2Proxy delegation
[32/40]: initializing group membership
[33/40]: adding master entry
[34/40]: initializing domain level
[35/40]: configuring Posix uid/gid generation
[36/40]: adding replication acis
[37/40]: activating sidgen plugin
[38/40]: activating extdom plugin
[39/40]: configuring directory to start on boot
[40/40]: restarting directory server
Done configuring directory server (dirsrv).
Replica DNS records could not be added on master: Insufficient access: Insufficient ‘add’ privilege to add the entry ‘idnsname=freeipa02,idnsname=datastore.center.,cn=dns,dc=datastore,dc=center’.
Configuring Kerberos KDC (krb5kdc)
[1/6]: configuring KDC
[2/6]: adding the password extension to the directory
[3/6]: creating anonymous principal
[4/6]: starting the KDC
[5/6]: configuring KDC to start on boot
[6/6]: enable PAC ticket signature support
Done configuring Kerberos KDC (krb5kdc).
Configuring kadmin
[1/2]: starting kadmin
[2/2]: configuring kadmin to start on boot
Done configuring kadmin.
Configuring directory server (dirsrv)
[1/3]: configuring TLS for DS instance
[2/3]: importing CA certificates from LDAP
[3/3]: restarting directory server
Done configuring directory server (dirsrv).
Configuring the web interface (httpd)
[1/22]: stopping httpd
[2/22]: backing up ssl.conf
[3/22]: disabling nss.conf
[4/22]: configuring mod_ssl certificate paths
[5/22]: setting mod_ssl protocol list
[6/22]: configuring mod_ssl log directory
[7/22]: disabling mod_ssl OCSP
[8/22]: adding URL rewriting rules
[9/22]: configuring httpd
Nothing to do for configure_httpd_wsgi_conf
[10/22]: setting up httpd keytab
[11/22]: configuring Gssproxy
[12/22]: setting up ssl
[13/22]: configure certmonger for renewals
[14/22]: publish CA cert
[15/22]: clean up any existing httpd ccaches
[16/22]: enable ccache sweep
[17/22]: configuring SELinux for httpd
[18/22]: create KDC proxy config
[19/22]: enable KDC proxy
[20/22]: starting httpd
[21/22]: configuring httpd to start on boot
[22/22]: enabling oddjobd
Done configuring the web interface (httpd).
Configuring ipa-otpd
[1/2]: starting ipa-otpd
[2/2]: configuring ipa-otpd to start on boot
Done configuring ipa-otpd.
Custodia uses ‘freeipa01.datastore.center’ as master peer.
Configuring ipa-custodia
[1/4]: Generating ipa-custodia config file
[2/4]: Generating ipa-custodia keys
[3/4]: starting ipa-custodia
[4/4]: configuring ipa-custodia to start on boot
Done configuring ipa-custodia.
Configuring certificate server (pki-tomcatd)
[1/2]: configure certmonger for renewals
[2/2]: Importing RA key
Done configuring certificate server (pki-tomcatd).
Configuring Kerberos KDC (krb5kdc)
[1/1]: installing X509 Certificate for PKINIT
Done configuring Kerberos KDC (krb5kdc).
Applying LDAP updates
Upgrading IPA:. Estimated time: 1 minute 30 seconds
[1/10]: stopping directory server
[2/10]: saving configuration
[3/10]: disabling listeners
[4/10]: enabling DS global lock
[5/10]: disabling Schema Compat
[6/10]: starting directory server
[7/10]: upgrading server
[8/10]: stopping directory server
[9/10]: restoring configuration
[10/10]: starting directory server
Done.
Finalize replication settings
Restarting the KDC
dnssec-validation yes
Configuring DNS (named)
[1/9]: generating rndc key file
[2/9]: setting up our own record
[3/9]: adding NS record to the zones
[4/9]: setting up kerberos principal
[5/9]: setting up LDAPI autobind
[6/9]: setting up named.conf
created new /etc/named.conf
created named user config ‘/etc/named/ipa-ext.conf’
created named user config ‘/etc/named/ipa-options-ext.conf’
created named user config ‘/etc/named/ipa-logging-ext.conf’
[7/9]: setting up server configuration
[8/9]: configuring named to start on boot
[9/9]: changing resolv.conf to point to ourselves
Done configuring DNS (named).
Restarting the web server to pick up resolv.conf changes
Configuring DNS key synchronization service (ipa-dnskeysyncd)
[1/7]: checking status
[2/7]: setting up bind-dyndb-ldap working directory
[3/7]: setting up kerberos principal
[4/7]: setting up SoftHSM
[5/7]: adding DNSSEC containers
DNSSEC container exists (step skipped)
[6/7]: creating replica keys
[7/7]: configuring ipa-dnskeysyncd to start on boot
Done configuring DNS key synchronization service (ipa-dnskeysyncd).
Restarting ipa-dnskeysyncd
Restarting named
Updating DNS system records

Global DNS configuration in LDAP server is empty
You can use ‘dnsconfig-mod’ command to set global DNS options that
would override settings in local named.conf files

Configuring SID generation
[1/7]: adding RID bases
RID bases already set, nothing to do
[2/7]: creating samba domain object
Samba domain object already exists
[3/7]: adding admin(group) SIDs
Admin SID already set, nothing to do
Admin group SID already set, nothing to do
[4/7]: updating Kerberos config
‘dns_lookup_kdc’ already set to ‘true’, nothing to do.
[5/7]: activating sidgen task
[6/7]: restarting Directory Server to take MS PAC and LDAP plugins changes into account
[7/7]: adding fallback group
Fallback group already set, nothing to do
Done.

WARNING: The CA service is only installed on one server (freeipa01.datastore.center).
It is strongly recommended to install it on another server.
Run ipa-ca-install(1) on another master to accomplish this.

The ipa-replica-install command was successful

Установка IPA-CA

Система настоятельно рекомендует устанавливать роль ipa-ca. И это совершенно верно. Для полноценной работы необходима полная репликация

Лог установки
[root@freeipa02 ~]# ipa-ca-install
Directory Manager (existing master) password:

Running ipa-certupdate…done
Run connection check to master
Connection check OK
Configuring certificate server (pki-tomcatd). Estimated time: 3 minutes
[1/31]: creating certificate server db
[2/31]: ignore time skew for initial replication
[3/31]: setting up initial replication
Starting replication, please wait until this has completed.
Update in progress, 10 seconds elapsed
Update succeeded

[4/31]: revert time skew after initial replication
[5/31]: creating ACIs for admin
[6/31]: creating installation admin user
[7/31]: configuring certificate server instance
[8/31]: stopping certificate server instance to update CS.cfg
[9/31]: backing up CS.cfg
[10/31]: Add ipa-pki-wait-running
[11/31]: secure AJP connector
[12/31]: reindex attributes
[13/31]: exporting Dogtag certificate store pin
[14/31]: disabling nonces
[15/31]: set up CRL publishing
[16/31]: enable PKIX certificate path discovery and validation
[17/31]: authorizing RA to modify profiles
[18/31]: authorizing RA to manage lightweight CAs
[19/31]: Ensure lightweight CAs container exists
[20/31]: Enable lightweight CA monitor
[21/31]: Ensuring backward compatibility
[22/31]: destroying installation admin user
[23/31]: starting certificate server instance
[24/31]: Finalize replication settings
[25/31]: configure certificate renewals
[26/31]: Configure HTTP to proxy connections
[27/31]: updating IPA configuration
[28/31]: enabling CA instance
[29/31]: importing IPA certificate profiles
[30/31]: configuring certmonger renewal for lightweight CAs
[31/31]: deploying ACME service
Done configuring certificate server (pki-tomcatd).
Updating DNS system records

Проверка работы контроллера и синхронизации

Для диагностики, необходимо установить пакет ipa-healthcheck

Проверка критических ошибок системы. У меня ругается на свободное место, например

Лог вывода
[root@freeipa01 ~]# ipa-healthcheck —failures-only
[
{
«source»: «ipahealthcheck.system.filesystemspace»,
«check»: «FileSystemSpaceCheck»,
«result»: «ERROR»,
«uuid»: «b40e3047-3444-4f64-96ee-32fca4647470»,
«when»: «20250113091618Z»,
«duration»: «0.000396»,
«kw»: {
«key»: «/var/lib/dirsrv/»,
«msg»: «/var/lib/dirsrv/: free space under threshold: 878 MiB < 1024 MiB»,
«store»: «/var/lib/dirsrv/»,
«free_space»: 878,
«threshold»: 1024
}
},
{
«source»: «ipahealthcheck.system.filesystemspace»,
«check»: «FileSystemSpaceCheck»,
«result»: «ERROR»,
«uuid»: «14b43dc9-a9f9-4d7e-89b6-5631d59b59e6»,
«when»: «20250113091618Z»,
«duration»: «0.000642»,
«kw»: {
«key»: «/var/log/»,
«msg»: «/var/log/: free space under threshold: 878 MiB < 1024 MiB»,
«store»: «/var/log/»,
«free_space»: 878,
«threshold»: 1024
}
}
]

Проверка репликации

В конечном итоге, мы должны получить такую схему


0 0 голоса
Рейтинг статьи
Звёзд: 1Звёзд: 2Звёзд: 3Звёзд: 4Звёзд: 5 (Пока оценок нет)
Загрузка...
Подписаться
Уведомить о
guest
0 комментариев
Старые
Новые Популярные
Межтекстовые Отзывы
Посмотреть все комментарии