Skip to main content

Posts

Showing posts from April, 2022

Foreman - Upgrade to Foreman 3.2 and Katello 4.4

NOTE: This guide exists for Upgrading from v3.0 to v3.1 as well --> here When updating your foreman installation manually, I find that the official documentation  is a bit lacking. So here's how I update my foreman-server from v3.1 to v3.2 and katello from v4.3 to v4.4. I would recommend executing all of these commands in a tmux session so that your session will remain on the server in case anything happens to your workstation. Start by checking for running tasks that would prohibit an update: [root@katello01 ~]# foreman-rake katello:upgrade_check Next, update the katello host and reboot it if yum tells you to: [root@katello01 ~]# yum -d 2 -y update [root@katello01 ~]# yum -d 2 needs-restarting -r When the katello services have started again, upgrade the repository: [root@katello01 ~]# yum -d 2 -y install https://yum.theforeman.org/releases/3.2/el7/x86_64/foreman-release.rpm [root@katello01 ~]# yum -d 2 -y install https://yum.theforeman.org/katello/4.4/katello/el7/x

Systemd - Configure cpu affinity and resource limits for a service

If you're running CPU-intensive workloads on a host, it can be quite useful to restrict other services in their CPU usage and systemd makes this process an absolute breeze. I'll use the sshd-service for this example. First, create the service directory which will allow overwriting only certain unit options: [root@server ~]# mkdir -p /etc/systemd/system/sshd.service.d Now create a config file that will overwrite certain sections: [root@server ~]# cat << EOF >> /etc/systemd/system/sshd.service.d/resources.conf [Service] CPUAffinity=0 CPUQuota=20% MemoryLimit=134217728 EOF This config will sshd to - only run on the first CPU thread - only consume 20% of the CPU at max - only consume 1GiB of RAM at max Make systemd aware of the changes by reloading it and restarting sshd: [root@server ~]# systemctl daemon-reload [root@server ~]# systemctl restart sshd.service Since sshd will spawn a new process for every login, the changes won't take effec