设为首页收藏本站

 找回密码
 注册论坛

QQ登录

只需一步,快速开始

用百度帐号登录

只需两步,快速登录

新浪微博账号登陆

只需一步,快速开始

搜索
查看: 226|回复: 1

记录一次Linux kangle磁盘缓存目录软链接的方法 分配到ssd固态硬盘和机械硬盘多个目录

[复制链接]

签到天数: 2542 天

[LV.Master]伴坛终老

 成长值: 22450
发表于 2018/6/6 20:53 | 显示全部楼层 |阅读模式 |Google Chrome 67.0.3396.62|Windows 10
天涯海角搜一下: 百度 谷歌 360 搜狗 有道 雅虎 必应 即刻
需求,,服务器系统盘120G固态硬盘
数据盘data目录1T机械盘

单独存ssd固态硬盘,,感觉机械盘容量浪费了,用机械感觉固态也浪费了,,所以,就有了这个教程
1.jpg

2.jpg


其实最好的方法还是lvm之类,,或者购买更大的固态硬盘23333,不过我这台服务器默认是sda模式,,那就算了,软链接吧,有个弊端就是控制不住容量可能导致机械盘100%占用

[root@localhost ~]# df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/sda2       110G   99G  5.5G  95% /
tmpfs            16G   32K   16G   1% /dev/shm
/dev/sda1       190M   27M  154M  15% /boot
/dev/sda3       283M  2.1M  266M   1% /home
/dev/sdb        908G  167G  694G  20% /data
[root@localhost ~]#

参考:http://bbs.itzmx.com/thread-86768-1-1.html

得知一共128个一级目录

所以先停止kangle:
/vhs/kangle/bin/kangle -q
killall -9 kangle

创建目录
mkdir -p /data/cache/kangle

复制数据: (一共128个目录,这里拷贝98个目录去data,也就是四分之三左右到机械)
cp -r /var/cache/kangle/0 /var/cache/kangle/1 /var/cache/kangle/2 /var/cache/kangle/3 /var/cache/kangle/4 /var/cache/kangle/5 /var/cache/kangle/6 /var/cache/kangle/7 /var/cache/kangle/8 /var/cache/kangle/9 /var/cache/kangle/10 /var/cache/kangle/11 /var/cache/kangle/12 /var/cache/kangle/13 /var/cache/kangle/14 /var/cache/kangle/15 /var/cache/kangle/16 /var/cache/kangle/17 /var/cache/kangle/18 /var/cache/kangle/19 /var/cache/kangle/20 /var/cache/kangle/21 /var/cache/kangle/22 /var/cache/kangle/23 /var/cache/kangle/24 /var/cache/kangle/25 /var/cache/kangle/26 /var/cache/kangle/27 /var/cache/kangle/28 /var/cache/kangle/29 /var/cache/kangle/30 /var/cache/kangle/31 /var/cache/kangle/32 /var/cache/kangle/33 /var/cache/kangle/34 /var/cache/kangle/35 /var/cache/kangle/36 /var/cache/kangle/37 /var/cache/kangle/38 /var/cache/kangle/39 /var/cache/kangle/40 /var/cache/kangle/41 /var/cache/kangle/42 /var/cache/kangle/43 /var/cache/kangle/44 /var/cache/kangle/45 /var/cache/kangle/46 /var/cache/kangle/47 /var/cache/kangle/48 /var/cache/kangle/49 /var/cache/kangle/50 /var/cache/kangle/51 /var/cache/kangle/52 /var/cache/kangle/53 /var/cache/kangle/54 /var/cache/kangle/55 /var/cache/kangle/56 /var/cache/kangle/57 /var/cache/kangle/58 /var/cache/kangle/59 /var/cache/kangle/60 /var/cache/kangle/61 /var/cache/kangle/62 /var/cache/kangle/63 /var/cache/kangle/64 /var/cache/kangle/65 /var/cache/kangle/66 /var/cache/kangle/67 /var/cache/kangle/68 /var/cache/kangle/69 /var/cache/kangle/70 /var/cache/kangle/71 /var/cache/kangle/72 /var/cache/kangle/73 /var/cache/kangle/74 /var/cache/kangle/75 /var/cache/kangle/76 /var/cache/kangle/77 /var/cache/kangle/78 /var/cache/kangle/79 /var/cache/kangle/1a /var/cache/kangle/1b /var/cache/kangle/1c /var/cache/kangle/1d /var/cache/kangle/1e /var/cache/kangle/1f /var/cache/kangle/2a /var/cache/kangle/2b /var/cache/kangle/2c /var/cache/kangle/2d /var/cache/kangle/2e /var/cache/kangle/2f /var/cache/kangle/3a /var/cache/kangle/3b /var/cache/kangle/3c /var/cache/kangle/3d /var/cache/kangle/3e /var/cache/kangle/3f /data/cache/kangle

