Linux系统维护例行操作指导手册(2)

  • 格式:docx
  • 大小:167.55 KB
  • 文档页数:17

神州数码系统集成服务有限公司密级:第1 篇(共1 篇)Linux系统维护例行操作指导手册外包交付中心方案名称:编写:编写日期:审核:审核日期:批准:批准日期:修订状况目录:1 系统架构 (3)1.1 招商信诺Linux系统架构图 (3)1.2 服务器概要信息 (3)1.3 数据库信息 (3)2 主机系统监控和预防性检查操作方法 (3)2.1 操作频率 (3)2.2 检查硬盘灯、电源灯等状态 (4)2.3 查看网卡状态及重启 (4)2.4 查看硬盘数以及分区状态 (4)2.5 查看系统主要进程运行情况 (5)2.6 查看活动进程 (5)2.7 查看操作系统空间情况 (9)2.8 检查操作系统日志 (10)2.8.1 系统登录日志:last (10)2.8.2 查看系统启动日志:dmesg (10)2.8.3 查看/var/log/messages 系统日志 (10)2.8.4 查看其他日志 (10)2.9 查看操作系统性能 (10)2.9.1 查看系统实时运行状态 (10)2.9.2 查看系统负载情况 (12)2.9.3 查看最近1,5,15分钟平均系统负载:uptime (12)2.9.4 查看当前登陆系统的用户 (12)2.9.5 查看物理内存和Swap空间使用率:free (13)3 例行作业操作方法 (13)3.1 操作频率 (13)3.2 操作系统备份 (13)3.3 过期系统日志清除 (13)4 操作系统手工停止、启动、重启操作步骤 (13)4.1 关闭操作系统 (13)4.2 重启操作系统 (13)4.3 启动操作系统 (14)5 操作系统常见需求处理方法、常见问题解决方法 (14)5.1 系统加固: (14)5.2 忘记root密码 (14)5.3 配置网卡 (16)5.4 配置防火墙 (16)6 操作系统应急恢复方法 (16)1系统架构1.1Linux系统架构图PS:此图只是示例,请根据实际项目系统架构情况重新绘制1.2服务器概要信息1.3数据库信息注:以下各检查项,如果有监控软件能实现检查项的监控报警,就不用手工检查。

否则需要手工检查。

2主机系统监控和预防性检查操作方法2.1操作频率每工作日检查1次。

2.2检查硬盘灯、电源灯等状态硬盘灯、电源灯正常为绿灯,如果出现黄灯或红灯说明有问题。

如果电源报警灯亮可以先检查电源是否插好。

如果都已插好则是电源损坏。

需要通知硬件代维方更换硬件。

