Closed liaocanjie closed 4 days ago
My yaml file content is as follows:
apiVersion: "clickhouse.altinity.com/v1"
kind: "ClickHouseInstallation"
metadata:
name: "clickhouse-cluster"
spec:
defaults:
templates:
podTemplate: pod-template
serviceTemplate: svc-template
dataVolumeClaimTemplate: clickhouse-data-pvc
logVolumeClaimTemplate: clickhouse-logs-pvc
configuration:
zookeeper:
nodes:
- host: zookeeper.zkns
users:
default/password: qwerty
default/networks/ip:
- 0.0.0.0/0
- '::/0'
testuser/password: qwerty
testuser/networks/ip:
- 0.0.0.0/0
- '::/0'
clusters:
- name: "clickhouse-clt"
layout:
shardsCount: 2
replicasCount: 1
templates:
podTemplates:
- name: pod-template
spec:
containers:
- name: clickhouse
image: clickhouse/clickhouse-server:23.8
# Container has explicitly specified resource requests
resources:
requests:
cpu: "500m"
memory: "1Gi"
limits:
cpu: "500m"
memory: "1Gi"
# Container has explicitly specified ports
ports:
- name: http
containerPort: 8123
- name: tcp
containerPort: 9000
volumeMounts:
- name: clickhouse-data-pvc
mountPath: /var/lib/clickhouse
- name: clickhouse-logs-pvc
mountPath: /var/log/clickhouse-server
volumeClaimTemplates:
- name: clickhouse-data-pvc
spec:
storageClassName: longhorn
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 30Gi
- name: clickhouse-logs-pvc
spec:
storageClassName: longhorn
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 10Gi
serviceTemplates:
- name: svc-template
metadata:
annotations:
metallb.universe.tf/allow-shared-ip: key-to-share-172.16.36.61
spec:
type: LoadBalancer
ports:
- name: http
port: 8123
targetPort: 8123
- name: tcp
port: 9000
targetPort: 9000
cat config.xml|grep remote_server
Look to /etc/clickhouse-server/config.d/chop-generated-remote_servers.xml
and SELECT * FROM system.clusters
users: default/password: qwerty
if you use engine=Distributed('default',db.table)
during table creation, then authorization failed expected behavior
you changed password for default user but no defined
<remote_servers>
<default>
<secret/>
</default>
</remote_servers>
look to
better use CREATE TABLE ... ENGINE=Distributed('{cluster}',db.table)
{cluster}
defined properly with secret inside /etc/clickhouse-server/config.d/chop-generated-remote_servers.xml
I went into the pod to check the relevant configuration, and it felt like a default configuration
cat config.xml|grep remote_server
I can create a distributed table, but I get an error when I use it.