Giter VIP home page Giter VIP logo

Comments (6)

desenmeng avatar desenmeng commented on July 29, 2024 2

可以使用,主要解决共享内存的问题

第一种方法

使用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.

lzjohnny avatar lzjohnny commented on July 29, 2024 1

最近在Docker和K8S集群中使用qconf也同样遇到了这个问题,结论是Docker和K8S中均可用

  1. Docker中使用即按照 @demohi 的方式,使用--ipc=host:
IPC with the Host
docker run --ipc=host <image>

IPC with another Container
docker run --ipc=container:<id> <image>
  1. 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.

niubell avatar niubell commented on July 29, 2024

qconf的共享内存就是ipc share mem,应该是不能跨容器的。

from qconf.

desenmeng avatar desenmeng commented on July 29, 2024

同问

from qconf.

CatKang avatar CatKang commented on July 29, 2024

可以在docker中使用

需要保证agent和客户端接口可以访问到同一个共享内存和消息队列

from qconf.

johnzeng avatar johnzeng commented on July 29, 2024

+10086希望至少可以有一个docker demo

from qconf.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.