1、RAID 13RAID 1 + hotspare4RAID 105RAID 10 + hotspare5块以上酌情处理 注:一般PC服务器机器本机硬盘也就2块,需要更好的性能和可靠性,推荐四块硬盘做RAID10。4.收集信息内容信息记录IP地址,掩码,网关、DNS、主机名root 口令二.安装过程1.分区规划对于本地硬盘一下目录建立在非LVM管理分区大小分区类型文件系统/boot200M主分区ext3非LVM逻辑卷/4GSwap如果RAM /dev/null 2 /dev/null | true /bin/kill -HUP cat /var/run/rsyslogd.pid 2 endscr
2、ipt/var/log/messages weekly size=10M rotate 505.性能监控部署和分析工具使用 nmon:1、部署监控工具上传nmon_x86_11f.zip或者nmon_x86_64_rhel4.zip到服务器目录 /soft_ins/nmon,nmon_x86_11f.zip适用于32位系统,nmon_x86_64_rhel4.zip适用于64位系统。以下操作为root用户,到目录/soft_ins/nmon,解压文件,并修改文件属性。#cd /soft_ins/nmon#unzip nmon_x86_11f.zip (如果是64位机器请解压 nmon_x86_
3、64_rhel4.zip)#chmod 755 nmon_x86_rhel4 (如果是64位机器文件名为nmon_x86_64_rhel4)新建文件nmon.sh #vi nmon.sh内容为:#/bin/shcd /soft_ins/nmon./ nmon_x86_64_rhel4 -fT注解 nmon -fT (缺省为s300 c288,即一天时间,每隔5分钟)添加定时程序#crontab -e增加如下行:0 0 * * * /soft_ins/nmon/nmon.sh/dev/null 2& 每天都会在目录/soft_ins/nmon生成一份日志文件,格式如下:hostname_YYMM
4、DD_0000.nmon如:ssr900a02_090121_0000.nmon1、分析工具使用下载日志文件如:hostname_090121_0000.nmon这样的文件到本地,解压nmon_analyser.zip得到nmon analyser v334.xls,就可以导入记录文件进行分析了。参考信息 6.分配置内核启动参数:(可选操作)位置:/boot/grub/grub.conf 的 kernel 行原则:DB服务器:elevator=deadlineWEB 服务器:elevator=as其它情况不需要修改:使用RHEL的默认配置(elevator=cfq)内容:kernel /vml
5、inuz-2.6.18-92.el5 ro root=LABEL=/ elevator=as7.配置内核参数:文件位:etc/sysctl.conf;内容添加:net.ipv4.ip_forward = 0net.ipv4.tcp_syncookies = 1net.ipv4.conf.all.rp_filter = 1net.ipv4.conf.all.accept_source_route = 0net.ipv4.conf.all.accept_redirects = 0net.ipv4.tcp_keepalive_time = 1800net.ipv4.tcp_timestamps =
6、0net.ipv4.tcp_fin_timeout = 30net.ipv4.tcp_window_scaling = 1net.ipv4.tcp_sack = 0net.ipv4.tcp_max_syn_backlog = 1280net.ipv4.tcp_synack_retries = 2net.ipv4.tcp_syn_retries = 3net.ipv4.icmp_echo_ignore_broadcasts = 1net.ipv4.icmp_ignore_bogus_error_responses = 1net.ipv4.ip_local_port_range = 32768 6
7、1000kernel.sysrq = 0kernel.core_uses_pid = 1kernel.ctrl-alt-del = 1验证:#sysctl p“sysctl.new.conf”# Kernel sysctl configuration file for Red Hat Linux# For binary values, 0 is disabled, 1 is enabled. See sysctl(8) and# sysctl.conf(5) for more details.# Controls IP packet forwarding# Controls source ro
8、ute verificationnet.ipv4.conf.default.rp_filter = 1# Do not accept source routingnet.ipv4.conf.default.accept_source_route = 0# Controls the System Request debugging functionality of the kernel# Controls whether core dumps will append the PID to the core filename# Useful for debugging multi-threaded
9、 applications# Controls the use of TCP syncookiesnet.ipv4.tcp_syncookies = 0# Controls the maximum size of a message, in byteskernel.msgmnb = 65536# Controls the default maxmimum size of a mesage queuekernel.msgmax = 65536# Controls the maximum shared segment size, in byteskernel.shmmax = 6871947673
10、6# Controls the maximum number of shared memory segments, in pageskernel.shmall = 4294967296net.ipv4.tcp_tw_reuse = 1net.ipv4.tcp_tw_recycle = 1 net.ipv4.tcp_keepalive_time = 1200net.ipv4.tcp_max_tw_buckets = 5000net.ipv4.tcp_max_syn_backlog = 65536dev_max_backlog = 32768 net.core.somaxconn = 32768
11、net.core.wmem_default = 8388608 net.core.rmem_default = 8388608net.core.rmem_max = 16777216 net.core.wmem_max = 16777216net.ipv4.tcp_timestamps = 0 net.ipv4.tcp_synack_retries = 2 net.ipv4.tcp_syn_retries = 2 net.ipv4.tcp_wmem = 8192 436600 873200 net.ipv4.tcp_rmem = 32768 436600 873200 net.ipv4.tcp
12、_mem = 94500000 91500000 927000008.开启Kdump功能(可选操作)# Uncomment the following two lines for normal desktop: unset SESSION_MANAGER exec /etc/X11/xinit/xinitrc勾选其余kdump后,确定重启计算机就完成了。主要需要考虑文件存放位置,意外宕机后会保存一份和内存大小相当的文件到配置的位置。四.应用配置1.多路径软件:多路径软件选择原则:优先使用存储设备提供的多路径驱动,其次选择HBA卡厂商的驱动,最后可以选择红帽自带动多路径软件。(后面细化)2.多网
13、卡绑定:参考文档中Linux系统中,路径/usr/share/doc/iputils-20020927/README.bonding前提:主机有两块以上网卡绑定模式:balance-rr or 0、active-backup or 1、balance-xor or 2、broadcast or 3、802.3ad or 4、balance-tlb or 5、balance-alb or 6最常用的就是两种模式 balance-rr or 0、active-backup or 1操作指南:首先确认一下系统是否正常Bonding进入系统执行命令rootxtptj2eedev # rpm -qf /
14、sbin/ifupinitscripts-7.93.25.EL-1rootxtptj2eedev # grep ifenslave /sbin/ifup -x /sbin/ifenslave ; then ifenslave $RFLAG $MASTER $DEVICE ifenslave -d $DEV $DEVICE应该可以看到类似如上信息,说明是支持网卡Bonding功能。1备份设备配置信息,位置/etc/sysconfig/network-scripts/ifcfg-ethx ,将其备份到其他位置。(在修改之前作备份是个好习惯)2修改配置文件,例子如下,修改相应参数即可,注意设备名有出
15、入创建/etc/sysconfig/network-scripts/ifcfg-bond0,内容如下DEVICE=bond0IPADDR=10.25.76.170NETMASK=255.255.255.0NETWORK=10.25.76.0BROADCAST=10.25.76.255GATEWAY=10.25.76.254ONBOOT=yesBOOTPROTO=noneUSERCTL=no修改/etc/sysconfig/network-scripts/ifcfg-eth0,内容如下DEVICE=eth0MASTER=bond0SLAVE=yes修改/etc/sysconfig/network
16、-scripts/ifcfg-eth1,内容如下DEVICE=eth1修改/etc/modprobe.conf,在最后添加引用:alias bond0 bondingoptions bond0 miimon=100 mode=active-backup 注意:Bonding模式设置的是模式采用主备模式 3配置完毕。要让配置生效执行命令#modprobe bond0 miimon=100 mode=active-backup#service network restart或者直接重启机器就行了。4检验运行命令,注意红色字体#ifconfigbond0 Link encap:Ethernet HW
17、addr 00:13:72:53:8C:9D inet addr:10.25.76.21 Bcast:10.25.76.255 Mask:255.255.255.0 inet6 addr: fe80:200:ff:fe00:0/64 Scope:Link UP BROADCAST RUNNING MASTER MULTICAST MTU:1500 Metric: RX packets:1948298 errors:2 dropped:0 overruns:0 frame: TX packets:3732268 errors:0 dropped:0 carrier: collisions:0 t
18、xqueuelen:0 RX bytes:170299705 (162.4 MiB) TX bytes:1206117061 (1.1 GiB)eth0 Link encap:213:72ff:fe53:8c9d/64 Scope: UP BROADCAST RUNNING SLAVE MULTICAST MTU:1919499 errors:3696798 errors:1000 163541721 (155.9 MiB) TX bytes:1169827536 (1.0 GiB) Base address:0xecc0 Memory:fe6e0000-fe700000 eth1 Link encap:28799 errors:35470 errors:6757984 (6.4 MiB) TX bytes:36289525 (34.6 MiB)0xdcc0