首页 新闻 会员 周边 捐助

Kubernetes 部署 ClickHouse 遇到 pod 无法启动问题

0
悬赏园豆:50 [已解决问题] 解决于 2023-03-07 18:29

通过 Altinity Operator for ClickHouse 部署,部署清单文件如下:

apiVersion: "clickhouse.altinity.com/v1"
kind: "ClickHouseInstallation"
metadata:
  name: "clickhouse"
spec:
  defaults:
    templates:
      dataVolumeClaimTemplate: data-volume-template
      logVolumeClaimTemplate: log-volume-template
  configuration:
    clusters:
      - name: "analytics"
        layout:
          shardsCount: 1
          replicasCount: 1
  templates:
    volumeClaimTemplates:
      - name: data-volume-template
        spec:
          accessModes:
            - ReadWriteOnce
          resources:
            requests:
              storage: 1Gi
      - name: log-volume-template
        spec:
          accessModes:
            - ReadWriteOnce
          resources:
            requests:
              storage: 100Mi

部署命令

kubectl apply --namespace=clickhouse -f clickhouse-analytics.yaml

部署过程中 pod 出现 CrashLoopBackOff

NAME                                       READY   STATUS             RESTARTS      AGE
pod/chi-clickhouse-analytics-0-0-0         1/2     CrashLoopBackOff   2 (26s ago)   81s

对应的错误日志
注:下面的错误信息是输出命命令导致的,kubectl describe pod pod/chi-clickhouse-analytics-0-0-0 -n clickhouse 中多了 pod/

error: there is no need to specify a resource type as a separate argument when passing arguments in resource/name form (e.g. 'kubectl get resource/<resource_name>' instead of 'kubectl get resource resource/<resource_name>'

然后这个部署被 clickhouse-operator 删除,请问如何解决这个问题?

问题补充:

kubectl describe pod 相关信息

Containers:
  clickhouse:
    Last State:     Terminated
      Reason:       Error
      Exit Code:    70
...
Events:
  Type     Reason            Age                From               Message
  ----     ------            ----               ----               -------
  Warning  FailedScheduling  51s                default-scheduler  0/17 nodes are available: 17 pod has unbound immediate PersistentVolumeClaims. preemption: 0/17 nodes are available: 17 Preemption is not helpful for scheduling.

通过下面的命令

kubectl logs chi-clickhouse-analytics-0-0-0 -n clickhouse

发现引起问题的错误日志

<Error> Application: DB::Exception: Either 'password' or 'password_sha256_hex' or 'password_double_sha1_hex' or 'no_password' or 'ldap' or 'kerberos' must be specified for user clickhouse_operator.: while parsing user 'clickhouse_operator' in users configuration file: while loading configuration file '/etc/clickhouse-server/users.xml'

清单文件中添加 users 配置后问题依旧

configuration:
  users:
    admin/password: ******
    default/password: ******
dudu的主页 dudu | 高人七级 | 园豆:29642
提问于:2023-03-07 11:34
< >
分享
最佳答案
0

解决了,原来需要给 clickhouse_operator 账号设置密码

configuration:
  users:
    clickhouse_operator/password: ******
    admin/password: ******

如果使用 secret 保存密码,则使用下面的清单

spec:
  configuration:
    users:
      clickhouse_operator/k8s_secret_password: clickhouse-credentials/admin
      admin/k8s_secret_password: clickhouse-credentials/clickhouse_operator
dudu | 高人七级 |园豆:29642 | 2023-03-07 18:29
其他回答(1)
0

https://stackoom.com/question/3xTNw
5楼的回复你可以看一下

收获园豆:50
人间春风意 | 园豆:2784 (老鸟四级) | 2023-03-07 11:44
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册