Linux FTP 备份服务器部署文档

客户需求部署
4台网站服务器 1台备份服务器

需求 : 集中备份 每天/每周/每月的网站数据至独立的备份服务器

网站服务器 均采用cPanel 支持周期备份

完成后测试了一下 速度还可以 100M端口跑满

部署安装
# 编译安装ProFTPD

#设置开机启动
chkconfig proftpd on
#启动
service proftpd start

#添加备份的用户组和用户 Continue reading “Linux FTP 备份服务器部署文档”

相关:

  • pcie_aspm=off
  • localArchives
  • tune4fs rpm
  • tune4fs
  • startArchives-
  • Kernel Archives
  • LinuxFTP
  • kernerl ko 安装包
  • KernelArchives-
  • tune4fs 安装

自动Kill使用太多处理器资源的进程

#!/bin/bash

# March-13-2006
# CPUuse trigger script by Noel
#
# bash code to watch a running program’s CPU usage.
# if it’s above a set value, it will auto send an email.
# You will need to set a Cron job to run this script every xx minutes
#
# Set some needed things:
#
processToWatch=”convert” # in my case I need to watch convert
emailAddress=”root@host” # this is my main emailaddress
triggerValue=90 # if the CPU use is above 90% send an email. DO NOT USE a DOT or COMMA!
tempFileName=tmp-cpu # some name of the temp file for the ps, grep data Continue reading “自动Kill使用太多处理器资源的进程”

相关:

  • aboveArchives-
  • processtowatchArchives-
  • DirectAdmin插件
  • DirectAdmin 链接数据库
  • directadmin 配置varnish
  • directadmin 内网
  • directadmin 使用1 4
  • Directadmin varnish
  • apache error AH01215
  • whmcs pptp

Linux Route 路由表 Linux路由命令使用 操作手册!

用途说明
route命令用于显示和操作IP路由表(show / manipulate the IP routing table)。要实现两个不同的子网之间的通信,需要一台连接两个网络的路由器,或者同时位于两个网络的网关来实现。在Linux系统中,设置路由通常是为了解决以下问题:该Linux系统在一个局域网中,局域网中有一个网关,能够让机器访问Internet,那么就需要将这台机器的IP地址设置为Linux机器的默认路由。要注意的是,直接在命令行下执行route命令来添加路由,不会永久保存,当网卡重启或者机器重启之后,该路由就失效了;可以在/etc/rc.local中添加route命令来保证该路由设置永久有效。本文中的例子中会验证这一点。

常用参数
格式:route
格式:/sbin/route
用于打印路由表(display the current routing table)。
在非root用户使用时需要使用完整路径执行route命令。

格式:route -n
格式:/sbin/route -n
用于打印路由表,加上-n参数就是在输出的信息中不打印主机名而直接打印ip地址。像netstat命令也有此参数。

格式:route add default gw {IP-ADDRESS} {INTERFACE-NAME}
用于设置默认路由(adds a default route, which will be used if no other route matches),其中,
参数{IP-ADDRESS): 用于指定路由器(网关)的IP地址(Specify router IP address);
参数{INTERFACE-NAME}: 用于指定接口名称,如eth0(Specify interface name such as eth0)。使用/sbin/ifconfig -a可以显示所有接口信息。
man route 写道
route add default gw mango-gw
adds a default route (which will be used if no other route matches). All packets using this route will
be gatewayed through “mango-gw”. The device which will actually be used for that route depends on how we
can reach “mango-gw” – the static route to “mango-gw” will have to be set up before.

格式:route add -net {NETWORK-ADDRESS} netmask {NETMASK} dev {INTERFACE-NAME}
添加到指定网络的路由规则,其中
参数{NETWORK-ADDRESS}: 用于指定网络地址
参数{NETMASK}: 用于指定子网掩码
参数{INTERFACE-NAME}: 用于指定接口名称,如eth0。
man route 写道
route add -net 192.56.76.0 netmask 255.255.255.0 dev eth0
adds a route to the network 192.56.76.x via “eth0”. The Class C netmask modifier is not really necessary
here because 192.* is a Class C IP address. The word “dev” can be omitted here.

