[内容] SUSE Repository Mirroring Tool (RMT) 服务端的设置 (软件源)

内容一:显示软件源

1.1 显示所有的 SUSE 软件源产品

# rmt-cli products list --all

1.2 显示所有已经启用的 SUSE 软件源产品

# rmt-cli products list

1.3 显示所有指定版本且指定架构的 SUSE 软件源产品

# rmt-cli products list --all --version=15.4 --arch=x86_64

(补充:这里以显示所有 15.4 版本且 x86_64 架构的 SUSE 软件源产品为例)

1.4 显示所有已启用指定版本且指定架构的 SUSE 软件源产品

# rmt-cli products list --version=15.4 --arch=x86_64

(补充:这里以显示所有已其应用 15.4 版本且 x86_64 架构的 SUSE 软件源产品为例)

内容二:启用软件源

2.1 启用某个软件源

# rmt-cli products enable <id>

或者:

# rmt-cli products enable <string>

2.2 开启所有指定版本且指定架构的 SUSE 软件源产品

# for i in `rmt-cli products list --all --version=15.4 --arch=x86_64 | awk '{print $2}' | egrep -v '\||ID|^$'`;do rmt-cli products enable $i;done

(补充:这里以开启所有 15.4 版本且 x86_64 架构的 SUSE 软件源产品)

内容三:取消启用软件源

3.1 取消启用某个软件源

# rmt-cli products disable <id>

或者:

# rmt-cli products disable <string>

3.2 取消所有指定版本且指定架构的 SUSE 软件源产品

# for i in `rmt-cli products list --all --version=15.4 --arch=x86_64 | awk '{print $2}' | egrep -v '\||ID|^$'`;do rmt-cli products disable $i;done

(补充:这里以取消开启所有 15.4 版本且 x86_64 架构的 SUSE 软件源产品)

参考文献:

https://documentation.suse.com/sles/15-SP4/single-html/SLES-rmt/index.html#sec-rmt-tools-rmt-cli

[步骤] Red Hat Satellite 无法停止任务的强制停止

步骤一:打一个快照

(步骤略)

步骤二:显示运行结果是错误的任务

# sudo su - postgres -c "psql -d foreman -c 'select label,count(label),state,result from foreman_tasks_tasks where state <> '\''stopped'\'' group by label,state,result ORDER BY label;'"
                        label                         | count |   state   | result  
------------------------------------------------------+-------+-----------+---------
 Actions::Katello::ContentView::Publish               |     1 | paused    | error
 ......

(补充:从这里可以看出运行结果是错误的任务标签是 Actions::Katello::ContentView::Publish)

步骤三:强制停止 Red Hat Satellite 无法停止的任务

# foreman-rake foreman_tasks:cleanup TASK_SEARCH='label = Actions::Katello::ContentView::Publish' STATES='paused' VERBOSE=true

(补充:这里以强制停止标签为 Actions::Katello::ContentView::Publish 的任务为例)

[内容] NFS 常用参数

内容一:NFS 常用参数

1) no_root_squash 当使用 NFS 共享目录的客户端是以客户端的 root 用户的身份使用,那么对于这个共享目录而言,这个客户端具有 root 权限
2) root_squash 当使用 NFS 共享目录的客户端是以客户端的 root 用户的身份使用,那么对于这个共享目录而言,这个客户端依旧没有 root 权限
3) 此为默认值,anon=0 禁止使用 NFS 共享目录的客户端以随机身份使用
4) anon=1 允许使用 NFS 共享目录的客户端以随机身份使用
5) soft 使用 NFS 共享目录的客户端以软挂载的方式进行挂载,若客户端的请求得不到回应,则会重新发出请求并传回错误信息
6) 此为默认值,hard 使用 NFS 共享目录的客户端以软挂载的方式进行挂载,若客户端的请求得不到回应,则会一直发出请求直到得到 NFS 服务器的回应为止
7) timeo=120 使用 NFS 共享目录的客户端在连接不通后,会以 1/7 秒的时间尝试重新连接,默认会尝试重新连接 7 次,timeo=120 表示会重新尝试连接 120 次
8) rw 设置使用 NFS 共享目录的客户端拥有读和写的权限
9) nolock 取消文件锁

内容二:NFS 的挂载案例

# cat /etc/fstab
192.168.0.1:/test /test nfs timeo=120,rw,soft,nolock 0 0


补充:这里以
1) 挂载 192.168.0.1:/test 的目录到本地的 /test 目录
2) 以 nfs 格式进行挂载
3) 客户端在连接不通后会重新尝试连接 120 次
4) 客户端拥有读和写的权限
5) 以软挂载的方式进行挂载
6) 取消文件锁
7) 不进行数据备份
8) 不进行数据校验
为例

[步骤] Red Hat Satellite Content View 信息的显示

步骤一:显示所有 Content View 的 ID

# hammer content-view list

----------------|---------------------------|--------------------------------------|-----------|---------------------|---------------------------------------------------------------------------------
CONTENT VIEW ID | NAME                      | LABEL                                | COMPOSITE | LAST PUBLISHED      | REPOSITORY IDS                                                                  
----------------|---------------------------|--------------------------------------|-----------|---------------------|---------------------------------------------------------------------------------
10              | test_CV                   | test_CV                              | false     | 2022/06/23 20:20:20 | 61525, 16812, 61524, 16814, 16813, 16811, 16816, 16817, 6578, 231, 8, 9, 131,...

步骤二:显示某 1 个 Content View 的详细信息

# hammer content-view info --id 10

(补充:这里以显示 ID 为 10 的 Content View 的信息为例)