適用於大型環境的 PowerFlex 4.x LDAP 組態

Summary: 使用 PowerFlex 管理平台 SSO 後端縮小使用者和群組 LDAP 搜尋篩選器的範圍,我們可以緩解已觀察到會導致多個 UI 和平台問題的同步問題。

This article applies to This article does not apply to This article is not tied to any specific product. Not all product versions are identified in this article.

Instructions

  1. 預備動作
  2. 移除和清理 LDAP 提供者
  3. 重新建置 LDAP 提供者
  4. 縮小 LDAP 使用者和群組範圍應用程式

 

 

背景: 

 

根據預設,PowerFlex 管理平台 (PFMP) 目錄提供者會匯入所設定搜尋範圍內的所有 LDAP 物件,包括非使用者帳戶和我們 RBAC 不需要的其他物件。

在大型環境中,此行為可能會導致跨 PFMP 管理 VM (MVM)、支援的 Postgres 資料庫和整個平臺的大量資源使用率。

因此,LDAP 同步可能無法在可接受的時間範圍內完成,從而導致作業積壓、記憶體洩漏和併發問題。

 

1.預備動作

 

需求:

 

 

使用 Active Directory 全域目錄

注意:  我們需要使用連接埠 3268 作為標準 LDAP,或 3269 作為 AD 環境中的 LDAPS。這允許來自子域或其他受信任域的LDAP組成員在PFMP中使用。

例如 AD 群組:

 

PFMP 的 LDAP 使用者同盟 Keycloak 必須顯示 na.powerflex.lab.dell.com 上方的子網域,使用全域編錄連接埠允許這些子網域進行連線。 

這也是我們在 PFMP 目錄提供者中使用 objectGUID 的原因,它會將帳戶綁定到其全域唯一 UUID。

 

如果兩個子域都列在“信任”選項卡下,則默認情況下子域似乎相互信任。

在 Microsoft Active Directory (AD) 環境中,父域及其子 (子) 域在層次結構中固有地相互信任。這稱為可傳遞信任。

默認情況下,這些信任是雙向和可傳遞的,這意味著父域信任其子域,反之亦然。這種可傳遞性質將信任擴展到父子層次結構中的所有域。

 

從 DNS 項目尋找可用的 LDAP 或 AD GC 伺服器

 

通常客戶會提供LDAP位址以供使用。  作為本指南後續步驟的一部分,可以先從 PFMP 目錄提供程式配置中複製這些設置,然後再將其刪除。

或者,可以從特定域的 DNS 中檢索可用的伺服器:

 

# listing LDAP server
$ host -t srv _ldap._tcp.powerflex.lab.dell.com
Server:  nameserver.dell.com
Address:  10.8.8.8

Non-authoritative answer:
_ldap._tcp.powerflex.lab.dell.com       service = 0 100 636 hcihopad1.powerflex.lab.dell.com. _ldap._tcp.powerflex.lab.dell.com       service = 0 100 389 hcihopad1.powerflex.lab.dell.com. _ldap._tcp.powerflex.lab.dell.com       service = 0 100 389 hcick3ad2.powerflex.lab.dell.com. _ldap._tcp.powerflex.lab.dell.com       service = 0 100 636 hcick3ad1.powerflex.lab.dell.com. _ldap._tcp.powerflex.lab.dell.com       service = 0 100 389 hcihopad3.powerflex.lab.dell.com.
# listing AD GC servers (Active Directory Global Catalog) 
host -t srv _gc._tcp.powerflex.lab.dell.com
Server:  nameserver.dell.com
Address:  10.8.8.8

Non-authoritative answer:
_gc._tcp.powerflex.lab.dell.com service = 0 100 3268 hcihopad3.powerflex.lab.dell.com.
_gc._tcp.powerflex.lab.dell.com service = 0 100 3268 hcick3ad3.powerflex.lab.dell.com.
_gc._tcp.powerflex.lab.dell.com service = 0 100 3268 hcick3ad2.powerflex.lab.dell.com.

 

 

如何尋找 OU 或群組的辨別名稱。

首先,我們需要 OU 和群組的辨別名稱 (DN),我們將要將使用者讀入其中的 PFMP。  這些路徑並未嚴格遵循 DNS 命名,並且包含 OU 位於可手動解壓縮的 x.500 LDAP 路徑中。

我們可以根據操作系統使用不同的實用程式找到這些 DN,一種簡單的方法是使用 curl:

如何在 Linux 上使用 curl 公用程式測試 PFMP LDAP 設定

 

