首页 > 其他分享 >kubeblocks的使用

kubeblocks的使用

时间:2023-12-03 14:44:25浏览次数:35  
标签:使用 community Disabled cluster kubeblocks mysql Helm

介绍:它是基于 Kubernetes 的云原生数据基础设施,为用户提供了关系型数据库、NoSQL 数据库、向量数据库以及流计算系统的管理控制功能。可以使用提供的命令轻松部署处理数据库实例。

github:https://github.com/apecloud/kubeblocks

官网:https://kubeblocks.io

1.初步使用

安装kbcli:

官网说明:https://kubeblocks.io/docs/release-0.7/user_docs/installation/install-with-kbcli/install-kbcli

curl -fsSL https://kubeblocks.io/installer/install_cli.sh | bash
# 命令补全
kbcli completion zsh -h
echo "autoload -U compinit; compinit" >> ~/.zshrc
echo "source <(kbcli completion zsh); compdef _kbcli kbcli" >> ~/.zshrc

通过 kbcli 安装 KubeBlocks:

官网说明:https://kubeblocks.io/docs/release-0.7/user_docs/installation/install-with-kbcli/install-kubeblocks-with-kbcli

# kbcli kubeblocks install
KubeBlocks will be installed to namespace "kb-system"
Kubernetes version 1.26.5
kbcli version 0.7.1
Collecting data from cluster                       OK
Kubernetes cluster preflight                       OK
Add and update repo kubeblocks                     OK
Install KubeBlocks 0.7.1                           OK
Wait for addons to be enabled
  apecloud-mysql                                   OK
  kafka                                            OK
  mongodb                                          OK
  mysql                                            OK
  postgresql                                       OK
  pulsar                                           OK
  redis                                            OK
  snapshot-controller                              OK
​
KubeBlocks 0.7.1 installed to namespace kb-system SUCCESSFULLY!
​
-> Basic commands for cluster:
    kbcli cluster create -h     # help information about creating a database cluster
    kbcli cluster list          # list all database clusters
    kbcli cluster describe <cluster name>  # get cluster information
​
-> Uninstall KubeBlocks:
    kbcli kubeblocks uninstall
​
​
# 查看启动容器
# kubectl get pod -n kb-system
NAME                                            READY   STATUS    RESTARTS   AGE
kb-addon-snapshot-controller-8484bbd44c-lc69m   1/1     Running   0          102s
kubeblocks-69b7c6db64-xskrj                     1/1     Running   0          2m22s
kubeblocks-dataprotection-67f46457c7-7s7kv      1/1     Running   0          2m22s
​
# 查看kubeblocks的状态
kbcli kubeblocks status
KubeBlocks is deployed in namespace: kb-system,version: 0.7.1
​
KubeBlocks Workloads:
NAMESPACE   KIND         NAME                           READY PODS   CPU(CORES)   MEMORY(BYTES)   CREATED-AT
kb-system   Deployment   kb-addon-snapshot-controller   1/1          N/A          N/A             Dec 03,2023 14:12 UTC+0800
kb-system   Deployment   kubeblocks                     1/1          N/A          N/A             Dec 03,2023 14:11 UTC+0800
kb-system   Deployment   kubeblocks-dataprotection      1/1          N/A          N/A             Dec 03,2023 14:11 UTC+0800
​
KubeBlocks Addons:
NAME                           STATUS     TYPE   PROVIDER
alertmanager-webhook-adaptor   Disabled   Helm   apecloud
apecloud-mysql                 Enabled    Helm   apecloud
apecloud-otel-collector        Disabled   Helm   apecloud
aws-load-balancer-controller   Disabled   Helm   N/A
bytebase                       Disabled   Helm   community
cert-manager                   Disabled   Helm   community
csi-hostpath-driver            Disabled   Helm   community
csi-s3                         Disabled   Helm   community
elasticsearch                  Disabled   Helm   community
external-dns                   Disabled   Helm   N/A
fault-chaos-mesh               Disabled   Helm   community
foxlake                        Disabled   Helm   community
grafana                        Disabled   Helm   community
greptimedb                     Disabled   Helm   community
jupyter-hub                    Disabled   Helm   community
jupyter-notebook               Disabled   Helm   community
kafka                          Enabled    Helm   community
kubebench                      Disabled   Helm   community
kubeblocks-csi-driver          Disabled   Helm   N/A
llm                            Disabled   Helm   community
loki                           Disabled   Helm   community
mariadb                        Disabled   Helm   community
migration                      Disabled   Helm   community
milvus                         Disabled   Helm   community
minio                          Disabled   Helm   community
mongodb                        Enabled    Helm   community
mysql                          Enabled    Helm   community
nebula                         Disabled   Helm   community
neon                           Disabled   Helm   community
nvidia-gpu-exporter            Disabled   Helm   community
nyancat                        Disabled   Helm   apecloud
opensearch                     Disabled   Helm   community
oracle-mysql                   Disabled   Helm   ApeCloud
orioledb                       Disabled   Helm   apecloud
polardbx                       Disabled   Helm   community
postgresql                     Enabled    Helm   community
prometheus                     Disabled   Helm   community
pulsar                         Enabled    Helm   community
pyroscope-server               Disabled   Helm   community
qdrant                         Disabled   Helm   community
redis                          Enabled    Helm   community
risingwave                     Disabled   Helm   community
snapshot-controller            Enabled    Helm   community
starrocks                      Disabled   Helm   community
tdengine                       Disabled   Helm   community
victoria-metrics-agent         Disabled   Helm   community
weaviate                       Disabled   Helm   community
xinference                     Disabled   Helm   community
zookeeper                      Disabled   Helm   community