route add -net 224.0.0.0 netmask 240.0.0.0 dev eth0
This is an obscure one documented so people know how to do it. This sets all of the class D (multicast)
IP routes to go via “eth0”. This is the correct normal configuration line with a multicasting kernel.

格式:route add -net {NETWORK-ADDRESS} netmask {NETMASK} reject
设置到指定网络为不可达,避免在连接到这个网络的地址时程序过长时间的等待,直接就知道该网络不可达。
man route 写道
route add -net 10.0.0.0 netmask 255.0.0.0 reject
This installs a rejecting route for the private network “10.x.x.x.”

格式:route del -net {NETWORK-ADDRESS} netmask {NETMASK} dev {INTERFACE-NAME}
格式:route del -net {NETWORK-ADDRESS} netmask {NETMASK} reject
用于删除路由设置。参数指定的方式与route add相似。

route命令输出的路由表字段含义如下:
Destination 目标
The destination network or destination host. 目标网络或目标主机。

Gateway 网关
The gateway address or ‘*’ if none set. 网关地址,如果没有就显示星号。

Genmask 网络掩码
The netmask for the destination net; ‘255.255.255.255’ for a
host destination and ‘0.0.0.0’ for the default route.

Flags Possible flags include 标志,常用的是U和G。
U (route is up) 路由启用
H (target is a host) 目标是主机
G (use gateway) 使用网关
R (reinstate route for dynamic routing)
D (dynamically installed by daemon or redirect)
M (modified from routing daemon or redirect)
A (installed by addrconf)
C (cache entry)
! (reject route)

Metric 距离、跳数。暂无用。
The ‘distance’ to the target (usually counted in hops). It is
not used by recent kernels, but may be needed by routing dae-
mons.

Ref 不用管,恒为0。
Number of references to this route. (Not used in the Linux ker-
nel.)

Use 该路由被使用的次数,可以粗略估计通向指定网络地址的网络流量。
Count of lookups for the route. Depending on the use of -F and
-C this will be either route cache misses (-F) or hits (-C).

Iface 接口,即eth0,eth0等网络接口名
Interface to which packets for this route will be sent.

使用示例
示例一 打印当前路由表(root用户)
[root@jfht ~]# route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
211.103.28.0 * 255.255.255.224 U 0 0 0 eth0
192.168.1.0 * 255.255.255.0 U 0 0 0 eth1
169.254.0.0 * 255.255.0.0 U 0 0 0 eth1
default 211.103.28.1 0.0.0.0 UG 0 0 0 eth0
[root@jfht ~]# /sbin/route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
211.103.28.0 * 255.255.255.224 U 0 0 0 eth0
192.168.1.0 * 255.255.255.0 U 0 0 0 eth1
169.254.0.0 * 255.255.0.0 U 0 0 0 eth1
default 211.103.28.1 0.0.0.0 UG 0 0 0 eth0
[root@jfht ~]# route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
211.103.28.0 0.0.0.0 255.255.255.224 U 0 0 0 eth0
192.168.1.0 0.0.0.0 255.255.255.0 U 0 0 0 eth1
169.254.0.0 0.0.0.0 255.255.0.0 U 0 0 0 eth1
0.0.0.0 211.103.28.1 0.0.0.0 UG 0 0 0 eth0
[root@jfht ~]# /sbin/route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
211.103.28.0 0.0.0.0 255.255.255.224 U 0 0 0 eth0
192.168.1.0 0.0.0.0 255.255.255.0 U 0 0 0 eth1
169.254.0.0 0.0.0.0 255.255.0.0 U 0 0 0 eth1
0.0.0.0 211.103.28.1 0.0.0.0 UG 0 0 0 eth0
[root@jfht ~]#

