k8s 维护有状态服务难的问题,他解决了
介绍:它是基于 Kubernetes 的云原生数据基础设施,为用户提供了关系型数据库、NoSQL 数据库、向量数据库以及流计算系统的管理控制功能。可以使用提供的命令轻松部署处理数据库实例。
github:https://github.com/apecloud/kubeblocks
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:
# 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
# 创建单实例
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>
__EOF__
- 本文作者: kerwin
- 本文链接: https://www.cnblogs.com/-k8s/p/17872979.html
- 关于博主: 评论和私信会在第一时间回复。或者直接私信我。
- 版权声明: 本博客所有文章除特别声明外,均采用 BY-NC-SA 许可协议。转载请注明出处!
- 声援博主: 如果您觉得文章对您有帮助,可以点击文章右下角【推荐】一下。
作词 : Marlon McClain
作曲 : Cassio Lopes/Marlon McClain/Andrew Fedyk/Joseph De Pace
Babe, don't make a sound (宝贝, 别作声)
2 a.m. love gotta keep it down (keep it down) (凌晨2点了克制一下)
Don't wait around for a signal now (现在可不是空等信号的时候)
Gimme some verbs I ain't talkin' nouns (I'm naughty) (给我想些动词我不说名词(我不循规蹈矩))
You wanna ride in the 6 (你想在6点去玩)
You wanna dine in the six (dine in the six) (你想在6点吃饭)
But when I lean for the kiss (但是我想亲亲的时候)
You said I'll probably send you some pics (你说你要给我发照片)
And I'm like (我和你想得一样)
Hell nah, been waitin' too long (I've been waitin') (天呐,我等了很久了)
Hell nah, I want that crew love (don't leave, baby) (天呐, 我想我想要你所有的爱)
Hell nah, been waitin' too long (I've been waitin') (天呐, 我等了很久了)
Hell nah, I want that crew love (天呐,我想我想要你所有的爱)
Body on my, losin' all my innocence (让我切身了解你, 快要失掉我的节操了)
Body on my, grindin' on my innocence (让我切身了解你, 快要失掉我的节操了)
Body on my, losin' all my innocence (让我切身了解你, 快要失掉我的节操了)
Body on my, grindin' on my innocence (让我切身了解你, 快要失掉我的节操了)
Body on my, losin' all my innocence (让我切身了解你, 快要失掉我的节操了)
Body on my, grindin' on my innocence (让我切身了解你, 快要失掉我的节操了)
Body on my, losin' all my innocence (让我切身了解你, 快要失掉我的节操了)
Body on my, grindin' on my innocence (让我切身了解你, 快要失掉我的节操了)
On my, on my, on my, on my 'cence (让我来体贴你,接受我的“检查”)
On my, on my, on my, on my 'cence (让我来体贴你,接受我的“检查”)
On my, on my, on my, on my 'cence (让我来体贴你,接受我的“检查”)
On my, on my, on my, on my 'cence (让我来体贴你,接受我的“检查”)
Babe, just hit the pedal (宝贝,踩好踏板哦)
If things go wrong it's just incidental (一切都是意外如果有不好的什么事)
My bad, never got the memo (我的错 从不记备忘录)
But you never have fun while you're in the limo, yeah (但你在豪车里绝不会快乐)
If you wanna ride in the 6 (如果你想在6点去骑行)
You wanna dine in the six (dine in the six) (你想在6点用餐吗)
You wanna lean for the kiss (你想亲亲吗)
You said I'll probably send you some pics (你说你会寄些图片给我)
And I'm like (和我想得一样)
Hell nah, been waitin' too long (I've been waitin') (天呐,我等了很久了)
Hell nah, I want that crew love (don't leave, baby) (天呐,我想要你所有的爱)
Hell nah, been waitin' too long (I've been waitin') (天呐,我等了很久了)
Hell nah, I want that crew love (天呐,我想要你所有的爱)
Body on my, losin' all my innocence (让我切身了解你, 快要失掉我的节操了)
Body on my, grindin' on my innocence (让我切身了解你, 快要失掉我的节操了)
Body on my, losin' all my innocence (让我切身了解你, 快要失掉我的节操了)
Body on my, grindin' on my innocence (让我切身了解你, 快要失掉我的节操了)
Body on my, losin' all my innocence (让我切身了解你, 快要失掉我的节操了)
Body on my, grindin' on my innocence (让我切身了解你, 快要失掉我的节操了)
On my, on my, on my, on my 'cence (让我来体贴你,接受我的“检查”)
On my, on my, on my, on my 'cence (让我来体贴你,接受我的“检查”)
On my, on my, on my, on my 'cence (让我来体贴你,接受我的“检查”)
On my, on my, on my, on my 'cence, (让我来体贴你,接受我的“检查”)
退出 订阅评论 我的博客
[Ctrl+Enter快捷键提交]
【推荐】园子周边第二季:更大的鼠标垫,没有logo的鼠标垫
【推荐】阿里云云市场联合博客园推出开发者商店,欢迎关注
【推荐】会员力量,点亮园子希望,期待您升级成为园子会员
· 日常 Bug 排查 - 连接突然全部关闭
· 「动画进阶」极具创意的鼠标交互动画
· WPF 稳定的全屏化窗口方法
· 云服务器遭到黑客入侵植入木马病毒排查过程
· HTTPS 是如何进行安全传输的 ?
· 一个不知名的开源项目可以带来多少收入
· 日常Bug排查-连接突然全部关闭
· C#.Net筑基-模式匹配汇总
· Visual Studio中的四款代码格式化工具
· 3 个好玩的前端开源项目「GitHub 热点速览」