安裝在MVM上的較新版本的curl可用於查找所需的完整可分辨名稱,例如,此搜索LabAdmins Group CN的完整DN:

#Get the DN of your groups for use in the LDAP User filter while also validating your LDAP Group Filter syntax
# Set this to the group filter you intend to use in keycloak
GROUPFILTER='(CN=LabAdmins)'
# Use the LDAP svc bind creds to confirm the user can in fact call LDAP and see the group(s)
BINDUSER="user@powerflex.lab.dell.com"
# LDAP server URL.  For TLS use ldaps:// and port 3269
LDAPSERVER='ldap://ldap.powerflex.lab.dell.com:3268'
# Use the same search base as you intend for the group path, generally just the DC components
SEARCHBASE=DC=powerflex,DC=lab,DC=dell,DC=com
# Call curl which will request the password of the bind user and return results curl -s sub --user "$BINDUSER" "$LDAPSERVER/$SEARCHBASE?distinguishedName?sub?$GROUPFILTER" 

Enter host password for user 'jacqup@powerflex.lab.dell.com':

 

DN:CN=LabAdmins,CN=Users,DC=powerflex,DC=lab,DC=dell,DC=com
      distinguishedName:CN=LabAdmins,CN=Users,DC=powerflex,DC=lab,DC=dell,DC=com

DN: CN=LabAdmins,CN=Users,DC=na,DC=powerflex,DC=lab,DC=dell,DC=com  distinguishedName: CN=LabAdmins,CN=Users,DC=na,DC=powerflex,DC=lab,DC=dell,DC=com

 

 

Manual examples:

 

curl -s sub --user "FLEXLAB\jacqup"
"ldap://ldap.powerflex.lab.dell.com:3268/DC=powerflex,DC=lab,DC=dell,DC=com?distinguishedName,objectGUID?sub?(|(CN=FLEXLAB-APP-PROD-SDS-Admin)(CN=LabAdmins)(CN=LabUsers)(CN=EMEALabAdmins))"

Enter host password for user 'FLEXLAB\jacqup':

DN: CN=LabAdmins,CN=Users,DC=powerflex,DC=lab,DC=dell,DC=com
       distinguishedName: CN=LabAdmins,CN=Users,DC=powerflex,DC=lab,DC=dell,DC=com

DN: CN=LabAdmins,CN=Users,DC=na,DC=powerflex,DC=lab,DC=dell,DC=com
       distinguishedName: CN=LabAdmins,CN=Users,DC=na,DC=powerflex,DC=lab,DC=dell,DC=com

DN: CN=LabUsers,CN=Users,DC=powerflex,DC=lab,DC=dell,DC=com
       distinguishedName: CN=LabUsers,CN=Users,DC=powerflex,DC=lab,DC=dell,DC=com

使用過濾器屬性查找LDAP組的所有成員,然後可以將其放入keycloak後端:

#check for all members of the group with CN=LabAdmins

curl -s sub
--user "jacqup@powerflex.lab.dell.com"
"ldap://ldap.powerflex.lab.dell.com:3268/DC=powerflex,DC=lab,DC=dell,DC=com?member?sub?(&(objectClass=group)(cn=LabAdmins))"

DN:CN=LabAdmins,CN=Users,DC=powerflex,DC=lab,DC=dell,DC=com
        member: CN=matrixadmin,CN=Users,DC=powerflex,DC=lab,DC=dell,DC=com
        member: CN=matrixadmin,CN=Users,DC=powerflex,DC=lab,DC=dell,DC=com
        member: CN=svc_adfsck3,CN=Users,DC=powerflex,DC=lab,DC=dell,DC=com
        member: CN=svc_mcp_rw,CN=Users,DC=powerflex,DC=lab,DC=dell,DC=com         member: CN=adcertsvc,CN=Users,DC=powerflex,DC=lab,DC=dell,DC=com         member: CN=bobthebuilder,CN=Users,DC=powerflex,DC=lab,DC=dell,DC=com         member: CN=Ashish Rahangdale,CN=Users,DC=powerflex,DC=lab,DC=dell,DC=com
        member: CN=Packer Admin,CN=Users,DC=powerflex,DC=lab,DC=dell,DC=com
        member: CN=FDLabAdmins,OU=Foundations,DC=powerflex,DC=lab,DC=dell,DC=com
        member: CN=Tejas Wadekar,CN=Users,DC=powerflex,DC=lab,DC=dell,DC=com

 

 

如何在 Linux 上使用 ldapsearchcurl 公用程式測試 PFMP LDAP 設定

 