示例二 打印当前路由表(非root用户)
[web@hnweb1 ~]$ route
-bash: route: command not found
[web@hnweb1 ~]$ /sbin/route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
10.66.10.0 * 255.255.255.128 U 0 0 0 eth0
192.130.12.0 10.66.10.1 255.255.255.0 UG 0 0 0 eth0
10.0.0.0 * 255.255.255.0 U 0 0 0 eth1
10.66.0.0 10.66.10.1 255.255.0.0 UG 0 0 0 eth0
134.161.0.0 10.66.10.1 255.255.0.0 UG 0 0 0 eth0
10.20.0.0 10.66.10.1 255.255.0.0 UG 0 0 0 eth0
169.254.0.0 * 255.255.0.0 U 0 0 0 eth1
172.224.0.0 10.66.10.1 255.255.0.0 UG 0 0 0 eth0
default 10.66.10.22 0.0.0.0 UG 0 0 0 eth0
[web@hnweb1 ~]$ route -n
-bash: route: command not found
[web@hnweb1 ~]$ /sbin/route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
10.66.10.0 0.0.0.0 255.255.255.128 U 0 0 0 eth0
192.130.12.0 10.66.10.1 255.255.255.0 UG 0 0 0 eth0
10.0.0.0 0.0.0.0 255.255.255.0 U 0 0 0 eth1
10.66.0.0 10.66.10.1 255.255.0.0 UG 0 0 0 eth0
134.161.0.0 10.66.10.1 255.255.0.0 UG 0 0 0 eth0
10.20.0.0 10.66.10.1 255.255.0.0 UG 0 0 0 eth0
169.254.0.0 0.0.0.0 255.255.0.0 U 0 0 0 eth1
172.224.0.0 10.66.10.1 255.255.0.0 UG 0 0 0 eth0
0.0.0.0 10.66.10.22 0.0.0.0 UG 0 0 0 eth0
[web@hnweb1 ~]$

示例三 设置到某网络的路由的例子
下面的例子 来自一个实际的服务器配置。 route命令写在了/etc/rc.local中,这样就设置了一条永久路由。

[root@jf07 root]# grep route /etc/rc.local
route add -net 10.0.0.0/8 gw 10.33.149.1 dev eth1
[root@jf07 root]# route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
10.32.181.182 10.33.149.1 255.255.255.255 UGH 0 0 0 eth1
10.33.136.135 10.33.149.1 255.255.255.255 UGH 0 0 0 eth1
10.32.208.13 10.33.149.1 255.255.255.255 UGH 0 0 0 eth1
10.33.149.0 * 255.255.255.128 U 0 0 0 eth1
192.168.1.0 * 255.255.255.0 U 0 0 0 eth0
169.254.0.0 * 255.255.0.0 U 0 0 0 eth1
10.0.0.0 10.33.149.1 255.0.0.0 UG 0 0 0 eth1
default 192.168.1.254 0.0.0.0 UG 0 0 0 eth0
[root@jf07 root]#

示例四 添加拒绝路由的测试
[root@jfht ~]# route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
211.103.28.0 * 255.255.255.224 U 0 0 0 eth0
192.168.1.0 * 255.255.255.0 U 0 0 0 eth1
169.254.0.0 * 255.255.0.0 U 0 0 0 eth1
default 211.103.28.1 0.0.0.0 UG 0 0 0 eth0
[root@jfht ~]# ping 10.33.11.12
PING 10.33.11.12 (10.33.11.12) 56(84) bytes of data.
Ctrl+C
— 10.33.11.12 ping statistics —
21 packets transmitted, 0 received, 100% packet loss, time 19999ms

