Access from Non-CN Pods

If you are accessing PolarDB-X from a pod within the K8s cluster, you can directly use the cluster IP to access it. When creating the PolarDB-X cluster, the PolarDB-X Operator will also create a service for cluster access, which is by default of ClusterIP type. Use the following command to view the service for access:

$ kubectl get svc {PolarDB-X cluster name}

The expected output is:

NAME          TYPE        CLUSTER-IP       EXTERNAL-IP   PORT(S)             AGE
quick-start   ClusterIP   10.110.214.223   <none>        3306/TCP,8081/TCP   5m25s

If you are accessing from within the K8s cluster, you can use the Cluster-IP displayed above. The default port for PolarDB-X services is 3306.

ClusterIP exposes services through an internal IP within the K8s cluster. When you choose this access method, you can only access it from within the cluster.

Execute the following command, and after entering the password obtained earlier, you can connect to PolarDB-X:

mysql -h10.110.214.223 -P3306 -upolardbx_root -p

Note:

  • Here, -P is uppercase, and the default port is 3306.
  • To ensure password security, do not fill in the password after -p. You will be prompted to enter the password after executing the entire command, and you can log in by pressing Enter afterward.

Access from Within a CN Pod

Simply enter the myc command inside the CN pod to log in.

results matching ""

    No results matching ""