删除原有的缓存目录:
rm -rf /var/cache/kangle/0 /var/cache/kangle/1 /var/cache/kangle/2 /var/cache/kangle/3 /var/cache/kangle/4 /var/cache/kangle/5 /var/cache/kangle/6 /var/cache/kangle/7 /var/cache/kangle/8 /var/cache/kangle/9 /var/cache/kangle/10 /var/cache/kangle/11 /var/cache/kangle/12 /var/cache/kangle/13 /var/cache/kangle/14 /var/cache/kangle/15 /var/cache/kangle/16 /var/cache/kangle/17 /var/cache/kangle/18 /var/cache/kangle/19 /var/cache/kangle/20 /var/cache/kangle/21 /var/cache/kangle/22 /var/cache/kangle/23 /var/cache/kangle/24 /var/cache/kangle/25 /var/cache/kangle/26 /var/cache/kangle/27 /var/cache/kangle/28 /var/cache/kangle/29 /var/cache/kangle/30 /var/cache/kangle/31 /var/cache/kangle/32 /var/cache/kangle/33 /var/cache/kangle/34 /var/cache/kangle/35 /var/cache/kangle/36 /var/cache/kangle/37 /var/cache/kangle/38 /var/cache/kangle/39 /var/cache/kangle/40 /var/cache/kangle/41 /var/cache/kangle/42 /var/cache/kangle/43 /var/cache/kangle/44 /var/cache/kangle/45 /var/cache/kangle/46 /var/cache/kangle/47 /var/cache/kangle/48 /var/cache/kangle/49 /var/cache/kangle/50 /var/cache/kangle/51 /var/cache/kangle/52 /var/cache/kangle/53 /var/cache/kangle/54 /var/cache/kangle/55 /var/cache/kangle/56 /var/cache/kangle/57 /var/cache/kangle/58 /var/cache/kangle/59 /var/cache/kangle/60 /var/cache/kangle/61 /var/cache/kangle/62 /var/cache/kangle/63 /var/cache/kangle/64 /var/cache/kangle/65 /var/cache/kangle/66 /var/cache/kangle/67 /var/cache/kangle/68 /var/cache/kangle/69 /var/cache/kangle/70 /var/cache/kangle/71 /var/cache/kangle/72 /var/cache/kangle/73 /var/cache/kangle/74 /var/cache/kangle/75 /var/cache/kangle/76 /var/cache/kangle/77 /var/cache/kangle/78 /var/cache/kangle/79 /var/cache/kangle/1a /var/cache/kangle/1b /var/cache/kangle/1c /var/cache/kangle/1d /var/cache/kangle/1e /var/cache/kangle/1f /var/cache/kangle/2a /var/cache/kangle/2b /var/cache/kangle/2c /var/cache/kangle/2d /var/cache/kangle/2e /var/cache/kangle/2f /var/cache/kangle/3a /var/cache/kangle/3b /var/cache/kangle/3c /var/cache/kangle/3d /var/cache/kangle/3e /var/cache/kangle/3f