[root@jfht ~]# route add -net 10.0.0.0 netmask 255.0.0.0 reject
[root@jfht ~]# route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
211.103.28.0 * 255.255.255.224 U 0 0 0 eth0
192.168.1.0 * 255.255.255.0 U 0 0 0 eth1
169.254.0.0 * 255.255.0.0 U 0 0 0 eth1
10.0.0.0 – 255.0.0.0 ! 0 – 0 –
default 211.103.28.1 0.0.0.0 UG 0 0 0 eth0
[root@jfht ~]# ping 10.33.11.12
connect: Network is unreachable
[root@jfht ~]#

示例五 设置路由之后重启机器的测试
[root@node34 root]# route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.227.0 * 255.255.255.0 U 0 0 0 eth0
169.254.0.0 * 255.255.0.0 U 0 0 0 eth0
default 192.168.227.2 0.0.0.0 UG 0 0 0 eth0
[root@node34 root]# route add -net 10.0.0.0 netmask 255.0.0.0 reject
[root@node34 root]# route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.227.0 * 255.255.255.0 U 0 0 0 eth0
169.254.0.0 * 255.255.0.0 U 0 0 0 eth0
10.0.0.0 – 255.0.0.0 ! 0 – 0 –
default 192.168.227.2 0.0.0.0 UG 0 0 0 eth0
[root@node34 root]# reboot

Broadcast message from root (pts/0) (Thu Jul 7 05:31:26 2011):

The system is going down for reboot NOW!
[root@node34 root]#

Last login: Thu Jul 7 05:30:50 2011 from 192.168.227.1
[root@node34 root]# route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.227.0 * 255.255.255.0 U 0 0 0 eth0
169.254.0.0 * 255.255.0.0 U 0 0 0 eth0
default 192.168.227.2 0.0.0.0 UG 0 0 0 eth0
[root@node34 root]#

上面的测试表明route设置的路由在机器重启之后就消失了。

示例六 将route命令添加到/etc/rc.local来设置永久路由的测试
先用vi在/etc/rc.local后面添加route命令。

[root@node34 root]# tail /etc/rc.local
#
# This script will be executed *after* all the other init scripts.
# You can put your own initialization stuff in here if you don’t
# want to do the full Sys V style init stuff.

touch /var/lock/subsys/local

# 2011.07.15 add permanent route test
route add -net 10.0.0.0 netmask 255.0.0.0 reject

[root@node34 root]# route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.227.0 * 255.255.255.0 U 0 0 0 eth0
169.254.0.0 * 255.255.0.0 U 0 0 0 eth0
default 192.168.227.2 0.0.0.0 UG 0 0 0 eth0
[root@node34 root]# reboot

Broadcast message from root (pts/0) (Fri Jul 15 14:43:44 2011):

The system is going down for reboot NOW!
[root@node34 root]#

Last login: Fri Jul 15 14:40:22 2011 from 192.168.227.1
[root@node34 root]# route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.227.0 * 255.255.255.0 U 0 0 0 eth0
169.254.0.0 * 255.255.0.0 U 0 0 0 eth0
10.0.0.0 – 255.0.0.0 ! 0 – 0 –
default 192.168.227.2 0.0.0.0 UG 0 0 0 eth0
[root@node34 root]#

示例七 删除路由的测试
删除路由的时候只需将route add改成route del,其他参数类似。如果报“无效的参数”或“没有那个进程”,可能是因为提供的参数不够。

[root@node34 root]# route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.227.0 * 255.255.255.0 U 0 0 0 eth0
169.254.0.0 * 255.255.0.0 U 0 0 0 eth0
10.0.0.0 – 255.0.0.0 ! 0 – 0 –
default 192.168.227.2 0.0.0.0 UG 0 0 0 eth0
[root@node34 root]#
[root@node34 root]# route del -net 10.0.0.0
SIOCDELRT: 无效的参数
[root@node34 root]# route del -net 10.0.0.0 netmask 255.0.0.0
SIOCDELRT: 没有那个进程
[root@node34 root]#
[root@node34 root]# route del -net 10.0.0.0 netmask 255.0.0.0 reject
[root@node34 root]#
[root@node34 root]# route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.227.0 * 255.255.255.0 U 0 0 0 eth0
169.254.0.0 * 255.255.0.0 U 0 0 0 eth0
default 192.168.227.2 0.0.0.0 UG 0 0 0 eth0
[root@node34 root]#

