我如何解决LXC容器日记帐安装问题

发布于 2025-01-22 10:34:48 字数 391 浏览 5 评论 0原文

我有LXC Contariner在其自己的配置

lxc.mount.entry =/var/log/journal/56ABD83F52ED4B53B6BD4C41F3564179 var/log/log/journal/journal/journal/56abd83f583f52ed4b53b6b6bd4bd4c41f35641f3564179 var/杂志上

,没有同步。主机中的目录比容器内部的目录更古老,我创建另一行

lxc.mount.entry =/srv/log/log/machine1 var/log none bint,create = dir 0 0 0

它对某些的工作正常很好容器,对其他人不起作用。

那是什么原因

I have lxc contariner with the line at its own config

lxc.mount.entry = /var/log/journal/56abd83f52ed4b53b6bd4c41f3564179 var/log/journal/56abd83f52ed4b53b6bd4c41f3564179 none bind,create=dir 0 0

but they are not synced. the directory in hosts is older than inside container and i create another line

lxc.mount.entry = /srv/log/machine1 var/log none bind,create=dir 0 0

it works perfectly fine for some container and doesnt work for the others.

what's the reason of that

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

川水往事 2025-01-29 10:34:48

问题是安装的顺序。
OpenStack Victoria Insertbe中,它已被固定

在添加了部分之前的 。在升级Ussuri到维多利亚州,我们应该手动进行。

因此,订单就像

第一个var/log

tht/var/log/journal一样

- name: Add bind mount configuration to container
  lineinfile:
    dest: "/var/lib/lxc/{{ inventory_hostname }}/config"
    line: "lxc.mount.entry = {{ item['mount_path'] }} {{ item['bind_dir_path'].lstrip('/') }} none bind,create=dir 0 0"
    insertbefore: "^lxc.mount.entry = .*\\s{{ item['bind_dir_path'].lstrip('/') | regex_replace('/', '\/') }}.*"
    backup: "true"
  with_items:
    - "{{ lxc_default_bind_mounts | default([]) }}"
    - "{{ list_of_bind_mounts | default([]) }}"
  delegate_to: "{{ physical_host }}"
  register: _mc
  tags:
    - common-lxc

the problem was the order of mount .
its been fixed in openstack victoria

insertbefore section was added. in upgrade ussuri to victoria we should do it manually.

so the order is like this

first var/log

then /var/log/journal

- name: Add bind mount configuration to container
  lineinfile:
    dest: "/var/lib/lxc/{{ inventory_hostname }}/config"
    line: "lxc.mount.entry = {{ item['mount_path'] }} {{ item['bind_dir_path'].lstrip('/') }} none bind,create=dir 0 0"
    insertbefore: "^lxc.mount.entry = .*\\s{{ item['bind_dir_path'].lstrip('/') | regex_replace('/', '\/') }}.*"
    backup: "true"
  with_items:
    - "{{ lxc_default_bind_mounts | default([]) }}"
    - "{{ list_of_bind_mounts | default([]) }}"
  delegate_to: "{{ physical_host }}"
  register: _mc
  tags:
    - common-lxc
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文