• FlashCache初体验


    注意:

    测试用的是CentOS6.5

    内核版本2.6.32-431.el6.x86_64

     

    步骤:

    上传CentOS6.5做本地yum源,安装以下包。

    yum install gcc

    yum install *kernel*

    yum install perl

    将flashcache master打包下载至测试机上,可以从doc中找到更多说明。

    https://github.com/facebookarchive/flashcache

    解压执行以下两个步骤。

    make

    make install

     

    加两块盘

    fdisk /dev/sdb

    fdisk /dev/sdc

    创建cachedev

    flashcache_create -p back -b 4k cachedev /dev/sdb1 /dev/sdc1

    默认放在/dev/mapper下

    cd /dev/mapper/

    初次创建时自动加载内核模块。

    lsmod | grep flash

    内核模块重启会消失,所以确保开机自动加载

    echo "modprobe flashcache" >>/etc/rc.local

    设置自动加载脚本

    cp /root/flashcache/flashcache-master/utils/flashcache /etc/init.d/

    赋予开机脚本执行权限

    chmod +x /etc/init.d/flashcache

    在脚本里面添加这些东西

    SSD_DISK=/dev/sdb1

    BACKEND_DISK=/dev/sdc1

    CACHEDEV_NAME=cachedev

    MOUNTPOINT=/cache

    FLASHCACHE_NAME=sdb1+sdc1

    添加到服务里面

    chkconfig --add /etc/init.d/flashcache

    创建一个挂载点

    mkdir -p /cache

    格式化cachedev

    mkfs.ext4 /dev/mapper/cachedev

    挂载就可以了,不需要再/etc/fstab里面添加参数。

    mount -t ext4 /dev/mapper/cachedev /cache/

    将flashcache内核参数写到CentOS系统sysctl中,可以修改相应flashcahe选项进行优化。

    sysctl dev.flashcache >> /etc/sysctl.conf

    查看flashcache版本

    cat /proc/flashcache/flashcache_version

    查看flashcache盘错误计数

    cat /proc/flashcache/sdb1+sdc1/flashcache_errors

    查看flashcache盘统计

    cat /proc/flashcache/sdb1+sdc1/flashcache_stats

    查看状态

    dmsetup status cachedev

     

    查看归档状态

    dmsetup table cachedev

    拷贝这个工具到/bin下

    cp /root/flashcache/flashcache-master/utils/flashstat /bin/

    执行监控cachedev盘

    /bin/flashstat

     

    如果系统重启后没有加载cachedev盘,可以手工加载。

    flashcache_load /dev/sdb1 cachedev

    清除cachedev数据

    flashcache_destroy /dev/sdb1

    删除cachedev盘

    dmsetup remove cachedev

     

     

    参考:

    http://my.oschina.net/gaga/blog/496200

     

     

     

     

     

     

     

     

     

  • 相关阅读:
    ArcGIS自定义工具箱-列举损坏的数据源
    ArcGIS自定义工具箱-修复损坏的工作空间
    ArcGIS自定义工具箱-显示地图文档结构
    ArcGIS自定义工具箱-字段合并
    ArcGIS自定义工具箱-字段分割
    ArcGIS自定义工具箱-字段值部分替换
    [转载]ArcGIS Engine 中的多线程使用
    一个WebService Demo
    [GeoServer]Openlayers简单调用
    [ArcEngine]Geotransformation地理变换
  • 原文地址:https://www.cnblogs.com/appresearch/p/5503132.html
Copyright © 2020-2023  润新知