创建软链接:
ln -s /data/cache/kangle/0 /data/cache/kangle/1 /data/cache/kangle/2 /data/cache/kangle/3 /data/cache/kangle/4 /data/cache/kangle/5 /data/cache/kangle/6 /data/cache/kangle/7 /data/cache/kangle/8 /data/cache/kangle/9 /data/cache/kangle/10 /data/cache/kangle/11 /data/cache/kangle/12 /data/cache/kangle/13 /data/cache/kangle/14 /data/cache/kangle/15 /data/cache/kangle/16 /data/cache/kangle/17 /data/cache/kangle/18 /data/cache/kangle/19 /data/cache/kangle/20 /data/cache/kangle/21 /data/cache/kangle/22 /data/cache/kangle/23 /data/cache/kangle/24 /data/cache/kangle/25 /data/cache/kangle/26 /data/cache/kangle/27 /data/cache/kangle/28 /data/cache/kangle/29 /data/cache/kangle/30 /data/cache/kangle/31 /data/cache/kangle/32 /data/cache/kangle/33 /data/cache/kangle/34 /data/cache/kangle/35 /data/cache/kangle/36 /data/cache/kangle/37 /data/cache/kangle/38 /data/cache/kangle/39 /data/cache/kangle/40 /data/cache/kangle/41 /data/cache/kangle/42 /data/cache/kangle/43 /data/cache/kangle/44 /data/cache/kangle/45 /data/cache/kangle/46 /data/cache/kangle/47 /data/cache/kangle/48 /data/cache/kangle/49 /data/cache/kangle/50 /data/cache/kangle/51 /data/cache/kangle/52 /data/cache/kangle/53 /data/cache/kangle/54 /data/cache/kangle/55 /data/cache/kangle/56 /data/cache/kangle/57 /data/cache/kangle/58 /data/cache/kangle/59 /data/cache/kangle/60 /data/cache/kangle/61 /data/cache/kangle/62 /data/cache/kangle/63 /data/cache/kangle/64 /data/cache/kangle/65 /data/cache/kangle/66 /data/cache/kangle/67 /data/cache/kangle/68 /data/cache/kangle/69 /data/cache/kangle/70 /data/cache/kangle/71 /data/cache/kangle/72 /data/cache/kangle/73 /data/cache/kangle/74 /data/cache/kangle/75 /data/cache/kangle/76 /data/cache/kangle/77 /data/cache/kangle/78 /data/cache/kangle/79 /data/cache/kangle/1a /data/cache/kangle/1b /data/cache/kangle/1c /data/cache/kangle/1d /data/cache/kangle/1e /data/cache/kangle/1f /data/cache/kangle/2a /data/cache/kangle/2b /data/cache/kangle/2c /data/cache/kangle/2d /data/cache/kangle/2e /data/cache/kangle/2f /data/cache/kangle/3a /data/cache/kangle/3b /data/cache/kangle/3c /data/cache/kangle/3d /data/cache/kangle/3e /data/cache/kangle/3f /var/cache/kangle

格式如下
ln -s 实际存储目录路径 程序访问的路径


启动kangle:
/vhs/kangle/bin/kangle


ls -l /var/cache/kangle看到已经成功了。

这样就可以让机械盘承受一定缓存,,还能起到raid0的效果?嘿嘿嘿

欢迎光临IT技术交流论坛:http://bbs.itzmx.com/
回复

使用道具 举报

签到天数: 2542 天

[LV.Master]伴坛终老

 成长值: 22450
发表于 2018/6/9 04:21 | 显示全部楼层 |Google Chrome 67.0.3396.62|Windows 10
然而实际上好像大部分还是存SSD了==!
欢迎光临IT技术交流论坛:http://bbs.itzmx.com/
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册论坛 用百度帐号登录新浪微博账号登陆

本版积分规则

手机版|Archiver|Mail me|网站地图|IT技术交流论坛 ( 闽ICP备13013206号-7 )

GMT+8, 2018/12/19 11:30 , Processed in 0.289431 second(s), 44 queries , Gzip On, Memcache On.

Powered by itzmx!

© 2011-2018 sakura

快速回复 返回顶部 返回列表