Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Postgresql cluster is always Creating status when new create #8183

Closed
taylor840326 opened this issue Sep 23, 2024 · 5 comments
Closed
Assignees
Labels
kind/bug Something isn't working
Milestone

Comments

@taylor840326
Copy link
Contributor

Describe the bug
Postgresql cluster is always Creating status.

To Reproduce
Steps to reproduce the behavior:

  1. Create postgresql cluster.
 kbcli cluster create --cluster-definition postgresql --cluster-version postgresql-16.4.0  ipsql16
  1. Connect to postgresql cluster is ok.
kbcli cluster connect ipsql16
  1. Postgresql slave instance is not ready on k8s.
kubectl get pods   
ipsql16-postgresql-1          3/4     Running   0             6h38m
  1. kubectl logs get some errors
 No such file or directory: '/home/postgres/pgdata/pgroot/data/postmaster.opts'"

Expected behavior
Postgresql cluster status is Running.

Screenshots

1

Desktop (please complete the following information):

  • Kubernetes: v1.29.5+k3s1
  • KubeBlocks: 0.9.0
  • kbcli: 0.9.0
@taylor840326 taylor840326 added the kind/bug Something isn't working label Sep 23, 2024
@shanshanying
Copy link
Contributor

hi @taylor840326 ,

thanks for reporting the bug. We fill fix is ASAP.

@ldming
Copy link
Collaborator

ldming commented Sep 24, 2024

Hi @taylor840326, I tried to reproduce this issue but was unable to do so. I suspect that there might have been a problem during initdb initializing the data directory, which led to the startup failure. Could you please provide the complete logs for this pod?

@taylor840326
Copy link
Contributor Author

Hi @taylor840326, I tried to reproduce this issue but was unable to do so. I suspect that there might have been a problem during initdb initializing the data directory, which led to the startup failure. Could you please provide the complete logs for this pod?

@taylor840326 taylor840326 reopened this Sep 24, 2024
@github-actions github-actions bot added this to the Release 0.9.2 milestone Sep 24, 2024
@ldming
Copy link
Collaborator

ldming commented Sep 24, 2024

Hi @taylor840326, I tried to reproduce this issue but was unable to do so. I suspect that there might have been a problem during initdb initializing the data directory, which led to the startup failure. Could you please provide the complete logs for this pod?

Are there more logs?

@taylor840326
Copy link
Contributor Author

Hi @taylor840326, I tried to reproduce this issue but was unable to do so. I suspect that there might have been a problem during initdb initializing the data directory, which led to the startup failure. Could you please provide the complete logs for this pod?

Are there more logs?

Hi @ldming ,I have solved this problem. The reason is that “Huge Page“ causes the database command execute failure

initdb 

... Bus error ...

I create a cluster using the following command.

Add "limits.hugepages-2Mi=1024Mi" parameter

cat <<EOF | kubectl apply -f -
apiVersion: apps.kubeblocks.io/v1alpha1
kind: Cluster
metadata:
  name: psql16
  namespace: demo
spec:
  clusterDefinitionRef: postgresql
  clusterVersionRef: postgresql-16.4.0
  terminationPolicy: Delete
  affinity:
    podAntiAffinity: Preferred
    topologyKeys:
    - kubernetes.io/hostname
  tolerations:
    - key: kb-data
      operator: Equal
      value: 'true'
      effect: NoSchedule
  componentSpecs:
  - name: postgresql
    componentDefRef: postgresql
    enabledLogs:
    - running
    disableExporter: true
    replicas: 2
    resources:
      limits:
        cpu: '0.5'
        memory: 0.5Gi
        hugepages-2Mi: 1024Mi
      requests:
        cpu: '0.5'
        memory: 0.5Gi
    volumeClaimTemplates:
    - name: data
      spec:
        accessModes:
        - ReadWriteOnce
        resources:
          requests:
            storage: 20Gi
EOF

refer to: https://www.percona.com/blog/using-huge-pages-with-postgresql-running-inside-kubernetes/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants