Adobe FMS Open File

这边有个需求是替换adobe fms 热点文件的时候防止删除正在访问的文件,保证用户请求不中断

但是发现adobe fms open的文件lsof看不到,但是iostat能证实该磁盘是在读取的,很奇怪

尝试用inotify去捕捉事件,可以发现:

[@dg_80_65 inotify-tools-3.14]# inotifywait -m  \
 --timefmt  '%d/%m/%y %H:%M' --format  '%T %e %w%f'  \
/data/video/ssdcached/stream/20100525/57d4f5a6-fc8d-4f8f-b0f7-c00020f6c7ac.mp4
Setting up watches.
Watches established.
01/11/10 18:37 OPEN /data/video/ssdcached/stream/20100525/57d4f5a6-fc8d-4f8f-b0f7-c00020f6c7ac.mp4
01/11/10 18:37 ACCESS /data/video/ssdcached/stream/20100525/57d4f5a6-fc8d-4f8f-b0f7-c00020f6c7ac.mp4
01/11/10 18:37 ACCESS /data/video/ssdcached/stream/20100525/57d4f5a6-fc8d-4f8f-b0f7-c00020f6c7ac.mp4
01/11/10 18:37 ACCESS /data/video/ssdcached/stream/20100525/57d4f5a6-fc8d-4f8f-b0f7-c00020f6c7ac.mp4
01/11/10 18:37 ACCESS /data/video/ssdcached/stream/20100525/57d4f5a6-fc8d-4f8f-b0f7-c00020f6c7ac.mp4
01/11/10 18:37 ACCESS /data/video/ssdcached/stream/20100525/57d4f5a6-fc8d-4f8f-b0f7-c00020f6c7ac.mp4
01/11/10 18:37 CLOSE_NOWRITE,CLOSE /data/video/ssdcached/stream/20100525/57d4f5a6-fc8d-4f8f-b0f7-c00020f6c7ac.mp4
01/11/10 18:37 OPEN /data/video/ssdcached/stream/20100525/57d4f5a6-fc8d-4f8f-b0f7-c00020f6c7ac.mp4
01/11/10 18:37 ACCESS /data/video/ssdcached/stream/20100525/57d4f5a6-fc8d-4f8f-b0f7-c00020f6c7ac.mp4
01/11/10 18:37 ACCESS /data/video/ssdcached/stream/20100525/57d4f5a6-fc8d-4f8f-b0f7-c00020f6c7ac.mp4
01/11/10 18:37 ACCESS /data/video/ssdcached/stream/20100525/57d4f5a6-fc8d-4f8f-b0f7-c00020f6c7ac.mp4
01/11/10 18:37 ACCESS /data/video/ssdcached/stream/20100525/57d4f5a6-fc8d-4f8f-b0f7-c00020f6c7ac.mp4
01/11/10 18:37 ACCESS /data/video/ssdcached/stream/20100525/57d4f5a6-fc8d-4f8f-b0f7-c00020f6c7ac.mp4
01/11/10 18:37 CLOSE_NOWRITE,CLOSE /data/video/ssdcached/stream/20100525/57d4f5a6-fc8d-4f8f-b0f7-c00020f6c7ac.mp4
01/11/10 18:38 OPEN /data/video/ssdcached/stream/20100525/57d4f5a6-fc8d-4f8f-b0f7-c00020f6c7ac.mp4
01/11/10 18:38 ACCESS /data/video/ssdcached/stream/20100525/57d4f5a6-fc8d-4f8f-b0f7-c00020f6c7ac.mp4
01/11/10 18:38 ACCESS /data/video/ssdcached/stream/20100525/57d4f5a6-fc8d-4f8f-b0f7-c00020f6c7ac.mp4
01/11/10 18:38 ACCESS /data/video/ssdcached/stream/20100525/57d4f5a6-fc8d-4f8f-b0f7-c00020f6c7ac.mp4
01/11/10 18:38 ACCESS /data/video/ssdcached/stream/20100525/57d4f5a6-fc8d-4f8f-b0f7-c00020f6c7ac.mp4
01/11/10 18:38 CLOSE_NOWRITE,CLOSE /data/video/ssdcached/stream/20100525/57d4f5a6-fc8d-4f8f-b0f7-c00020f6c7ac.mp4
01/11/10 18:38 OPEN /data/video/ssdcached/stream/20100525/57d4f5a6-fc8d-4f8f-b0f7-c00020f6c7ac.mp4
01/11/10 18:38 ACCESS /data/video/ssdcached/stream/20100525/57d4f5a6-fc8d-4f8f-b0f7-c00020f6c7ac.mp4
01/11/10 18:38 ACCESS /data/video/ssdcached/stream/20100525/57d4f5a6-fc8d-4f8f-b0f7-c00020f6c7ac.mp4
01/11/10 18:38 ACCESS /data/video/ssdcached/stream/20100525/57d4f5a6-fc8d-4f8f-b0f7-c00020f6c7ac.mp4
01/11/10 18:38 ACCESS /data/video/ssdcached/stream/20100525/57d4f5a6-fc8d-4f8f-b0f7-c00020f6c7ac.mp4
01/11/10 18:38 CLOSE_NOWRITE,CLOSE /data/video/ssdcached/stream/20100525/57d4f5a6-fc8d-4f8f-b0f7-c00020f6c7ac.mp4

所有文件迅速的打开,读取,关闭,所以lsof捕捉不到

adobe的文档是这么说的:

When a stream is requested from the server, segments of the stream are stored in a cache on the server. As long as the cache has not reached capacity, the server places segments in the cache. Each time a stream attempts to access a segment, the server checks the cache. If the segment is available, the server gives the stream a reference to the segment for playback. If the segment is not available, the server retrieves the segment from its source, inserts it into the cache, and returns a reference to that segment to the stream.
When the cache is full, the server removes unused segments, starting with the least recently used. After removing all unused segments, if there still isn’t enough room for a new segment, the server notifies the client that the stream is not available and makes an entry in the core log file.

When a stream is requested from the server, segments of the stream are stored in a cache on the server. As long as the cache has not reached capacity, the server places segments in the cache. Each time a stream attempts to access a segment, the server checks the cache. If the segment is available, the server gives the stream a reference to the segment for playback. If the segment is not available, the server retrieves the segment from its source, inserts it into the cache, and returns a reference to that segment to the stream.
When the cache is full, the server removes unused segments, starting with the least recently used. After removing all unused segments, if there still isn’t enough room for a new segment, the server notifies the client that the stream is not available and makes an entry in the core log file.

大意是说fms是从缓存区取文件的,如果不存在该文件的这一部分,就会从源文件读取,放入缓存区,再给用户

因此,比较可以接受的办法是删除文件之前判断下access time的时间戳

stat -c %X /data/video/ssdcached/stream/20100525/57d4f5a6-fc8d-4f8f-b0f7-c00020f6c7ac.mp4

双网卡bond 配置

最近公司的服务器配置做了更改,LVS+双公网策略路由出了问题,所以干脆改成bonding来做

bonding的各种模式:

按照卢瑟同学的介绍,bonding有7种模式:

Mode=0(balance-rr) 表示负载分担round-robin,和交换机的聚合强制不协商的方式配合。
Mode=1(active-backup) 表示主备模式,只有一块网卡是active,另外一块是备的standby
这时如果交换机配的是捆绑,将不能正常工作,因为交换机往两块网卡发包,有一半包是丢弃的。
Mode=2(balance-xor) 表示XOR Hash负载分担,和交换机的聚合强制不协商方式配合。(需要xmit_hash_policy)
Mode=3(broadcast) 表示所有包从所有interface发出,这个不均衡,只有冗余机制...和交换机的聚合强制不协商方式配合。
Mode=4(802.3ad) 表示支持802.3ad协议,和交换机的聚合LACP方式配合(需要xmit_hash_policy)
Mode=5(balance-tlb) 是根据每个slave的负载情况选择slave进行发送,接收时使用当前轮到的slave
Mode=6(balance-alb) 在5的tlb基础上增加了rlb。
5和6不需要交换机端的设置,网卡能自动聚合。4需要支持802.3ad。0,2和3理论上需要静态聚合方式
但实测中0可以通过mac地址欺骗的方式在交换机不设置的情况下不太均衡地进行接收。

决定使用最简单的模式6来做

bonding的配置

modprobe.conf

在这个文件加入

alias bond0 bonding
options bond0 miimon=100 mode=5

网卡配置文件修改

ifcfg-eth1

DEVICE=eth1
USERCTL=no
ONBOOT=yes
MASTER=bond0
SLAVE=yes
BOOTPROTO=none

ifcfg-eth2

DEVICE=eth2
USERCTL=no
ONBOOT=yes
MASTER=bond0
SLAVE=yes
BOOTPROTO=none

ifcfg-bond0

DEVICE=bond0
IPADDR="Your IP Adress"
NETMASK="Your NetMask"
ONBOOT=yes
BOOTPROTO=none
USERCTL=no

变更修改

/etc/init.d/network stop;modprobe -r bonding;/etc/init.d/network start

附录:转发方式

layer2 (1): (source MAC XOR destination MAC) modulo slave count
layer2+3 (2): (((source IP XOR dest IP) AND 0xffff) XOR ( source MAC XOR destination MAC )) modulo slave count
layer3+4 (3): ((source port XOR dest port) XOR ((source IP XOR dest IP) AND 0xffff) modulo slave count
为了能更加均衡,可采用 mac ip 异或 哈希:xmit_hash_policy=2

Dell Drac6 虚拟介质安装系统

换了Dell的R510服务器,联通远程管理器后发现虚拟介质无法映射,一直提示“虚拟介质分离或所选虚拟磁盘驱动器的虚拟介质重定向已由另一用户使用”

一番折腾后找到解决办法:

1.在管理界面-控制台/介质-虚拟介质:设置附加或者自动附加

2.这个时候应该可以附加iso了

3.在控制台”设置-第一个引导设备”选择虚拟介质,然后重启机器就可以从iso引导系统安装了