如果網路上有可用的 Linux 主機,使用 ldapsearch 公用程式可能會有助於測試和驗證 PFMP/Keycloak 中使用的 LDAP 設定。

或者, curl 公用程式也可以用於其中一個管理虛擬機器/MVM 的 LDAP 查詢。

 

快速簡介 (常用選項):

 

 

ldapsearch - LDAP search tool
ldapsearch opens a connection to an LDAP server, binds, and performs a search using specified parameters.

usage: ldapsearch [options] [filter
[attributes...]]

where:

filter       RFC 4515 compliant LDAP search filter
attributes   whitespace-separated list of attribute descriptions

Search options:
  -b basedn base dn for search
 -LLL      print responses in LDIF format without comments and version Common options:  -D binddn bind DN  -H URI    LDAP Uniform Resource Identifier(s)  -N        do not use reverse DNS to canonicalize SASL host name  -w passwd bind password (for simple authentication)  -W        prompt for bind password  -x        Simple authentication

 

 

 

檢查/安裝工具

$ which ldapsearch
/usr/bin/ldapsearch

#RHEL/CentOS install
sudo yum install openldap-clients

# SLES install
sudo zypper install openldap2-client

 

 

從 LDAP 根項目定義 基本 DN (-b):

 

$ curl "ldap://ldap.powerflex.lab.dell.com:3268/?rootDomainNamingContext"
DN:
        rootDomainNamingContext: DC=powerflex,DC=lab,DC=dell,DC=com

# ldapsearch (with simple auth)
$ ldapsearch -LLL -H ldap://ldap.powerflex.lab.dell.com -x -D "FLEXLAB\ck3-user" -W -b "" -s base "dn=" rootDomainNamingContext

dn: rootDomainNamingContext: DC=powerflex,DC=lab,DC=dell,DC=com

 

 

根條目提供有關目錄伺服器的資訊。在 AD 上,rootDomainNamingContext 屬性會提供可用於搜尋的最高基本 DN

 -W -b "

 

測試 LDAP URI、繫結 DN (具有讀取存取權限的使用者/密碼) 和使用者搜尋設定

 

$ ldapsearch -LLL -H ldap://powerflex.lab.dell.com:3268 -x -D "CN=ck3-user,CN=Users,DC=powerflex,DC=lab,DC=dell,DC=com" -W \ -b "dc=powerflex,dc=lab,dc=dell,dc=com" "(sAMAccountName=damonl)"
Enter LDAP Password: ********

dn: CN=Luc Damon,CN=Users,DC=powerflex,DC=lab,DC=dell,DC=com
objectClass: person
cn: Luc Damon memberOf: CN=EMEALabAdmins,OU=LabAdmins,DC=powerflex,DC=lab,DC=dell,DC=com memberOf: CN=LabUsers,CN=Users,DC=powerflex,DC=lab,DC=dell,DC=com memberOf: CN=LabAdmins,CN=Users,DC=powerflex,DC=lab,DC=dell,DC=com objectGUID:: 6Z359eP5vky4P0Ye8iFp8g== sAMAccountName: damonl

# equivalent curl command:

$ curl -u 'CN=ck3-user,CN=Users,DC=powerflex,DC=lab,DC=dell,DC=com' \ 
"ldap://ldap.powerflex.lab.dell.com:3268/DC=powerflex,DC=lab,DC=dell,DC=com??sub?(sAMAccountName=damonl)"
# OR (with attributes selection)
$ curl -u 'FLEXLAB\ck3-user' \
"ldap://ldap.powerflex.lab.dell.com:3268/DC=powerflex,DC=lab,DC=dell,DC=com?cn,objectClass,memberOf,objectGUID,sAMAccountName?sub?(sAMAccountName=damonl)"

在此範例中,我們使用 sAMAccountName 屬性查詢現有使用者帳戶的 LDAP (輸出已被截斷,僅顯示我們需要的屬性)。

 

PFMP UI 中的對應設定:

位址 (-H):  ldap://active.directory.domain.address.com:3268

繫結 DN (-D):「CN=ck3-user、CN=Users、DC=powerflex、DC=lab、DC=dell、DC=com」 # (「FLEXLAB\ck3-user」或「ck3-user@powerflex.lab.dell.com」為等同名稱)

(簡單驗證需要 -x,以避免預設的 SASL 模式)

繫結 DN 密碼 (-W):提示輸入密碼 (或使用 –w '***' 在命令中提供密碼)

 