2.3查看网卡状态及重启重启网络服务:#service network restart查看网络状态:#ifconfigpmc2:~ #ifconfigeth0 Link encap:EthernetHWaddr 00:1F:29:09:69:4Ainet addr:10.1.180.73 Bcast:10.1.180.255 Mask:255.255.255.0UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1RX packets:6421788961 errors:0 dropped:0 overruns:0 frame:0TX packets:9685332818 errors:0 dropped:0 overruns:0 carrier:0collisions:0 txqueuelen:1000RX bytes:652478847531 (622252.3 Mb) TX bytes:12895085984008 (12297712.3 Mb)Interrupt:185 Memory:f8000000-f8012100lo Link encap:Local Loopbackinet addr:127.0.0.1 Mask:255.0.0.0UP LOOPBACK RUNNING MTU:16436 Metric:1RX packets:6385721 errors:0 dropped:0 overruns:0 frame:0TX packets:6385721 errors:0 dropped:0 overruns:0 carrier:0collisions:0 txqueuelen:0RX bytes:402215646 (383.5 Mb) TX bytes:402215646 (383.5 Mb)2.4查看硬盘数以及分区状态#fdisk –lpmc2:/var/log #fdisk -lDisk /dev/cciss/c0d0: 146.7 GB, 146778685440 bytes255 heads, 63 sectors/track, 17844 cylindersUnits = cylinders of 16065 * 512 = 8225280 bytesDevice Boot Start End Blocks Id System/dev/cciss/c0d0p1 1 262 2104483+ 82 Linux swap / Solaris/dev/cciss/c0d0p2 * 263 17844 141227415 83 Linux2.5查看系统主要进程运行情况#ps–ef |grep backup2.6查看活动进程#ps –aux监听某个进程lsof–p 进程号pmc2:~ # ps -auxWarning: bad ps syntax, perhaps a bogus '-'? See /faq.htmlUSER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND root 1 0.0 0.0 780 304 ? S 2008 0:49 init [5]root 2 0.0 0.0 0 0 ? S 2008 0:01 [migration/0] root 3 0.0 0.0 0 0 ? SN 2008 0:00 [ksoftirqd/0] root 4 0.0 0.0 0 0 ? S 2008 0:00 [migration/1] root 5 0.0 0.0 0 0 ? SN 2008 0:00 [ksoftirqd/1] root 6 0.0 0.0 0 0 ? S 2008 0:00 [migration/2] root 7 0.0 0.0 0 0 ? SN 2008 0:00 [ksoftirqd/2] root 8 0.0 0.0 0 0 ? S 2008 0:00 [migration/3] root 9 0.0 0.0 0 0 ? SN 2008 0:00 [ksoftirqd/3] root 10 0.0 0.0 0 0 ? S 2008 0:01 [migration/4] root 11 0.0 0.0 0 0 ? SN 2008 0:00 [ksoftirqd/4] root 12 0.0 0.0 0 0 ? S 2008 0:00 [migration/5] root 13 0.0 0.0 0 0 ? SN 2008 0:00 [ksoftirqd/5] root 14 0.0 0.0 0 0 ? S 2008 0:00 [migration/6] root 15 0.0 0.0 0 0 ? SN 2008 0:00 [ksoftirqd/6] root 16 0.0 0.0 0 0 ? S 2008 0:01 [migration/7] root 17 0.0 0.0 0 0 ? SN 2008 0:00 [ksoftirqd/7] root 18 0.0 0.0 0 0 ? S< 2008 0:00 [events/0] root 19 0.0 0.0 0 0 ? S< 2008 0:00 [events/1] root 20 0.0 0.0 0 0 ? S< 2008 0:00 [events/2] root 21 0.0 0.0 0 0 ? S< 2008 0:00 [events/3] root 22 0.0 0.0 0 0 ? S< 2008 0:00 [events/4] root 23 0.0 0.0 0 0 ? S< 2008 0:00 [events/5] root 24 0.0 0.0 0 0 ? S< 2008 0:00 [events/6] root 25 0.0 0.0 0 0 ? S< 2008 0:00 [events/7] root 26 0.0 0.0 0 0 ? S< 2008 0:00 [khelper]root 27 0.0 0.0 0 0 ? S< 2008 0:00 [kthread]root 37 0.0 0.0 0 0 ? S< 2008 0:00 [kblockd/0] root 38 0.0 0.0 0 0 ? S< 2008 0:08 [kblockd/1] root 39 0.0 0.0 0 0 ? S< 2008 0:08 [kblockd/2]root 40 0.0 0.0 0 0 ? S< 2008 0:00 [kblockd/3]root 41 0.0 0.0 0 0 ? S< 2008 0:00 [kblockd/4]root 42 0.0 0.0 0 0 ? S< 2008 0:00 [kblockd/5]root 43 0.0 0.0 0 0 ? S< 2008 0:06 [kblockd/6]root 44 0.0 0.0 0 0 ? S< 2008 0:00 [kblockd/7]root 45 0.0 0.0 0 0 ? S< 2008 0:00 [kacpid]root 244 0.0 0.0 0 0 ? S 2008 99:04 [kswapd0]root 245 0.0 0.0 0 0 ? S< 2008 0:00 [aio/0]root 246 0.0 0.0 0 0 ? S< 2008 0:00 [aio/1]root 247 0.0 0.0 0 0 ? S< 2008 0:00 [aio/2]root 248 0.0 0.0 0 0 ? S< 2008 0:00 [aio/3]root 249 0.0 0.0 0 0 ? S< 2008 0:00 [aio/4]root 250 0.0 0.0 0 0 ? S< 2008 0:00 [aio/5]root 251 0.0 0.0 0 0 ? S< 2008 0:00 [aio/6]root 252 0.0 0.0 0 0 ? S< 2008 0:00 [aio/7]root 478 0.0 0.0 0 0 ? S< 2008 0:00 [cqueue/0]root 479 0.0 0.0 0 0 ? S< 2008 0:00 [cqueue/1]root 480 0.0 0.0 0 0 ? S< 2008 0:00 [cqueue/2]root 481 0.0 0.0 0 0 ? S< 2008 0:00 [cqueue/3]root 482 0.0 0.0 0 0 ? S< 2008 0:00 [cqueue/4]root 483 0.0 0.0 0 0 ? S< 2008 0:00 [cqueue/5]root 484 0.0 0.0 0 0 ? S< 2008 0:00 [cqueue/6]root 485 0.0 0.0 0 0 ? S< 2008 0:00 [cqueue/7]root 486 0.0 0.0 0 0 ? S< 2008 0:00 [kseriod]root 518 0.0 0.0 0 0 ? S< 2008 0:00 [kpsmoused]root 1007 0.0 0.0 0 0 ? S< 2008 0:00 [ata/0]root 1008 0.0 0.0 0 0 ? S< 2008 0:00 [ata/1]root 1009 0.0 0.0 0 0 ? S< 2008 0:00 [ata/2]root 1010 0.0 0.0 0 0 ? S< 2008 0:00 [ata/3]root 1011 0.0 0.0 0 0 ? S< 2008 0:00 [ata/4]root 1012 0.0 0.0 0 0 ? S< 2008 0:00 [ata/5]root 1013 0.0 0.0 0 0 ? S< 2008 0:00 [ata/6]root 1014 0.0 0.0 0 0 ? S< 2008 0:00 [ata/7]root 1015 0.0 0.0 0 0 ? S< 2008 0:00 [ata_aux]root 1071 0.0 0.0 0 0 ? S< 2008 0:00 [reiserfs/0]root 1072 0.0 0.0 0 0 ? S< 2008 1:56 [reiserfs/1]root 1073 0.0 0.0 0 0 ? S< 2008 1:55 [reiserfs/2]root 1074 0.0 0.0 0 0 ? S< 2008 0:00 [reiserfs/3]root 1075 0.0 0.0 0 0 ? S< 2008 0:00 [reiserfs/4]root 1076 0.0 0.0 0 0 ? S< 2008 0:22 [reiserfs/5]root 1077 0.0 0.0 0 0 ? S< 2008 1:25 [reiserfs/6]root 1078 0.0 0.0 0 0 ? S< 2008 0:00 [reiserfs/7]root 1140 0.0 0.0 7128 700 ? S<s 2008 0:00 /sbin/udevd --daemon root 1812 0.0 0.0 0 0 ? S< 2008 0:00 [khubd]root 1824 0.0 0.0 0 0 ? S 2008 0:00 [shpchpd_event]root 2865 0.0 0.0 10516 736 ? Ss 2008 0:00 /sbin/resmgrdroot 2896 0.0 0.0 8296 876 ? Ss 2008 2:27 /sbin/syslog-ngroot 2899 0.0 0.0 2640 404 ? Ss 2008 0:08 /usr/sbin/irqbalanceroot 2902 0.0 0.0 2884 668 ? Ss 2008 2:34 /sbin/klogd -c 1 -x -xroot 2907 0.0 0.0 2620 520 ? Ss 2008 0:00 /sbin/acpid100 2941 0.0 0.0 13164 1140 ? Ss 2008 0:33 /usr/bin/dbus-daemon --system root 3039 0.0 0.0 13400 3484 ? Ss 2008 0:06 /usr/sbin/hald --daemon=yes--retain-privilegesroot 3418 0.0 0.0 6012 736 ? S 2008 0:00 hald-addon-acpiroot 3536 0.0 0.0 12012 632 ? S<sl 2008 0:00 /sbin/auditd -nroot 3538 0.0 0.0 0 0 ? S< 2008 0:00 [kauditd]nobody 3542 0.0 0.0 4844 672 ? Ss 2008 0:00 /sbin/portmapdaemon 3593 0.0 0.0 12984 1044 ? Ss 2008 0:00 /usr/sbin/slpdroot 3709 0.0 0.0 122964 1104 ? Ssl 2008 2:16 /usr/sbin/nscdlp 3879 0.0 0.0 24284 4120 ? Ss 2008 0:00 /usr/sbin/cupsdroot 3893 0.0 0.0 0 0 ? S< 2008 0:00 [nfsd4]root 3894 0.0 0.0 0 0 ? S 2008 0:00 [nfsd]root 3895 0.0 0.0 0 0 ? S 2008 0:00 [nfsd]root 3896 0.0 0.0 0 0 ? S 2008 0:00 [nfsd]root 3897 0.0 0.0 0 0 ? S 2008 0:00 [nfsd]root 3899 0.0 0.0 0 0 ? S 2008 0:00 [lockd]root 3900 0.0 0.0 0 0 ? S< 2008 162:34 [rpciod/0]root 3901 0.0 0.0 0 0 ? S< 2008 0:00 [rpciod/1]root 3902 0.0 0.0 0 0 ? S< 2008 0:00 [rpciod/2]root 3903 0.0 0.0 0 0 ? S< 2008 0:00 [rpciod/3]root 3904 0.0 0.0 0 0 ? S< 2008 0:00 [rpciod/4]root 3905 0.0 0.0 0 0 ? S< 2008 0:00 [rpciod/5]root 3906 0.0 0.0 0 0 ? S< 2008 0:00 [rpciod/6]root 3907 0.0 0.0 0 0 ? S< 2008 0:00 [rpciod/7]root 3925 0.0 0.0 5928 624 ? Ss 2008 0:00 /usr/sbin/rpc.mountdroot 3964 0.0 0.0 27056 1464 ? Ss 2008 0:11 /usr/sbin/sshd -oPidFile=/var/run/sshd.init.pidroot 3978 0.0 0.0 20288 2004 ? S 2008 0:06 /usr/sbin/powersaved -d -f/var/run/acpid.socket -v 3root 4059 0.0 0.0 21324 2172 ? Ss 2008 0:02 /usr/lib/postfix/masterroot 4090 0.0 0.0 7100 572 ? Ss 2008 0:01 /usr/sbin/cronpostfix 4095 0.0 0.0 21328 2160 ? S 2008 0:11 qmgr -l -t fifo -uroot 4393 0.0 0.0 3060 704 tty1 Ss+ 2008 0:00 /sbin/mingetty --noclear tty1 root 4395 0.0 0.0 3060 692 tty3 Ss+ 2008 0:00 /sbin/mingetty tty3root 4396 0.0 0.0 3060 708 tty4 Ss+ 2008 0:00 /sbin/mingetty tty4root 4397 0.0 0.0 3064 688 tty5 Ss+ 2008 0:00 /sbin/mingetty tty5root 4398 0.0 0.0 3064 692 tty6 Ss+ 2008 0:00 /sbin/mingetty tty6oracle 4631 0.0 0.1 63048 10244 ? Ssl 2008 2:53/opt/oracle/product/10.2/db_1/bin/tnslsnr LISTENER -inheritroot 30031 0.0 0.0 28648 1568 ? Ss 2008 0:00 login -- rootroot 24551 0.0 0.0 9720 2292 tty2 Ss+ 2008 0:00 -bashroot 23901 0.0 0.0 50880 6652 ? S 2008 0:08 /opt/gnome/sbin/gdmroot 23914 0.0 0.0 60268 2820 ? S 2008 0:00 /opt/gnome/sbin/gdmroot 23917 0.0 0.1 44876 8312 tty7 Ss+ 2008 118:31 /usr/X11R6/bin/X :0 -audit 0 -br -auth /var/lib/gdm/:0.Xauth vt7gdm 23936 0.0 0.2 94228 18812 ? Ss 2008 0:00 /opt/gnome/lib64/gdm/gdmgreeter root 24077 0.0 0.0 8700 444 ? Ss 2008 0:00 /usr/bin/gpg-agent --sh --daemon root 24082 0.0 0.0 10268 900 ? Ss 2008 0:00 dbus-daemon --fork --print-pid 8--print-address 6 --sessionroot 17791 0.0 0.0 10268 892 ? Ss 2009 0:00 dbus-daemon --fork --print-pid 8--print-address 6 --sessionoracle 28198 0.0 0.1 61984 9096 ? Ssl 2009 0:24/opt/oracle/product/10.2/db_1/bin/tnslsnr LISTENER -inheritoracle 28205 0.0 0.2 2563316 19812 ? Ss 2009 0:01 ora_pmon_orcloracle 28207 0.0 0.1 2562144 16180 ? Ss 2009 1:33 ora_psp0_orcloracle 28209 0.0 10.8 2562140 887704 ? Ss 2009 0:10 ora_mman_orcloracle 28211 0.0 22.9 2595952 1879296 ? Ss 2009 6:00 ora_dbw0_orcloracle 28213 0.0 0.5 2577696 48272 ? Ss 2009 8:24 ora_lgwr_orcloracle 28215 0.0 1.2 2563684 102704 ? Ss 2009 12:35 ora_ckpt_orcloracle 28217 0.0 16.7 2564780 1369832 ? Ss 2009 9:24 ora_smon_orcloracle 28219 0.0 3.2 2563724 267828 ? Ss 2009 0:00 ora_reco_orcloracle 28221 0.0 8.5 2563796 698012 ? Ss 2009 3:10 ora_cjq0_orcloracle 28223 0.0 31.7 3347456 2593104 ? Ss 2009 13:57 ora_mmon_orcloracle 28225 0.0 2.0 2562140 164608 ? Ss 2009 0:04 ora_mmnl_orcloracle 28227 0.0 0.2 2562988 16464 ? Ss 2009 0:00 ora_d000_orcloracle 28233 0.0 0.1 2563316 15680 ? Ss 2009 0:00 ora_s000_orcloracle 28237 0.0 0.4 2577696 33280 ? Ss 2009 0:46 ora_arc0_orcloracle 28239 0.0 0.4 2577696 33140 ? Ss 2009 0:45 ora_arc1_orcloracle 28243 0.0 0.2 2562140 17564 ? Ss 2009 0:00 ora_qmnc_orcloracle 28247 0.0 16.9 2564804 1389684 ? Ss 2009 0:27 ora_q000_orcloracle 28249 0.0 0.2 2562136 16768 ? Ss 2009 0:05 ora_q001_orcloracle 25297 0.0 0.3 2562848 31136 ? Ss Sep03 0:00 oracleorcl (LOCAL=NO)oracle 25299 0.0 0.2 2562272 19720 ? Ss Sep03 0:00 oracleorcl (LOCAL=NO)oracle 25301 0.0 0.2 2562268 19648 ? Ss Sep03 0:00 oracleorcl (LOCAL=NO)oracle 25303 0.0 0.2 2562268 19632 ? Ss Sep03 0:00 oracleorcl (LOCAL=NO)oracle 25305 0.0 0.2 2562268 19620 ? Ss Sep03 0:00 oracleorcl (LOCAL=NO)oracle 25307 0.0 0.2 2562268 19656 ? Ss Sep03 0:00 oracleorcl (LOCAL=NO)oracle 25309 0.0 0.2 2562268 19636 ? Ss Sep03 0:00 oracleorcl (LOCAL=NO)oracle 25311 0.0 0.2 2562268 19632 ? Ss Sep03 0:00 oracleorcl (LOCAL=NO)oracle 25313 0.0 0.2 2562268 19624 ? Ss Sep03 0:00 oracleorcl (LOCAL=NO)oracle 25315 0.0 0.2 2562268 19628 ? Ss Sep03 0:00 oracleorcl (LOCAL=NO)oracle 25317 0.0 0.2 2562272 19828 ? Ss Sep03 0:00 oracleorcl (LOCAL=NO)oracle 25319 0.0 0.2 2562268 19628 ? Ss Sep03 0:00 oracleorcl (LOCAL=NO)oracle 25321 0.0 0.2 2562272 19652 ? Ss Sep03 0:00 oracleorcl (LOCAL=NO)oracle 25323 0.0 0.2 2562268 19648 ? Ss Sep03 0:00 oracleorcl (LOCAL=NO)oracle 25325 0.0 0.2 2562268 19656 ? Ss Sep03 0:00 oracleorcl (LOCAL=NO)oracle 25327 0.0 0.2 2562272 19648 ? Ss Sep03 0:00 oracleorcl (LOCAL=NO)oracle 25329 0.0 0.2 2562272 19656 ? Ss Sep03 0:00 oracleorcl (LOCAL=NO)oracle 25331 0.0 0.2 2562272 19668 ? Ss Sep03 0:00 oracleorcl (LOCAL=NO)oracle 25333 0.0 0.2 2562272 19652 ? Ss Sep03 0:00 oracleorcl (LOCAL=NO)oracle 25335 0.0 0.2 2562272 19672 ? Ss Sep03 0:00 oracleorcl (LOCAL=NO)oracle 25337 0.0 0.3 2562300 27968 ? Ss Sep03 0:00 oracleorcl (LOCAL=NO)oracle 25339 0.0 7.6 2565116 629144 ? Ss Sep03 2:53 oracleorcl (LOCAL=NO)oracle 25341 0.0 0.4 2562804 39076 ? Ss Sep03 0:00 oracleorcl (LOCAL=NO)oracle 25345 0.0 0.7 2562792 61712 ? Ss Sep03 0:00 oracleorcl (LOCAL=NO)oracle 25353 0.0 2.6 2579964 216368 ? Ss Sep03 0:03 oracleorcl (LOCAL=NO)oracle 25355 1.3 11.6 2565124 949284 ? Ss Sep03 99:19 oracleorcl (LOCAL=NO)oracle 32567 0.2 17.0 2565120 1397576 ? Ss Sep04 16:22 oracleorcl (LOCAL=NO)oracle 32623 0.0 7.4 2565080 612796 ? Ss Sep04 3:33 oracleorcl (LOCAL=NO)oracle 32633 0.0 11.5 2571092 945668 ? Ss Sep04 2:28 oracleorcl (LOCAL=NO)oracle 32637 0.0 5.5 2563932 453380 ? Ss Sep04 0:25 oracleorcl (LOCAL=NO)root 19386 0.0 0.0 0 0 ? S Sep07 0:00 [pdflush]root 19387 0.0 0.0 0 0 ? S Sep07 0:03 [pdflush]root 3812 1.8 0.0 2592 476 ? Ss 06:47 11:31 zmd /usr/lib/zmd/zmd.exe --sleep 82199oracle 23144 0.0 1.3 2564960 114488 ? Ss 13:26 0:00 oracleorcl (LOCAL=NO)root 23264 0.0 0.0 40892 2892 ? Ss 13:57 0:00 sshd: root@pts/1root 23270 0.0 0.0 9716 2288 pts/1 Ss 13:57 0:00 -bashpostfix 23940 0.0 0.0 21296 2064 ? S 16:17 0:00 pickup -l -t fifo -uoracle 24254 0.0 0.3 2563728 29512 ? Ss 17:17 0:00 ora_j000_orclroot 24255 0.0 0.0 3496 900 pts/1 R+ 17:17 0:00 ps–aux2.7查看操作系统空间情况#df -kpmc2:~ # df -kFilesystem 1K-blocks Used Available Use% Mounted on/dev/cciss/c0d0p2 141223076 40411988 100811088 29% /udev4089216 116 4089100 1% /dev参数h 中文显示---- df–h查看文件系统使用率有没有大于90%(阀值,可根据实际情况设定)。