如何区分相同型号的板载网卡和非板载网卡¶ 首先查看主板信息¶ 以公司1.82服务器为例(下同) [iyunv@noded2 ~]# dmidecode |grep -i -A 1'system info' System Information Manufacturer: Supermicro 可以看到主板的生产商为Supermicro. 查看网卡信息¶ [iyunv@noded2 ~]# lspci -v |grep -A 1 -i Eth 04:00.0 Ethernet controller: IntelCorporation 82599EB 10-Gigabit SFI/SFP+ Network Connection (rev 01) Subsystem: Intel Corporation Ethernet Server Adapter X520-2 Flags: bus master, fast devsel, latency 0, IRQ 24 -- 04:00.1 Ethernet controller: IntelCorporation 82599EB 10-Gigabit SFI/SFP+ Network Connection (rev 01) Subsystem: Intel Corporation Ethernet Server Adapter X520-2 Flags: bus master, fast devsel, latency 0, IRQ 34 -- 06:00.0 Ethernet controller: IntelCorporation 82576 Gigabit Network Connection (rev 01) Subsystem: Super Micro Computer Inc Device 10c9 -- 06:00.1 Ethernet controller: IntelCorporation 82576 Gigabit Network Connection (rev 01) Subsystem: Super Micro Computer Inc Device 10c9 从lspci的输出结果可以看到06:00.1和06:00.0对应网卡的subsystem为super Micro即和主板的信息一致,可判断为板载网卡 接着查看此两个网卡的名称 [iyunv@noded2 ~]# ls $(find /sys/devices/-name "*06:00.1*")/net eth1 [iyunv@noded2 ~]# ls $(find /sys/devices/-name "*06:00.0*")/net eth0 载入中... 首先用ping命令来查看网卡时候会出现丢包:
ping ip -i 0.01
如果出现丢包则用如下方式处理:
用ifconfig ethX |greperrors 来查看网卡是否有crc校验失败的包,如果有则重新插拔网线或网卡.
如果还出现丢包则按如下方式处理:
根据之前的判断,82576丢包是由于intel igb驱动造成的,通过修改网卡的dma buffer可以解决此问题,命令行如下: ethtool -G ethX rx 2048 ethtool -G ethX tx 2048 需要将以上指令写到rc.local文件中. echo ethtool -G ethX rx 2048 >> /etc/rc.local echo ethtool -G ethX tx 2048 >> /etc/rc.local 描述 Using NTP on a Private Network
April 3, 2008 At work, I’m in charge of 20 individual build systems for one of our largersoftware project (18 Linux systems and 2 Windows systems). Every machine isconnected to a private network that cannot see the outside world. As you mightexpect, the occasional “clock skew” warning would be thrown by gcc, since someof the source files had date stamps in the future. To fix this, I set out tolearn about configuring NTP on a private network. As is typical of the Linuxworld, there was little useful documentation to be found. After gleaning littlebits of information from a number of sources, I figured out how to do it, andI’m writing it down for everybody’s benefit. Creating the NTP Master Server Our first step is to create a ‘server’ machine from which all of our othermachines will get the time. In this tutorial, our master machine is a Linuxbox. Here’s how to set things up: Step 1: Edit ntp.conf
The first course of action is to edit the ntp.conf file in the /etc directory.Place the following lines in this file, removing any others that may exist (youmay want to back up your existing ntp.conf file just in case): 1.Use the local clock
server 127.127.1.0 prefer
fudge 127.127.1.0 stratum 10
driftfile /var/lib/ntp/drift
broadcastdelay 0.008 1.Give localhost fullaccess rights
restrict 127.0.0.1 1.Give machines on ournetwork access to query us
restrict 192.1.1.0 mask 255.255.255.0 nomodify notrap You’ll want to replace the highlighted sections with theprivate network address range that should be allowed to query this server,along with the corresponding mask, respectively. In this example, any machineon the 192.1.1.xxx network can query the master server for time updates.
Step 2: Restart the NTP daemon
Once the above changes have beenmade, the NTP daemon needs to be restarted. How to do this unfortunatelydiffers among Linux distributions. Here are a few commands that I figured outfor the OS families I care about: RedHat: service ntpd restart
SLES 8/9: /etc/init.d/xntpdrestart
SLES 10: /etc/init.d/ntp restart
Step 3: Configure NTP to start on reboot
Perhaps the most important step in this process is configuring the NTP daemonto start up on a reboot. Here’s how to do it: RedHat: chkconfig ntpd on
SLES 8/9: chkconfig xntpd on
SLES 10: chkconfig ntp on
Configuring the Client Machines Step 1: Edit ntp.conf
Client machines must also have their ntp.conf file updated (again, in the /etcdirectory). Place the following lines in the configuration file: 1.Point to our network'smaster time server
server 192.1.1.100 restrict default ignore
restrict 127.0.0.1
restrict 192.1.1.100 mask255.255.255.255 nomodify notrap noquery driftfile /var/lib/ntp/drift Both of the highlighted sections above should point tothe master server (in this case, with an IP address of 192.1.1.100).
Step 2: Stop running NTP daemons
Use one of the following to stop anyrunning NTP daemons: RedHat: service ntpd stop
SLES 8/9: /etc/init.d/xntpd stop
SLES 10: /etc/init.d/ntp stop
Step 3: Force an update
We must force the client to update now, in case the offset is larger than 1000seconds (the largest offset NTP allows). To do this, issue the followingcommand: ntpdate -u 192.1.1.100 Again, replace the highlighted section with the IPaddress of the master server. Note that you may need to do this forced updatetwo or three times to make sure things are synchronized.
Step 4: Start the NTP daemon
Now that we’ve synced the client, weshould restart the daemon: RedHat: service ntpd start
SLES 8/9: /etc/init.d/xntpd start
SLES 10: /etc/init.d/ntp start
Step 5: Configure NTP to start on reboot
Finally, we need to make sure the daemon starts up at boot time (like we didfor the server): RedHat: chkconfig ntpd on
SLES 8/9: chkconfig xntpd on
SLES 10: chkconfig ntp on
Once you’ve set this up, all the client machines will keep their clockssynchronized with the master. If you update the master server time, the clientsshould follow (as long as the update isn’t larger than 1000 seconds). I believeyou can even point Windows systems to the master, though I have yet to trythat. linux下监控软件主要有:Nagios、Cacti、Zabbix、Ganglia等,下面说下各自软件的优缺点; Nagios监控软件
Nagios是一款开源的免费网络监视工具,能有效监控Windows、Linux和Unix的主机状态,交换机路由器等网络设置,打印机等。在系统或服务状态异常时发出邮件或短信报警第一时间通知网站运维人员,在状态恢复后发出正常的邮件或短信通知。
优点:支持自定义插件,扩展方便,不需要数据库支持。
缺点:中文支持不好,画图效果不是很好,没有多网段监控;(多网段问题应该可以写插件) Cacti监控软件
Cacti是一套基于PHP,MySQL,SNMP及RRDTool开发的网络流量监测图形分析工具。
优点:支持自定义插件,扩展方便,绘图效果好,支持中文。
缺点:需要有数据库支持,安装繁琐。 Ganglia监控软件
Ganglia主要用于集群监控,主要是用来监控系统性能,如:cpu 、mem、硬盘利用率, I/O负载、网络流量情况等,通过曲线很容易见到每个节点的工作状态,对合理调整、分配系统资源,提高系统整体性能起到重要作用。
优点:主要用于集群监控,可以汇总集群的数据;
缺点:没有多网段监控,没有报警机制; Zabbix监控软件
zabbix是一个基于WEB界面的提供分布式系统监视以及网络监视功能的企业级的开源解决方案。
优点:支持自定义插件,扩展方便,报警机制明确,支持中文。
缺点:需要数据库支持; 下面是根据浩存和麒云的功能,需要监控的项目,
1.cpu负载情况;
2.硬盘式用情况;
3.内存使用情况;
4.网络情况(各网段是否可通);
5.浩存和麒云WEB端口 9500和9600;
6.MDS服务、CDS服务、YISCSI服务;
7.虚拟机各项进程
|