The output of the command validates the following PFMP User Search Settings:

Username LDAP Attribute: sAMAccountName

ID 屬性objectGUID

物件類

搜尋路徑 (-b):「dc=powerflex,dc=lab,dc=dell,dc=com」

 

 

測試 群組搜尋設定

 

$ ldapsearch -LLL -H ldap://powerflex.lab.dell.com:3268 -x -D "FLEXLAB\ck3-user" -W \ -b "dc=powerflex,dc=lab,dc=dell,dc=com" "(&(objectClass=group)(|(cn=FLEXLAB-APP-PROD-SDS-Admin)(cn=EMEALabAdmins)))" cn 

dn: CN=EMEALabAdmins,OU=LabAdmins,DC=powerflex,DC=lab,DC=dell,DC=com
sAMAccountName: Administrator

member: CN=ck3-builder,CN=Users,DC=powerflex,DC=lab,DC=dell,DC=com
sAMAccountName: jacqup member: CN=Luc Damon,CN=Users,DC=powerflex,DC=lab,DC=dell,DC=com sAMAccountName: damonl member: CN=Patrick Jacques,CN=Users,DC=powerflex,DC=lab,DC=dell,DC=com sAMAccountName: bobthebuilder
$ curl -u 'FLEXLAB\ck3-user' "ldap://ldap.powerflex.lab.dell.com:3268/DC=powerflex,DC=lab,DC=dell,DC=com?member?sub?(&(objectClass=group)(cn=EMEALabAdmins))"

 

 

In this example, we are querying LDAP for an existing group (objectClass) using its cn attribute and requesting member value(s).

 

It permits to validate following PFMP settings:

Group Member Attribute: member

Group ID Attribute: cn

Group Object Class: group

Group Search Path: "dc=powerflex,dc=lab,dc=dell,dc=com"

 

測試 群組 LDAP 篩選器

 $ ldapsearch -LLL -H ldap://powerflex.lab.dell.com:3268 -x -D "FLEXLAB\ck3-user" -W \ -b "dc=powerflex,dc=lab,dc=dell,dc=com" "(&(objectClass=group)(|(cn=FLEXLAB-APP-PROD-SDS-Admin)(cn=EMEALabAdmins)))" cn dn:
CN=EMEALabAdmins,OU=LabAdmins,DC=powerflex,DC=lab,DC=dell,DC=com 
cn:EMEALabAdmins

dn:CN=FLEXLAB-APP-PROD-SDS-Admin,CN=Users,DC=powerflex,DC=lab,DC=dell,DC=com
cn:FLEXLAB-APP-PROD-SDS-Admin

$ curl -u 'FLEXLAB\ck3-user' "ldap://ldap.powerflex.lab.dell.com:3268/DC=powerflex,DC=lab,DC=dell,DC=com?cn?sub?(&(objectClass=group)(|(cn=FLEXLAB-APP-PROD-SDS-Admin)(cn=EMEALabAdmins)))"

 

測試 使用者 LDAP 篩選器

$ ldapsearch -LLL -H ldap://powerflex.lab.dell.com:3268 -x -D "FLEXLAB\ck3-user" -W -b "dc=powerflex,dc=lab,dc=dell,dc=com" \
"(&(objectCategory=Person)(sAMAccountName=*)(|(memberOf=CN=FLEXLAB-APP-PROD-SDS-Admin,CN=Users,DC=powerflex,DC=lab,DC=dell,DC=com)\(memberOf=CN=LabAdmins,CN=Users,DC=powerflex,DC=lab,DC=dell,DC=com)))" sAMAccountName

dn: CN=Administrator,CN=Users,DC=powerflex,DC=lab,DC=dell,DC=com
sAMAccountName:Administrator

dn: CN=Patrick Jacques,CN=Users,DC=powerflex,DC=lab,DC=dell,DC=com
sAMAccountName:jacqup

dn: CN=Luc Damon,CN=Users,DC=powerflex,DC=lab,DC=dell,DC=com
sAMAccountName: damonl

dn: CN=bobthebuilder,CN=Users,DC=powerflex,DC=lab,DC=dell,DC=com
sAMAccountName: bobthebuilder

 

 

curl -u 'FLEXLAB\ck3-user' "ldap://ldap.powerflex.lab.dell.com:3268/DC=powerflex,DC=lab,DC=dell,DC=com?sAMAccountName?sub?(&(objectCategory=Person)(sAMAccountName=*)(|(memberOf=CN=FLEXLAB-APP-PROD-SDS-Admin,CN=Users,DC=powerflex,DC=lab,DC=dell,DC=com)(memberOf=CN=LabAdmins,CN=Users,DC=powerflex,DC=lab,DC=dell,DC=com)))"

 

