背景
- 我们部署 Cassandra 是通过 k8s + argocd + helm 部署的
- 我们需要修改 cassandra helm chart 中的相关配置以实现 cassandra 调优的目的,但是这种方式修改的 cassandra 配置都没有生效,让调优无法进行,通过各种尝试后我们找到如下解决方案
![在这里插入图片描述](https://img-blog.csdnimg.cn/direct/f72fd07fec1840ccb88d9480dbffd254.png)
解决方案(通过重新制作 Docker 镜像修改配置)
重新制作 Docker 镜像并修改配置
FROM docker-registry-vpc.xxx.com/mirror/cassandra:4.0.11-debian-11-r7
USER root
RUN sed -i -e 's/# native_transport_max_threads: .*/native_transport_max_threads: 4096/g' \
-e 's/concurrent_reads: .*/concurrent_reads: 256/g' \
-e 's/concurrent_writes: .*/concurrent_writes: 192/g' \
-e 's/#concurrent_compactors: .*/concurrent_compactors: 8/g' \
/opt/bitnami/cassandra/conf.default/cassandra.yaml
构建镜像
docker build -t docker-registry-vpc.xxx.com/world/cassandra:4.0.11-debian-11-r7-20240105a .
推送镜像到远程仓库
docker tag docker-registry-vpc.xxx.com/world/cassandra:4.0.11-debian-11-r7-20240105a docker-registry-vpc.xxx.com/world/cassandra:4.0.11-debian-11-r7-20240105a
docker push docker-registry-vpc.xxx.com/world/cassandra:4.0.11-debian-11-r7-20240105a
使用最新的镜像部署即可,最终配置全部都能生效