【问题标题】:How can I create a logical volume mounted at /opt in chef如何创建安装在 /opt in chef 的逻辑卷
【发布时间】:2018-01-17 05:04:17
【问题描述】:

我正在处理一个项目,我需要使用安装在 /opt 的 chef 创建一个逻辑卷。问题是厨师似乎将其客户端安装到 /opt/chef 所以收敛失败,但只是第一次。第二次收敛总是成功的。有没有办法收敛到我的配方或使用配方重新安装客户端?

食谱:

lvm_volume_group 'test_group' do
  physical_volumes ['/dev/xvdi']
  wipe_signatures true

  logical_volume 'foo' do
    size '3G'
    filesystem 'xfs'
    mount_point location: '/opt'
  end
end

错误:
================================================== ========================== 在资源 'lvm_volume_group[test_group]' 上执行操作 create 时出错

===========================================================================

 Errno::ENOENT
  -------------
 No such file or directory @ realpath_rec - /opt/chef

【问题讨论】:

    标签: chef-infra chef-recipe


    【解决方案1】:

    你有点做不到。您需要在安装 Chef 之前进行此设置,作为系统初始化或引导程序的一部分。否则,您可以将文件夹挂载到其他位置,然后仅绑定某些子文件夹;或者挂载到别处,复制/opt/chef,然后重新挂载到/opt。总的来说,这种设置最好在机器初始化期间处理。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-02-24
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多