2.创建MySQL

官网:https://kubeblocks.io/docs/release-0.7/user_docs/kubeblocks-for-mysql/cluster-management/create-and-connect-a-mysql-cluster

# 创建单实例
kbcli cluster create mysql mycluster
Info: --version is not specified, ac-mysql-8.0.30 is applied by default.
Cluster mycluster created
​
# 创建集群实例
kbcli cluster create mysql --mode raftGroup --availability-policy none  mysql-cluster
Info: --version is not specified, ac-mysql-8.0.30 is applied by default.
Cluster mysql-cluster created
​
# 连接MySQL
kbcli cluster connect mysql-cluster
Connect to instance mysql-cluster-mysql-1: out of mysql-cluster-mysql-1(leader), mysql-cluster-mysql-2(follower), mysql-cluster-mysql-0(follower)
Defaulted container "mysql" out of: mysql, metrics, vttablet, kb-checkrole, config-manager
mysql: [Warning] Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 58
Server version: 8.0.30 WeSQL Server - GPL, Release 5, Revision 4ca1eb8
​
Copyright (c) 2000, 2022, Oracle and/or its affiliates.
​
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
​
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
​
mysql>

注:具体操作在官网已经写得很清楚,这里不在操作,可以根据官网进行容器数量的修改和内存和cpu的修改。

标签:使用,community,Disabled,cluster,kubeblocks,mysql,Helm
From: https://www.cnblogs.com/-k8s/p/17872979.html

相关文章

  • gdb调试工具的使用
    为了更好的学习pwn,之前学习C语言的时候都是用的visualstudo开发环境自带的调试工具进行调试,这里学习一下在linux中使用gdb进行C语言的调试,为后续学习使用pwndbg打下一些基础安装gdb在kali安装gdb,直接使用apt安装即可sudoaptinstallgdb启动gdbgdb#直接进入g......
  • python快捷使用
    1、快速更改变量名:选中变量名,按CTRL+R参考:Python中统一快速更换变量的名称_python一键替换变量名-CSDN博客......
  • 使用分布式事务 Seata 的 XA 模式
    上篇博客已经搭建了分布式事务Seata的集群,本篇博客主要介绍如何使用Seata的XA模式。XA模式的规范是X/Open组织定义的分布式事务处理(DTP,DistributedTransactionProcessing)标准,XA模式规范描述了全局的TM与局部的RM之间的接口,几乎所有主流关系型数据库都对XA模式......
  • 极语言3-14网页框——对象使用,浏览对象可执行命令表,新快捷对象——方法表
    网页框——对象使用对象浏览=浏览器对象; 申请一个浏览器对象的变量程序段窗体启动; 在程序段内控制网页框对象  浏览=控件对象网页框1; 获取网页框的浏览器对象  浏览.改静默(1); 控制网页框的浏览器对象不显示对话提示  浏览.连接("`https://www.baidu.com/",0,0,0,......
  • SpringBoot如何使用@Scheduled创建定时任务?
    前言随着软件业务日益复杂,有时候需要创建一些定时任务以满足特定业务需求。在Java编程语言中,使用Spring框架可以轻松地创建出定时任务。SpringBoot作为Spring框架中的一员,在创建定时任务方面也提供了便利性和灵活性。本文将介绍SpringBoot如何使用@Scheduled创建定时任务。摘要......
  • 06.常用模拟器使用
    1.emulator介绍AndroidStudio自带模拟器功能齐全步骤:1.安装jdk及配置环境变量官网:https://www.oracle.com/java/technologies/downloads/链接:https://pan.baidu.com/s/12HA0ih7GsHBgBD7JmG_WZw提取码:oya4安装完毕后需要配置环境变量新建变量JAVA_HOME:jdk......
  • OpenDevOps 使用任务平台
    一、任务平台演示(不带参数)1)创建不带参数的命令  指定强制主机会强制在该机器执行 2)创建执行用户,在模板添加的执行的命令里面需要选择执行用户3)创建不带参数模板  id需要记录下来,需要授权给相关用户,用户才能对该模板进行操作 4)创建标签树。标签树也就是组的......
  • Qt中QStyledItemDelegate的使用(二)
    延续上一篇文章。本文给出了一个QStyledItemDelegate类自定义绘制加自定义编辑框的例子。为方便读者理清思路,我已经尽量简化本文附加的代码了。此程序模拟用户给出星级评价的效果,在编辑状态下用户可以设置0~5个星星的评价,在普通状态下界面显示对应数量的金黄色星星。本文代码在VS2......
  • Windows驱动中数字签名认证(使用 ci.dll)
    1.背景  对于常规应用程序来说,在应用层可以使用WinVerifyTrust,在驱动层使用常规的API无法使用,自己分析数据又太麻烦。  但在内核中ci.dll包装了数据签名验证相关的功能,我们可以使用该dll来实现我们的数字签名验证。  详细的分析见《内核中的代码完整性:深入分析ci......
  • 前端学习笔记202310学习笔记第一百壹拾四天-webpack配置和使用技巧9
    ......