lscpu free -h lsblk lsb_release -a
替代方案
cat /proc/cpuinfo | grep processor | wc -l cat /proc/meminfo | grep MemTotal df -h / cat /etc/issue
curl https://ip.im sudo ufw status ip a ip r ip link show cat /etc/resolv.conf | grep nameserver tracepath -n 1.1.1.1
sudo vi /etc/netplan/00-installer-config.yaml
network: ethernets: ens18: addresses: [192.168.11.204/24] gateway4: 192.168.11.1 nameservers: addresses: [8.8.8.8,8.8.4.4] dhcp4: no version: 2
sudo vi /etc/netplan/00-installer-config.yaml
network: ethernets: eth0: dhcp4: true eth1: addresses: [192.168.7.101/24] routes: - to: 192.168.7.0/24 via: 192.168.7.1 metric: 40 table: 200 nameservers: addresses: [8.8.8.8,168.95.192.1] dhcp4: no version: 2
localadmin@iiidevops-1:~$ ip route default via 172.17.13.177 dev eth0 proto dhcp src 172.17.13.189 metric 100 172.17.13.176/28 dev eth0 proto kernel scope link src 172.17.13.189 172.17.13.177 dev eth0 proto dhcp scope link src 172.17.13.189 metric 100 192.168.7.0/24 dev eth1 proto kernel scope link src 192.168.7.101
ufw allow proto tcp from any to any port 22,80,443 comment 'Open SSH/Web ports' ufw allow proto udp from any to any port 161 comment 'Open SNMP ports'
ufw status
apt install iptables-persistent -y
iptables -I FORWARD -i br0 -p all -j ACCEPT
iptables-save -c > /etc/iptables/rules.v4
sudo vi /etc/cloud/cloud.cfg
: preserve_hostname: true :
sudo hostnamectl set-hostname pve-devops1
sudo su - vi /etc/hosts
127.0.0.1 localhost 127.0.1.1 iServStorM1 :
vi /etc/hostname
iServStorM1
hostname -F /etc/hostname
sudo useradd -s /bin/bash -d /home/localadmin/ -m -G sudo localadmin sudo passwd localadmin
sudo usermod -aG sudo localadmin
/# dpkg -L docker /. /usr /usr/share /usr/share/doc /usr/share/doc/docker /usr/share/doc/docker/changelog.Debian.gz /usr/share/doc/docker/copyright
sudo apt-get install --no-install-recommends ubuntu-desktop
root@demo-77:/var/log/journal/4ad9885bb19142118fd758b3be95057e# journalctl --disk-usage Archived and active journals take up 4.0G in the file system.
root@demo-77:/var/log/journal/4ad9885bb19142118fd758b3be95057e# journalctl --rotate root@demo-77:/var/log/journal/4ad9885bb19142118fd758b3be95057e# journalctl --vacuum-time=2days : root@demo-77:/var/log/journal/4ad9885bb19142118fd758b3be95057e# journalctl --disk-usage Archived and active journals take up 16.0M in the file system.
vi /etc/systemd/journald.conf
: [Journal] : SystemMaxUse=500M :
systemctl daemon-reload
清理現有的大型 journal 檔案
sudo journalctl --vacuum-size=500M
~# tail -f /var/log/syslog Aug 31 10:43:07 iiidevops4 multipathd[747]: sda: add missing path Aug 31 10:43:09 iiidevops4 multipathd[747]: sda: failed to get udev uid: Invalid argument Aug 31 10:43:11 iiidevops4 multipathd[747]: sda: failed to get sysfs uid: Invalid argument Aug 31 10:43:12 iiidevops4 multipathd[747]: sda: failed to get sgio uid: No such file or directory Aug 31 10:43:17 iiidevops4 multipathd[747]: sda: add missing path
vi /etc/multipath.conf
defaults { user_friendly_names yes } blacklist { devnode "^(ram|raw|loop|fd|md|dm-|sr|scd|st|sda)[0-9]*" }
systemctl restart multipath-tools
sudo apt install bmon slurm tcptrack