Category: storage

  • 使用docker安装ceph

    使用docker安装ceph

    #划分子网
    docker network create --driver bridge --subnet 172.20.0.0/16 ceph-network
    docker network ls
    docker network inspect ceph-network
    
    #用于存放ceph配置
    mkdir -p  /myceph/etc/ceph
    #创建目录代表osd
    mkdir -p  /myceph/osd/0  /myceph/osd/1  /myceph/osd/2
    
    # monitor node
    docker run -itd --name monnode --network ceph-network --ip 172.20.0.10 -e MON_NAME=monnode -e MON_IP=172.20.0.10 -v /myceph/etc/ceph:/etc/ceph ceph/mon
    
    #
    docker exec monnode ceph osd create
    docker exec monnode ceph osd create
    docker exec monnode ceph osd create
    
    #osd
    docker run -itd --name osdnode0 --network ceph-network -e CLUSTER=ceph -e WEIGHT=1.0 -e MON_NAME=monnode -e MON_IP=172.20.0.10 -v /myceph/etc/ceph:/etc/ceph -v /myceph/osd/0:/var/lib/ceph/osd/ceph-0 ceph/osd
    docker run -itd --name osdnode1 --network ceph-network -e CLUSTER=ceph -e WEIGHT=1.0 -e MON_NAME=monnode -e MON_IP=172.20.0.10 -v /myceph/etc/ceph:/etc/ceph -v /myceph/osd/1:/var/lib/ceph/osd/ceph-1 ceph/osd
    docker run -itd --name osdnode2 --network ceph-network -e CLUSTER=ceph -e WEIGHT=1.0 -e MON_NAME=monnode -e MON_IP=172.20.0.10 -v /myceph/etc/ceph:/etc/ceph -v /myceph/osd/2:/var/lib/ceph/osd/ceph-2 ceph/osd
    
    #object storage gateway
    docker run -itd --name gwnode --network ceph-network --ip 172.20.0.9 -p 9080:80 -e RGW_NAME=gwnode -v /myceph/etc/ceph:/etc/ceph ceph/radosgw
    
    docker exec monnode ceph -s
    

    基于Docker部署ceph分布式文件系统(Luminous版本)

  • 结合vmstat分析iostat输出结果

    man vmstat

    FIELD DESCRIPTION FOR VM MODE

    Procs

    • r: The number of processes waiting for run time.

      r 表示运行队列 (就是说多少个进程真的分配到CPU). 当这个值超过了CPU数目, 就会出现CPU瓶颈.

    • b: The number of processes in uninterruptible sleep.

    Memory

    • swpd: the amount of virtual memory used.
    • free: the amount of idle memory.
    • buff: the amount of memory used as buffers.
    • cache: the amount of memory used as cache.
    • inact: the amount of inactive memory. (-a option)
    • active: the amount of active memory. (-a option)

    Swap

    • si: Amount of memory swapped in from disk (/s).
    • so: Amount of memory swapped to disk (/s).

    IO

    • bi: Blocks received from a block device (blocks/s).
    • bo: Blocks sent to a block device (blocks/s).

    System

    • in: The number of interrupts per second, including the clock.
    • cs: The number of context switches per second.

    CPU

    • These are percentages of total CPU time.
    • us: Time spent running non-kernel code. (user time, including nice time)
    • sy: Time spent running kernel code. (system time)
    • id: Time spent idle. Prior to Linux 2.5.41, this includes IO-wait time.
    • wa: Time spent waiting for IO. Prior to Linux 2.5.41, included in idle.

      wa 列显示了IO等待所占用的CPU时间的百分比。这里wa的参考值为30%,如果wa超过30%,说明IO等待严重,这可能是磁盘大量随机访问造成的,也可能磁盘或者磁盘访问控制器的带宽瓶颈造成的(主要是块操作)

    • st: Time stolen from a virtual machine. Prior to Linux 2.6.11, unknown.

  • 使用iostat分析问题

    文章来源: How I Use Iostat and Vmstat for Performance Analysis

    考虑到svctm在iostat是不保证准确的. 分析io await相关问题需要和blktrace结合起来分析.

    1. Is the I/O heavy?

    • Check the sum of w/s and r/s. The larger, the heavier I/O.
    • Also check %util, the more, the heavier.

      • If it is close to 100, then the I/O is definitely significant. It should be noted that during writing,
      • if the disk is the bottleneck (%util is 100% for a long time), but the applications keep writing, as long as the dirty pages exceeds 30% of memory, the system will block all the write system call, no matter sync or async, and focuses on writing to the disk. Once this occurs, the entire system is slow as hell.
      • check wa in vmstat log.
        (more…)
  • 使用minio做对象存储

    [TOC]

    安装docker-ce

     dnf config-manager --add-repo=https://download.docker.com/linux/centos/docker-ce.repo
     dnf list docker-ce --showduplicates | sort -r
     #指定版本
     dnf install  docker-ce-3:18.09.0-3.el7  
    

    启动minio

     docker run -d  \
     -p 9000:9000 \
     --name myminio   \
     -e "MINIO_ACCESS_KEY=AKIAIOSFODNN7EXAMPLE" \
     -e "MINIO_SECRET_KEY=wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY" \
     -e "MINIO_DOMAIN=mlcloud.minio" \
     -v /myminio:/data  \
     minio/minio server /data 
    

    (more…)

  • what is the difference getContentMd5() and getETag() of aws s3 PutObjectResult

    An MD5 hash consists of 16 bytes, but they are not all printable characters.

    • The ETag is the md5 hash, hex-encoded (not base64, as the question suggests) — hex encoding uses 32 characters to encode 16 bytes.
    • Meanwhile, Content-MD5 is the md5 hash, base64 encoded, which uses 24 characters to encode 16 bytes.

    答案来源-stackoverflow