步骤一:系统环境要求
服务器系统配置好可用的软件源
步骤二:安装 cockpit
# yum -y install cockpit cockpit-dashaboard
(补充:cockpit 是管理单台主机的程序,cockpit-dashaboard 是管理多台主机的程序)
步骤三:启动 cockpit
# systemctl start cockpit
步骤四:登录 cockpit
使用浏览器登录:https://<服务器的 IP 地址>:9090
服务器系统配置好可用的软件源
# yum -y install cockpit cockpit-dashaboard
(补充:cockpit 是管理单台主机的程序,cockpit-dashaboard 是管理多台主机的程序)
# systemctl start cockpit
使用浏览器登录:https://<服务器的 IP 地址>:9090
# histroy
(注意:默认情况下 history 只会记录 1000 条历史命令)
# cat ~/.bash_history
# !23
# !h
开启 core dump 之后,如果出现了 C 语言程序的 crash,则会将 crash 的结果记录到一个文件里
# ulimit -a
core file size (blocks, -c) 0
data seg size (kbytes, -d) unlimited
scheduling priority (-e) 0
file size (blocks, -f) unlimited
pending signals (-i) 31722
max locked memory (kbytes, -l) 64
max memory size (kbytes, -m) unlimited
open files (-n) 1024
pipe size (512 bytes, -p) 8
POSIX message queues (bytes, -q) 819200
real-time priority (-r) 0
stack size (kbytes, -s) 8192
cpu time (seconds, -t) unlimited
max user processes (-u) 31722
virtual memory (kbytes, -v) unlimited
file locks (-x) unlimited
# ulimit -c unlimited
# ulimit -a
core file size (blocks, -c) unlimited
data seg size (kbytes, -d) unlimited
scheduling priority (-e) 0
file size (blocks, -f) unlimited
pending signals (-i) 31722
max locked memory (kbytes, -l) 64
max memory size (kbytes, -m) unlimited
open files (-n) 1024
pipe size (512 bytes, -p) 8
POSIX message queues (bytes, -q) 819200
real-time priority (-r) 0
stack size (kbytes, -s) 8192
cpu time (seconds, -t) unlimited
max user processes (-u) 31722
virtual memory (kbytes, -v) unlimited
file locks (-x) unlimited
# sysctl -w kernel.core_pattern=/tmp/corefile/core-%e-%p
/var/log/messages
# grep -i <priority> /var/log/messages
序号 | 关键字 | 优先级 | 内容 |
1 | EMERG | 级别 0 | 紧急,系统本身已经无法再运行必须马上拯救 |
2 | ALERT | 级别 1 | 警报,系统出现了重大错误必须马上处理的情况 |
3 | CRIT | 级别 2 | 严重,系统出现了严重的情况 |
4 | ERROR | 级别 3 | 错误,系统出现了错误的情况 |
5 | WARNING | 级别 4 | 警告,系统出现了需要警告的情况 |
6 | NOTICE | 级别 5 | 注意,系统出现了需要注意的情况 |
7 | INFO | 级别 6 | 信息,系统出现了一些情况 |
8 | DEBUG | 级别 7 | 调试,系统出现了程序或服务调试的情况 |
(注意:优先级是按照从紧急到无所谓的顺序进行排列的)
# journalctl | grep <server name keywords>
# journalctl -u <service> -p <priority>
# journalctl -n <number of messages>
# journalctl --since="<yyyy-mm-dd> <HH:MM:SS>" --until="<yyyy-mm-dd> <HH:MM:SS>"
# journalctl -p err -n 5
# journalctl -u httpd
# journalctl --since "2019-05-01 14:00" --until "2019-05-01 19:00"
# journalctl -xb