Comments (6)
可以使用,主要解决共享内存的问题
第一种方法
使用phusion/baseimage,下面dockerfile 我做了删减,大家可以看phusion/baseimage
FROM phusion/baseimage:latest
RUN apt-get update && apt-get install -y qconf\
&& rm -rf /var/lib/apt/lists/*
RUN ldconfig /usr/local/qconf/
RUN echo "kernel.shmmax = 2048000000" >> /etc/sysctl.conf
RUN echo "kernel.shmall = 4294967296" >> /etc/sysctl.conf
RUN mkdir -p /etc/my_init.d
COPY ./init.sh /etc/my_init.d/init.sh
RUN chmod +x /etc/my_init.d/init.sh
CMD ["/sbin/my_init"]
运行时,需要--privileged=true
第二种方法是
使用--ipc=host
参考Docker里莫名其妙的/proc/sys/kernel/shmmax
from qconf.
最近在Docker和K8S集群中使用qconf也同样遇到了这个问题,结论是Docker和K8S中均可用
- Docker中使用即按照 @demohi 的方式,使用--ipc=host:
IPC with the Host
docker run --ipc=host <image>
IPC with another Container
docker run --ipc=container:<id> <image>
- K8S/Kubernetes中使用
hostIPC: true
配置参数:
在Deployment yaml文件的 spec.template.spec 里、与containers、volumes同级的位置添加 hostIPC: true
qconf以及需要使用qconf的yaml文件均需要添加
apiVersion: apps/v1
kind: Deployment
metadata:
name: webserver
spec:
selector:
matchLabels:
app: webserver
template:
metadata:
labels:
app: webserver
spec:
hostIPC: true
containers:
- name: nginx
image: xxx
command: ["/usr/sbin/nginx"]
args: ["-g", "daemon off;", "-c", "/etc/nginx/nginx.conf"]
---
apiVersion: apps/v1
kind: DaemonSet
metadata:
name: qconf
spec:
selector:
matchLabels:
app: qconf
template:
metadata:
labels:
app: qconf
spec:
hostIPC: true
containers:
- name: qconf
image: xxx
command: ["/bin/sh", "-c"]
args: ["sh /usr/local/qconf/bin/agent-cmd.sh start; while true; sleep 1; done"]
from qconf.
qconf的共享内存就是ipc share mem,应该是不能跨容器的。
from qconf.
同问
from qconf.
可以在docker中使用
需要保证agent和客户端接口可以访问到同一个共享内存和消息队列
from qconf.
+10086希望至少可以有一个docker demo
from qconf.
Related Issues (20)
- php7 qconf_manager扩展QConfZK循环操作多个zookeeper报段错误
- python3.7 编译 qconf 扩展 error: command 'clang' failed with exit status 1 HOT 1
- init fail HOT 1
- mac cmake 通过 make 报错了 HOT 6
- qconf获取大量数据失败
- debian10 下编译报错 HOT 1
- how time support etcd
- MacOS 10.15 + Xcode 11.1 编译不过
- mac 启动 Failed to open gdbm file:/usr/local/qconf/dumps/_dump.gdbm; gdbm err:Can't be writer
- 网络中断又恢复后无法拉取配置
- cmake失败报错 HOT 2
- java client多线程调用导致crash
- make error on macOS
- /usr/bin/ld: 找不到 -lpthreads HOT 4
- 更新bash 5的sh启动脚本
- java driver set max buffer 256K in the method of getConf()
- cmake error HOT 3
- Cmake编译报错 HOT 1
- how to solve?
- GO 编译时在此[golang:1.20-alpine]docker镜像内编译失败? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from qconf.