我试图弄清楚 keycloak 版本 3.3.0.CR1 中的导入/导出最佳实践。正如我在 keycloak 官方页面import/export中看到的,描述了他们的策略。这里是导出到单个文件 json 的示例。进入 /keycloak/bin 文件夹并运行:
./standalone.sh -Dkeycloak.migration.action=export -Dkeycloak.migration.provider=singleFile -Dkeycloak.migration.file=keycloak-export.json
我登录到 k8s pod。运行此命令后,我收到错误:
12:23:32,045 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) WFLYCTL0013: Operation ("add") failed - address: ([
("core-service" => "management"),
("management-interface" => "http-interface")
]) - failure description: {
"WFLYCTL0080: Failed services" => {"org.wildfly.management.http.extensible" => "java.net.BindException: Address already in use /127.0.0.1:9990"},
"WFLYCTL0288: One or more services were unable to start due to one or more indirect dependencies not being available." => {
"Services that were unable to start:" => ["org.wildfly.management.http.extensible.shutdown"],
"Services that may be the cause:" => ["jboss.remoting.remotingConnectorInfoService.http-remoting-connector"]
}
}
如我所见,因为要在同一端口上运行 Keycloak 服务器,所以我运行了备份脚本。这里 helm/keycloak values.yml:
Service:
Name: keycloak
Port: 8080
Type: ClusterIP
Deployment:
Image: jboss/keycloak
ImageTag: 2.5.1.Final
ImagePullPolicy: IfNotPresent
ContainerPort: 8080
KeycloakUser: Admin
KeycloakPassword: Admin
所以在我们运行这个脚本之前应该停止服务器?我无法停止 pod 内的 keycloak 进程,因为入口将关闭 pod 并创建新的。对导出/导入(备份/恢复)数据的任何其他方式有什么建议吗?或者我错过了什么?
PS 我什至尝试过 UI 导入/导出。导出效果很好,我看到了所有数据。但是导入工作了一半。他给我带来了所有的“客户”,但不是我的“领域”和“用户联盟”。可能吗?