Windows

啟動 Active Directory 使用者和電腦。按一下檢視,然後選取進階功能。

DN 是唯一標識目錄中條目的名稱。DN 的第一個元件稱為相對可分辨名稱 (RDN)。

DN 由屬性=值對組成,用逗號分隔,例如:

CN=PowerFlex Admin,OU=sio-group1,DC=powerflex,DC=lab,DC=dell,DC=com

可將它們視為「LDAP 的 FQDN」,即完整的 x500 位址「URL」。

AD 使用者和電腦可用來判斷 DN 和其他屬性:

 

 

導航並右鍵按下要讀取使用者的 OU,然後選擇“屬性”。

在“OU 屬性”中,選擇“屬性編輯器”選項卡。

按一下「區分名稱」以反白顯示,然後按一下「檢視」。

右鍵按下突出顯示的值,然後選擇“複製”。 

按一下取消,然後按一下確定以關閉屬性編輯器和 OU 屬性視窗。

 

 

 

 

窄範圍 LDAP 使用者篩選器範例:

 

(&(objectCategory=Person)(sAMAccountName=*)(|(memberOf=CN=FLEXLAB-APP-PROD-SDS-Admin、CN=Users、DC=powerflex、DC=lab、DC=dell、DC=com)(memberOf=CN=LabAdmins、CN=Users、DC=powerflex、DC=lab、DC=dell、DC=com))

 

 

視覺說明:

 

綁定使用者要求。

 

此綁定使用者必須至少具有查詢LDAP伺服器中定義的使用者和組的許可權,以允許存儲系統對這些用戶進行身份驗證。

 

依預設,將使用者新增至 Active Directory 使用者和電腦頂層網域的安全性標籤時,系統會為其提供 PFMP 中 LDAP 驗證所需的預設唯讀要求。例如

 

 

 

 

僅供參考:我們不需要 LDAP 綁定使用者實際「在」我們必須在目錄中讀取的 AD 組,我們需要「讀取」的安全性標籤權限。

 

影像

PFMP LDAP 提供者一般需求

 

位址: ldaps://ad.ldap.domain:3269 (SSL) 或 ldap://ad.ldap.domain:3268 (普通)

繫結 DN:ADNTDOMAIN\serviceaccount 或 Bind DN 辨別名稱。

繫結 DN 密碼:服務帳戶密碼

Timeout 30000

Username LDAP attribute: sAMAccountName

ID 屬性:objectGUID

Object Class: Person

搜尋路徑:(可查詢所有群組的最高等級,例如,僅查詢網域元件/DC:DC=powerflex、DC=lab、DC=dell、DC=com)

Group Member Attribute: member

Group ID Attribute: cn

Group Object Class: group

群組搜尋路徑:(與使用者搜尋路徑相同,或視需要更精細。 由於我們將使用較窄的篩選器,因此我們的範圍可以很寬,而不會影響性能。

 

下列項目 #The LDAP 群組篩選器 (PFMP 4.6.x+) 提供至少一個群組,因此 keycloak 不會從整個目錄中搜尋所有群組:

Group LDAP Filter: (CN=GROUP1)

#Given 此欄位中 64 個字元的限制僅適用於 PFMP UI,如果我們想添加更多字元,我們必須使用 keycloak 來解決此問題,例如 3 個不同的組:
 

Group LDAP Filter: (|(CN=GROUP1)(CN=GROUP2)(CN=GROUP3))

測試連線,如果成功,請按一下提交。

例如

 

 

2.移除和清理 LDAP 提供者

 

以系統管理員使用者身分,從 PFMP UI 移除 LDAP 使用者、群組,以及目錄提供者。  請勿嘗試以 LDAP 使用者的身分執行此動作,僅限以系統管理員的身分執行。

 

警告:請務必記錄來自 PFMP 的「目錄提供者」和「遠端使用者/群組」對應的目前組態 (特別是在需要還原先前的角色對應時)。

如果 PFMP 上未顯示群組/角色對應 (已知問題),請使用下列指示:

# from any mvm
cmo_pri=$(kubectl get pods -n powerflex -l='postgres-operator.crunchydata.com/role=master,postgres-operator.crunchydata.com/instance-set' -o name)
# Group role
kubectl exec -it -n powerflex $cmo_pri -- psql -U postgres -d keycloak -c "SELECT keycloak_group.name AS group_name,keycloak_role.name AS role_name FROM group_role_mapping JOIN keycloak_group ON (group_role_mapping.group_id = keycloak_group.id) JOIN keycloak_role ON (group_role_mapping.role_id = keycloak_role.id);"
# Group attributes
kubectl exec -it -n powerflex $cmo_pri -- psql -U postgres -d keycloak -c "SELECT keycloak_group.name AS group_name,group_attribute.name AS attribute_name, value FROM group_attribute JOIN keycloak_group ON (group_attribute.group_id = keycloak_group.id);"
Example:
mvm01:~
# kubectl exec -it -n powerflex $cmo_pri -- psql -U postgres -d keycloak
keycloak=# SELECT keycloak_group.name AS group_name,keycloak_role.name AS role_name FROM group_role_mapping JOIN keycloak_group ON (group_role_mapping.group_id = keycloak_group.id) JOIN keycloak_role ON (group_role_mapping.role_id = keycloak_role.id);
 
 group_name  |   role_name
---------------+----------------
EMEALabAdmins | SuperUser
LabAdmins     | LifecycleAdmin
LabUsers      | Monitor (3 rows) keycloak=# SELECT keycloak_group.name AS group_name,group_attribute.name AS attribute_name, value FROM group_attribute JOIN keycloak_group ON (group_attribute.group_id = keycloak_group.id);  group_name  | attribute_name |  value ---------------+----------------+---------
EMEALabAdmins | remote_type    | Ldap EMEALabAdmins | SuperUser      | GLB:GLB EMEALabAdmins | is_remote      | true LabAdmins     | remote_type    | Ldap LabAdmins     | LifecycleAdmin | GLB:GLB LabAdmins     | is_remote      | true LabUsers      | remote_type    | Ldap LabUsers      | Monitor        | GLB:GLB LabUsers      | is_remote      | true (9 rows)
keycloak=# \q

 

 

如果 keycloak 資料庫中仍有任何過時的 LDAP 群組,可以使用以下程序手動刪除:

 

Keycloak 資料庫備份和keycloak_group資料庫表格清理命令。

 

注意:有時不需要手動清理 keycloak。 

我們應該使用 PFMP UI 移除提供者 (請務必先從 PFMP 移除),然後使用 /auth/ URL 確認已從 keycloak 中清除。

 

 

如何從任何一個 MVM 檢查 keycloak 中的 LDAP 群組計數:

 

# 執行此設定以先設定變數。

cmo_pri=$(kubectl get pods -n powerflex -l='postgres-operator.crunchydata.com/role=master,postgres-operator.crunchydata.com/instance-set' -o name)

#check count of groups in keycloak
kubectl exec -it -n powerflex $cmo_pri -- psql -U postgres -d keycloak -c "SELECT COUNT (*) FROM keycloak_group;"
# We usually want 0 groups after removing the LDAP provider.
#Backup the current keycloak DB before any edits.
kubectl exec -it -n powerflex $cmo_pri -- bash -c 'pg_dump -U postgres -d keycloak' >/home/delladmin/keycloak.sql
#delete all entries inside of keycloak_group (and related roles and attributes) while preserving its structure
kubectl exec -it -n powerflex $cmo_pri -- psql -U postgres -d keycloak -c "DELETE FROM group_attribute;"
kubectl exec -it -n powerflex $cmo_pri -- psql -U postgres -d keycloak -c "DELETE FROM group_role_mapping;"
kubectl exec -it -n powerflex $cmo_pri -- psql -U postgres -d keycloak -c "DELETE FROM keycloak_group;"
#check that the group count has reduced:
kubectl exec -it -n powerflex $cmo_pri -- psql -U postgres -d keycloak -c "SELECT COUNT (*) FROM keycloak_group;"

 

這只有在首次在 PFMP UI 中刪除後,並且僅當提供程式數據保留在後端時才會發生。  如果您使用的是 PFxM 4.6.0.1,您也可以執行下列方法來移除 Keycloak UI 中匯入的使用者:

  1. 使用 /auth/ 以 keycloak 使用者身分登入
  2. 每次安裝的 Keycloak 密碼都是唯一的,可透過以下方式在任何 MVM 上找到:

 

kubectl get secret -n powerflex keycloak-admin-credentials -o jsonpath="{.data.password}" | base64 --decode; echo

 

3.使用者同盟 -> LDAP -> 設定,然後在右上角的動作下拉式選單中 選取移除匯入。

 

 

 

 

 

 

清理並刪除組和目錄提供程式後,重新啟動三個MVM節點。 

 

 -便條:只有當環境很大,且 LDAP 查詢會重複堆疊,如以下記錄所示,才需要使用此功能。

 - 如果環境未因同步問題而過載,並且 UI 穩定,則通常可以跳過 MVM 重新啟動。不過,總的來說,這是一個很好的衡量標準。

 

重新啟動 KB https://www.dell.com/support/kbdoc/en-us/000225550 

MVM 正常重新啟動(一次必須運行一個節點) 在驗證資料庫是否報告同步待機之前,不要移動到下一個節點。

 

#As 最佳做法:找出目前 Postgres 領導節點,然後最後重新開機。

在任何 MVM 上 #Run 下列命令,以列出資料庫狀態和相關聯的資料庫名稱。

kubectl exec -n powerflex -c database $(kubectl get pods -n powerflex -l='postgres-operator.crunchydata.com/role=master, postgres-operator.crunchydata.com/instance-set' | grep Running | cut -d' ' -f1) -- sh -c 'patronictl list'

#Run 此命令以識別哪個 MVM 節點正在託管 postgres 資料庫 pod。

 

for x in `kubectl get pods -n powerflex | grep "postgres-ha-cmo" |awk '{print $1}'` ; do echo $x; kubectl get pods -n powerflex $x -o json | grep '"nodeName"' | cut -d ':' -f2 ; echo " "; done

 

#On 作為 Postgres Leader Pod 例項的 MVM。   執行「watch kubectl get nodes」來監控重新開機的狀態。此 MVM 必須是將重新開機的最後一個節點。

#如果 pfmp-mgmt-1 是 Postgres 領導者,則重新開機順序範例。根據哪一個 MVM 是 Postgres 領導者,調整下列命令的順序。

 

打開連接到第三個MVM的終端,然後運行前兩個命令。

 

kubectl label
node pfmp-mgmt-3 cmo.maintenance.mode=true
kubectl drain pfmp-mgmt-3 --ignore-daemonsets --delete-emptydir-data && sudo reboot

#When 節點從重新開機中啟動。執行下列命令。

kubectl uncordon pfmp-mgmt-3 ; kubectl label node pfmp-mgmt-3 cmo.maintenance.mode-

#Run 以下命令,直到與MVM3關聯的資料庫報告同步待機。此時,您可以移動到下一個MVM。

 

kubectl exec -n powerflex -c database $(kubectl get pods -n powerflex -l='postgres-operator.crunchydata.com/role=master, postgres-operator.crunchydata.com/instance-set' | grep Running | cut -d' ' -f1) -- sh -c 'patronictl list'

 

打開連接到第二個MVM的終端並運行前兩個命令。

 

kubectl label node pfmp-mgmt-2 cmo.maintenance.mode=true
kubectl drain pfmp-mgmt-2 --ignore-daemonsets --delete-emptydir-data && sudo reboot

#When 節點從重新開機中啟動。  執行下列命令。

kubectl uncordon pfmp-mgmt-2 ; kubectl label node pfmp-mgmt-2 cmo.maintenance.mode-

#Run 以下命令,直到與MVM2關聯的資料庫報告同步待機。此時,您可以移動到下一個MVM。

kubectl exec -n powerflex -c database $(kubectl get pods -n powerflex -l='postgres-operator.crunchydata.com/role=master, postgres-operator.crunchydata.com/instance-set' | grep Running | cut -d' ' -f1) -- sh -c 'patronictl list' 

#Run 下列命令,將此 MVM 用作節點狀態監控 MVM。

'watch kubectl get nodes'

 

前往連接至第一個執行「watch kubectl get nodes」的 MVM 的終端機。  按下 ctrl+c 返回終端並執行前兩個命令。

kubectl label
node pfmp-mgmt-1 cmo.maintenance.mode=true
kubectl drain pfmp-mgmt-1 --ignore-daemonsets --delete-emptydir-data && sudo reboot

#When 節點從重新開機中啟動。  執行下列命令。

kubectl uncordon pfmp-mgmt-1 ; kubectl label node pfmp-mgmt-1 cmo.maintenance.mode-

#Run 以下命令,直到與MVM1關聯的資料庫報告同步待機。  這個MVM是領導者,但是當MVM1耗盡時,一個新的領導者將接管。  

kubectl exec -n powerflex -c database $(kubectl get pods -n powerflex -l='postgres-operator.crunchydata.com/role=master, postgres-operator.crunchydata.com/instance-set' | grep Running | cut -d' ' -f1) -- sh -c 'patronictl list'

MVM 順利重新開機程序結束

重新開機並還原 PFMP 的 UI 後,請使用以下步驟,以系統管理員身分登入並新增「設定 -> 目錄提供者 」:

3.重新建置 LDAP 提供者

 

如準備部分所述,如果要在 PFMP 中使用的任何組中存在子 AD 域或 AD 域信任帳戶,則應使用全域編錄 (GC) LDAP 連接埠 3268(普通)和 3269 (SSL)。

 

例如

 

ldaps://ad.ldap.corporate.domain.com:3269
Users DN: DC=powerflex,DC=lab,DC=dell,DC=com
Bind DN:DOMAIN\svc_ldapbindaccount 
Username LDAP attribute: sAMAccountName
UUID LDAP attribute: objectGUID
User Object Classes: Person
This field has a 64 character limit in PFMP UI only.   You can put one group in to prevent 'full' directory sync, then use the keycloak UI to refine and add on to the group filter.
Group LDAP Filter: (|(CN=FLEXLAB-APP-PROD-SDS-Admin)(CN=LabAdmins))
Timeout 22222

4.縮小 LDAP 使用者和群組範圍應用程式

 

 

 

使用 /auth/ 以 keycloak 使用者身分登入


使用者篩選器:

 

 

 

# PFMP UI 中缺少使用者 LDAP 篩選器,因此我們需要使用以下內容來更改它。

#This 篩選器必須套用至 Keycloak PowerFlex 領域 (PowerFlex --> 使用者同盟 --> 使用者 LDAP 篩選器)

 

 

 

使用者 LDAP 篩選器:

 

 

(&(objectCategory=Person)(sAMAccountName=*)(|(memberOf=CN=FLEXLAB-APP-PROD-SDS-Admin,CN=Users,DC=powerflex,DC=lab,DC=dell,DC=com)(memberOf=CN=LabAdmins,CN=Users,DC=powerflex,DC=lab,DC=dell,DC=com)(memberOf=CN=LabUsers,CN=Users,DC=powerflex,DC=lab,DC=dell,DC=com)))

 

 

 

儲存 變更。

 

 

 

此窄篩選器的說明:

 

 

 

對象類別等於人。

sAMAccountName 存在

memberOf 等於 CN=PowerFlex Admin,OU=sio-group1,DC=powerflex,DC=lab,DC=dell,DC=com

memberOf 等於 CN=FLEX-STOR-MON,OU=15G,OU=FLEXLAB,DC=powerflex,DC=lab,DC=dell,DC=com

從 <https://ldap-builder.powerflex.lab.dell.com/>

使用者同盟 -> LDAP -> 設定,然後在右上角的動作下拉式選單中選取移除匯入。

 

4.6.x+ UI 刪除群組對應的方法。

 

在「成員資格使用者 LDAP 屬性」的 LDAP 群組對應設定中,我們還需要確定將我們交付為「cn」且無法在 PFMP UI 中變更的正確值已在 keycloak UI 中變更為 DN。

 

 

 

在群組 LDAP 篩選器中,我們可以列出非此即彼的運算子 |  以及每組的CN,例如

(|(CN=FLEXLAB-APP-PROD-SDS-Admin)(CN=CN=PRV_US_SA_SRV_SVS))

 

Products

PowerFlex rack, VxFlex Ready Nodes, PowerFlex custom node, PowerFlex appliance R650, PowerFlex appliance R6525, PowerFlex appliance R660, PowerFlex appliance R6625, Powerflex appliance R750, PowerFlex appliance R760, PowerFlex appliance R7625 , PowerFlex custom node, PowerFlex custom node R650, PowerFlex custom node R6525, PowerFlex custom node R660, PowerFlex custom node R6625, PowerFlex custom node R750, PowerFlex custom node R760, PowerFlex custom node R7625, PowerFlex custom node R860, PowerFlex rack connectivity, PowerFlex rack HW, PowerFlex rack RCM Software, PowerFlex Software, VxFlex Ready Node, VxFlex Ready Node R640, VxFlex Ready Node R740xd, PowerFlex appliance R640, PowerFlex appliance R740XD, PowerFlex appliance R7525, PowerFlex appliance R840, VxFlex Ready Node R840 ...
Article Properties
Article Number: 000243118
Article Type: How To
Last Modified: 20 Mar 2025
Version:  7
Find answers to your questions from other Dell users
Support Services
Check if your device is covered by Support Services.