开源大数据集群部署(四)Freeipa部署(kerberos+ldap)

櫰木2年前技术文章2200

1、 FreeIPA介绍

Kerberos协议只是一种协议标准的框架,而MIT Kerberos则是实现了该协议的认证服务,是Kerberos的物理载体。将它与Hadoop服务进行集成便能够很好地解决安全性不足的问题。

除了需要安装MIT Kerberos之外,我们还需要安装LDAP。在生产环境中Knox使用附带的LDAP服务显然是不合适的,因此需要一种更为正式的安装方式。

Kerberos和LDAP服务这类基础设施服务虽好,但是手动安装起来非常繁琐,接下来用一种全新的方法,通过使用FreeAPI来安装上述的基础设施组件。

FreeIPA是一个集成的安全信息管理解决方案。它整合了Kerberos、LDAP、NTP、Bind、Apache、Tomcat等核心软件包,从而形成了一个以LDAP为数据存储后端,Kerberos为验证前端,Bind为主机识别,同时还提供统一的命令行管理工具和WEB管理界面的集成信息管理系统。FreeIPA建立在著名的开源组件和标准协议之上,具有易于管理、安装和配置任务自动化的特点

2、安装说明

FreeIPA服务分为IPA-Server和IPA-Client两个部分,需要单独准备一台服务器安装IPA-Server,这台服务器不能属于任何由Ambari管理的集群节点,这是因为在安装IPA-Server的过程中,安装程序会将其所在的服务器地址注册到DNS服务中,而Ambari的集群节点也会进行相同的注册动作。如果一台服务器同时安装了IPA-Server并注册成为Ambari节点,就会造成名称的冲突,导致在注册DNS的过程中失败。IPA-Client和IPA-Server恰恰相反,Ambari管理的所有集群节点服务器上都必须安装。

 

3、安装IPA-Server

FreeIPA下载地址:https://www.freeipa.org/page/Downloads

操作系统里面已经集成了FreeIPA安装包,可通过yum安装

3.1扩充密钥长度

Kerberos需要使用256位的AES加密算法,而JRE中默认的密码长度比较短,并不足以支撑。所以我们需要升级集群中所有服务器JRE安全策略,使其能够接触密钥长度的限制。修改的方式是下载并替换JRE中的Unlimited JCEPolicy文件。下载Cryptography Extension (JCE) Unlimited Strength Jurisdiction Policy File,解压下载后的zip包,将得到的jar包放到所有服务器上的$JAVA_HOME/jre/lib/security/目录下

下载地址如下:

https://www.oracle.com/java/technologies/javase-jce8-downloads.html

 

图片 1.png

 

4、修改服务器主机名(单独一台主机)

服务器的主机名需要与FreeIPA的完全限定域名(FQDN)匹配才能正常工作

#命令行执行以下命令

hostnamectl set-hostname jz004.hdp.hadoop

#配置/etc/hosts,添加以下配置

172.26.232.150 ipa.hdp.hadoop

5、配置随机数生成器

yum -y install rng-tools

#启动服务

systemctl start rngd

#配置开机自启

systemctl enable rngd

#查看状态

systemctl status rngd

#升级the NSS libraries.

yum install -y yum update nss* -y

6、安装ipa-server软件包

密钥扩充完毕之后就可以开始安装IPA-Server了,IPA-Server的整个安装过程中分为三个部分,分别是安装IPA系统工具、安装IPA-Server和配置IPA-Server

运行yum install命令安装IPA系统工具

yum install -y ntp ipa-server ipa-server-dns bind-dyndb-ldap


7、配置ipa-server

IPA系统工具安装完之后就能够执行ipa-server相关的shell命令了,通过执行ipa-server-install --allow-zone-overlap

命令安装IPA服务

20230301162400.jpg

除了身份验证,FreeIPA还能够管理主机的DNS记录。这可以使配置和管理主机更容易。

接下来,需要输入服务器的主机名、域名和Kerberos域名。Kerberos是一种身份验证协议,FreeIPA利用这些协议来验证主机的身份。强烈建议使用域名作为Kerberos域。使用不同的命名方案将导致FreeIPA的Active Directory集成出现问题,并可能导致其他问题。

警告:不要将根域(example.com)用作IPA域名。这可能会导致DNS问题。




20230301162550.jpg

20230301162723.jpg

Server host name [ipa.example.org]: ipa.example.org
Please confirm the domain name [example.org]: ipa.example.org
Please provide a realm name [EXAMPLE.ORG]: IPA.EXAMPLE.ORG
The log file for this installation can be found in/var/log/ipaserver-install.log
==============================================================================
This program will set up the IPA Server.
 
This includes:
  *Configure a stand-alone CA (dogtag) for certificate management
  *Configure the Network Time Daemon (ntpd)
  * Createand configure an instance of Directory Server
  * Createand configure a Kerberos Key Distribution Center (KDC)
  *Configure Apache (httpd)
  *Configure the KDC to enable PKINIT
 