Intel e1000e驱动的bug Intel 82574L(MSI/MSI-X interrupts issue)

老实说这个解决了我还是不知道是什么触发的

主要的现象表现为
1. 无故断网 无论你是network restart 还是ifup eth0 都不能启动网络
2. 断网后重新启动才能恢复网络 只能重新启动

尝试使用 ethtool 打印出来的信息 也没错误
联系机房技术讨论 无果
最后还是看了外部的驱动
有2.0.1版本 安装后解决
之前机房机房默认安装的内核没升级 就出现过一次
我升级了内核 先说我内核问题
说安装2.0.0
然后就安装吧 结果大概过了12个小时 又出了这个问题
看了有个2.0.1的 才出来
安装了一下 现在好像无问题了
现在等运行1个星期看结果
如果还出现 只能联系机房更换系统尝试下了

之前以为电源管理的问题
尝试关闭了高级电源管理
pcie_aspm=off e1000e.IntMode=1,1 e1000e.InterruptThrottleRate=10000,10000 acpi=off
还是故障 加载这个内核启动后 重新启动系统都不行
只能强制关闭电源后重新启动

另外还有个 kmod-e1000e 驱动 是由 Elrepo发布的
不知道有无用处 未测试

Import the public key:
rpm –import //elrepo.org/RPM-GPG-KEY-elrepo.org

To install ELRepo for RHEL-5, SL-5 or CentOS-5:
rpm -Uvh //elrepo.org/elrepo-release-5-3.el5.elrepo.noarch.rpm

To install ELRepo for RHEL-6, SL-6 or CentOS-6:
rpm -Uvh //elrepo.org/elrepo-release-6-4.el6.elrepo.noarch.rpm

Before installing the new driver, let’s see our old one:
[root@doxer sites]# lspci |grep -i ethernet
02:00.0 Ethernet controller: Intel Corporation 82574L Gigabit Network Connection
03:00.0 Ethernet controller: Intel Corporation 82574L Gigabit Network Connection

[root@doxer modprobe.d]# lsmod|grep e100
e1000e 219500 0

[root@doxer modprobe.d]# modinfo e1000e
filename: /lib/modules/2.6.32-220.7.1.el6.x86_64/kernel/drivers/net/e1000e/e1000e.ko
version: 1.4.4-k
license: GPL
description: Intel(R) PRO/1000 Network Driver
author: Intel Corporation, srcversion: 6BD7BCA22E0864D9C8B756A

Now let’s install the new kmod-e1000e offered by elrepo:
[root@doxer yum.repos.d]# yum list|grep -i e1000
kmod-e1000.x86_64 8.0.35-1.el6.elrepo elrepo
kmod-e1000e.x86_64 1.9.5-1.el6.elrepo elrepo

[root@doxer yum.repos.d]# yum -y install kmod-e1000e.x86_64

After installation, reboot your machine, and you’ll find driver updated:
[root@doxer ~]# modinfo e1000e
filename: /lib/modules/2.6.32-220.7.1.el6.x86_64/weak-updates/e1000e/e1000e.ko
version: 1.9.5-NAPI
license: GPL
description: Intel(R) PRO/1000 Network Driver
author: Intel Corporation, srcversion: 16A9E37B9207620F5453F5E

[root@doxer ~]# lsmod|grep e100
e1000e 229197 0

相关:

  • intel 82574l 驱动
  • E1000e驱动异常
  • 82574l centos
  • e1000e驱动
  • Intele1000e
  • IntMode=1 1 e1000e
  • pcie

Posts navigation

12