Squid Web Cache Wiki

Squid Web Cache 文档

🔗 添加缓存目录

作者:Chris Robertson

了解如何向 Squid 的缓存目录集添加新驱动器是一项有用的知识。而且也很简单。

Squid 会半自动地处理这些更改,但仍有几项操作需要手动执行。

假设您的磁盘已连接、操作系统已识别并且磁盘已格式化

  1. 确保 cache_effective_user 对挂载点具有写入权限
  2. 在 squid.conf 中添加一个 cache_dir 指令,引用新的挂载点
  3. 停止 squid
  4. 运行 squid -z (作为 root 或 cache_effective_user)
  5. 启动 squid

🔗 减少宕机时间的技巧

作者:AmosJeffriesHenrikNordstrom

:information_source: 此方法不适用于大型缓存,因为不会触及现有的 cache_dir。

  1. 确保 cache_effective_user 对挂载点具有写入权限
  2. 暂时修改 squid.conf 以使用另一个 pid_filename。如果发现另一个正在运行的 squid 实例,squid -z 会提前中止
  3. 在 squid.conf 中添加一个 cache_dir 指令,引用新的挂载点
  4. 暂时:注释掉现有的 cache_dir 条目
  5. 运行 squid -z -f ./squid.conf (作为 root 或 cache_effective_user)
  6. 撤销对 pid_filename 和预先存在的 cache_dir 的临时更改
  7. 使用 squid -k reconfigure 重新配置正在运行的 squid

:information_source: 虽然对于 ufs/aufs/diskd,带 -z 的操作是无害的,但对于 coss 等 cache_dirs,这是一个破坏性操作,因此注释掉它们很重要。

回到 FAQ 索引

导航: 网站搜索网站页面分类🔼 向上