To accept the default shown in brackets, press theEnter key.
WARNING: conflicting time&date synchronizationservice 'chronyd' will be disabled
in favor of ntpd
 
Do you want to configureintegrated DNS (BIND)? [no]: yes
Enter the fully qualified domain name of thecomputer
on which you're setting up server software. Usingthe form
<hostname>.<domainname>
Example: master.example.com.
Server host name[wang-1.tmp.gce.cloudera.com]:回车
Warning: skipping DNS resolution of hostwang-1.tmp.gce.cloudera.com
The domain name has been determined based on thehost name.
Please confirm the domainname [tmp.gce.cloudera.com]:回车
The kerberos protocol requires a Realm name to bedefined.
This is typically the domain name converted touppercase.
 
Please provide a realm name[TMP.GCE.CLOUDERA.COM]:自己定义一个域名,否则默认使用括号中的域名
Certain directory server operations require anadministrative user.
This user is referred to as the Directory Managerand has full access
to the Directory for system management tasks andwill be added to the
instance of directory server created for IPA.
The password must be at least 8 characters long.
Directory Manager password:自己配置密码
Password (confirm):再输一遍
 
The IPA server requires an administrative user,named 'admin'.
This user is a regular system account used for IPAserver administration.
IPA admin password:自己配置密码
Password (confirm):再输一遍
Checking DNS domain tmp.gce.cloudera.com., pleasewait ...
Do you want to configure DNSforwarders? [yes]:yes
Following DNS servers are configured in/etc/resolv.conf: 127.0.0.1, 8.8.8.8
Do you want to configurethese servers as DNS forwarders? [yes]:yes
All DNS servers from /etc/resolv.conf were added.You can enter additional addresses now:
Enter an IP address for a DNSforwarder, or press Enter to skip:
 
Checking DNS forwarders, please wait ...
Do you want to search formissing reverse zones? [yes]:yes
Do you want to create reversezone for IP 172.31.115.124 [yes]:yes
Please specify the reversezone name [115.31.172.in-addr.arpa.]:(直接回车)
Using reverse zone(s) 115.31.172.in-addr.arpa.
The IPA Master Server will be configured with:
Hostname:      wang-1.tmp.gce.cloudera.com
IP address(es): 172.31.115.124
Domain name:   tmp.gce.cloudera.com
Realm name:    TMP.GCE.CLOUDERA.COM
 
BIND DNS server will be configured to serve IPAdomain with:
Forwarders:      127.0.0.1, 8.8.8.8
Forward policy:  only
Reverse zone(s): 115.31.172.in-addr.arpa.
 
Continue to configure thesystem with these values? [no]: yes
接下来,为LDAP管理器创建密码。这是FreeIPA功能所必需的LDAP。然后是IPA管理员密码,将在以管理员用户身份登录FreeIPA时使用。强烈建议使用安全随机生成的密码,因为整个系统的安全性取决于它们。
确认配置。在此之后,安装程序将运行。
Continue to configure the system with these values?[no]: yes

8、 问题记录

(1)如果安装过程报错:ipa-server-install command failed, exception: RuntimeError: CA did not start in 300.0s

(2)执行命令更新nss,update nss packages

(3)yum update nss

 

 

9、WEB UI访问

配置完成后访问https://hd.dtstack.com/

密码即为刚才在交互式安装设置的密码


相关文章

Redis Sentinel与Cluster安装部署(二)

3.2cluster部署1、在对应的机器,下载、解压redis #详见sentinel部署内相关命令 2、创建对应的文件目录   mkdir -p /usr/lcoal/redis5/clust...

MySQL 添加列报错处理

MySQL 添加列报错处理

一、添加列报错(65535)表添加列收到报错,具体 SQL 和报错信息如下:ALTER TABLE table ADD column varchar(256) NULL COMMENT '个人打款授权...

副本集的同步、心跳、选举、回滚

一、副本集同步过程   MongoDB的复制功能是依赖与oplog来实现的。   1.数据写入主节点同时在local.oplog.rs集合写入对应的oplog   2.备份节点第一次同步数据时,会先进...

百万并发下的nginx优化

百万并发下的nginx优化

百万并发下的nginx优化之道一、nginx地址重写1、nginx地址重写(rewrite)介绍nginx地址重写的主要功能是实现URL地址的重定向。服务器获得一个来访的URL请求,然后改写成服务器可...

MySQL运维实战之备份和恢复(8.6)将数据库恢复到指定时间点

恢复到指定时间点使用全量备份和增量备份文件,都只能将数据库恢复到备份结束的时间。通过binlog,可以将数据库恢复到任意时间点(前提是备份和该时间点之间的binlog都存在)。找到时间点对应的binl...

Linux】项目自动化构建工具-make/Makefile 详解

Linux】项目自动化构建工具-make/Makefile 详解

 在Linux及类Unix系统中,自动化构建项目是提高开发效率、减少重复劳动的关键环节。make工具及其配置文件Makefile是实现这一目标的重要工具组合。它们通过定义一系列规则和依赖关系,自动执行...

发表评论    

◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。