×ðÁú¿­Ê±¹ÙÍøµÇ¼

ÔõÑùÔÚLinuxÉÏÉèÖø߿ÉÓõÄÐéÄ⻯´æ´¢£¨ÈçCeph£©

ÔõÑùÔÚlinuxÉÏÉèÖø߿ÉÓõÄÐéÄ⻯´æ´¢£¨Èçceph£©

СÐò£º

ÔÚÏÖ´úµÄÔÆÅÌËãÇéÐÎÖÐ £¬¸ß¿ÉÓõÄÐéÄ⻯´æ´¢ÊÇÖÁ¹ØÖ÷ÒªµÄ¡£CephÊÇÒ»ÖÖ¿ªÔ´µÄÂþÑÜʽ´æ´¢ÏµÍ³ £¬ËüÄܹ»Ìṩ¸ß¿ÉÓÃÐԺͿÉÉìËõÐÔ £¬²¢ÇÒÔÚÐéÄ⻯ÇéÐÎÖлñµÃÁËÆÕ±éÓ¦Óᣱ¾ÎĽ«ÏÈÈÝÔõÑùÔÚLinuxÉÏÉèÖø߿ÉÓõÄÐéÄ⻯´æ´¢ £¬²¢ÌṩÏà¹Ø´úÂëʾÀý¡£

µÚÒ»²¿·Ö£ºCephµÄ×°ÖÃÓëÉèÖÃ

µÚÒ»²½£º×°ÖÃCeph

ʹÓÃÒÔÏÂÏÂÁîÔÚLinuxϵͳÉÏ×°ÖÃCeph£º

sudo apt-get install ceph

µÇ¼ºó¸´ÖÆ

µÚ¶þ²½£ºÉèÖÃCeph¼¯Èº

±à¼­/etc/ceph/ceph.confÎļþ £¬²¢Ìí¼ÓÒÔÏÂÄÚÈÝ£º

[global]
fsid = <fsid>
mon initial members = <mon-node1>, <mon-node2>, <mon-node3>
mon host = <ip-node1>, <ip-node2>, <ip-node3>

[osd]
osd journal size = 1024

[mon]
mon data = /var/lib/ceph/mon/$cluster-$id
mon initial members = <mon-node1>, <mon-node2>, <mon-node3>

[mds]
mds data = /var/lib/ceph/mds/$cluster-$id

µÇ¼ºó¸´ÖÆ

Ìæ»» ¡¢ ¡¢ ¡¢ ¡¢ ¡¢ ºÍ ΪÏìÓ¦µÄÖµ¡£ÕâЩֵ¿ÉÒÔƾ֤ÏêϸµÄÇéÐξÙÐÐÉèÖá£

µÚÈý²½£ºÆô¶¯Ceph¼¯Èº

Ö´ÐÐÒÔÏÂÏÂÁîÒÔÆô¶¯Ceph¼¯Èº£º

sudo systemctl start ceph-mon.target
sudo systemctl start ceph-osd.target
sudo systemctl start ceph-mds.target

µÇ¼ºó¸´ÖÆ

µÚ¶þ²¿·Ö£ºÉèÖø߿ÉÓÃÐÔ

µÚÒ»²½£º×°ÖÃCorosyncºÍPacemaker

ʹÓÃÒÔÏÂÏÂÁîÔÚLinuxϵͳÉÏ×°ÖÃCorosyncºÍPacemaker£º

sudo apt-get install corosync pacemaker

µÇ¼ºó¸´ÖÆ

µÚ¶þ²½£ºÉèÖÃCorosync

±à¼­/etc/corosync/corosync.confÎļþ £¬²¢Ìí¼ÓÒÔÏÂÄÚÈÝ£º

totem {
        cluster_name: <cluster-name>
        token: <token>
        secauth: off
        transport: udpu
        interface {
                ringnumber: 0
                bindnetaddr: <ip-node1>
                mcastaddr: <mcast-addr>
                mcastport: <mcast-port>
        }
        interface {
                ringnumber: 1
                bindnetaddr: <ip-node2>
                mcastaddr: <mcast-addr>
                mcastport: <mcast-port>
        }
        interface {
                ringnumber: 2
                bindnetaddr: <ip-node3>
                mcastaddr: <mcast-addr>
                mcastport: <mcast-port>
        }
}

quorum {
        provider: corosync_votequorum
        expected_votes: <num-nodes>
        two_node: 1
}

nodelist {
        node {
                ring0_addr: <ip-node1>
                nodeid: 1
        }
        node {
                ring0_addr: <ip-node2>
                nodeid: 2
        }
        node {
                ring0_addr: <ip-node3>
                nodeid: 3
        }
}

µÇ¼ºó¸´ÖÆ

Ìæ»» ¡¢ ¡¢ ¡¢ ¡¢ ¡¢ ¡¢ ºÍ ΪÏìÓ¦µÄÖµ¡£

µÚÈý²½£ºÆô¶¯CorosyncºÍPacemaker

Ö´ÐÐÒÔÏÂÏÂÁîÒÔÆô¶¯CorosyncºÍPacemaker£º

sudo systemctl enable corosync
sudo systemctl enable pacemaker
sudo systemctl start corosync
sudo systemctl start pacemaker

µÇ¼ºó¸´ÖÆ

µÚËIJ½£ºÉèÖÃCeph×ÊÔ´

Ö´ÐÐÒÔÏÂÏÂÁîÒÔÉèÖÃCeph×ÊÔ´£º

sudo pcs resource create ceph_mon ocf:ceph:mon 
--params mon_name=mon 
op monitor interval=10s

sudo pcs resource create ceph_osd ocf:ceph:osd 
--params osd_device=/dev/sdb 
op start timeout=90s 
op stop timeout=90s 
op monitor interval=10s

sudo pcs resource create ceph_mds ocf:ceph:mds 
--params mds_name=mds 
op monitor interval=10s

µÇ¼ºó¸´ÖÆ

ÕâЩÏÂÁ½¨ÉèCephµÄmon¡¢osdºÍmds×ÊÔ´ £¬²¢Ö¸¶¨Ò»Ð©²ÎÊý¡£

½áÂÛ£º

ÒÔÉϾÍÊÇÔÚLinuxÉÏÉèÖø߿ÉÓõÄÐéÄ⻯´æ´¢µÄÒªÁ졣ͨ¹ýʹÓÃCephºÍCorosync-Pacemaker £¬ÎÒÃÇ¿ÉÒÔÇáËɵØʵÏָ߿ÉÓõÄÐéÄ⻯´æ´¢ÇéÐΡ£Ï£Íû±¾ÎÄÄܶԶÁÕßÔÚLinuxÉÏÉèÖø߿ÉÓõÄÐéÄ⻯´æ´¢ÌṩһЩ×ÊÖú¡£

²Î¿¼×ÊÁÏ£º

Ceph¹Ù·½Îĵµ£ºhttps://docs.ceph.com/

Corosync¹Ù·½Îĵµ£ºhttps://corosync.github.io/corosync-docs/index.html

Pacemaker¹Ù·½Îĵµ£ºhttp://clusterlabs.org/

Linux״̬ÖÎÀíÆ÷ʹÓÃÖ¸ÄÏ£ºhttps://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html/high_availability_add-on_reference/

Linux¼¯Èº°üÖ¸ÄÏ£ºhttps://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html/high_availability_add-on_guide/

ÒÔÉϾÍÊÇÔõÑùÔÚLinuxÉÏÉèÖø߿ÉÓõÄÐéÄ⻯´æ´¢£¨ÈçCeph£©µÄÏêϸÄÚÈÝ £¬¸ü¶àÇë¹Ø×¢±¾ÍøÄÚÆäËüÏà¹ØÎÄÕ£¡

ÃâÔð˵Ã÷£ºÒÔÉÏչʾÄÚÈÝȪԴÓÚÏàÖúýÌå¡¢ÆóÒµ»ú¹¹¡¢ÍøÓÑÌṩ»òÍøÂçÍøÂçÕûÀí £¬°æȨÕùÒéÓë±¾Õ¾ÎÞ¹Ø £¬ÎÄÕÂÉæ¼°¿´·¨Óë¿´·¨²»´ú±í×ðÁú¿­Ê±¹ÙÍøµÇ¼ÂËÓÍ»úÍø¹Ù·½Ì¬¶È £¬Çë¶ÁÕß½ö×ö²Î¿¼¡£±¾ÎĽӴýתÔØ £¬×ªÔØÇë˵Ã÷À´ÓÉ¡£ÈôÄúÒÔΪ±¾ÎÄÇÖÕ¼ÁËÄúµÄ°æȨÐÅÏ¢ £¬»òÄú·¢Ã÷¸ÃÄÚÈÝÓÐÈκÎÉæ¼°ÓÐÎ¥¹«µÂ¡¢Ã°·¸Ö´·¨µÈÎ¥·¨ÐÅÏ¢ £¬ÇëÄúÁ¬Ã¦ÁªÏµ×ðÁú¿­Ê±¹ÙÍøµÇ¼ʵʱÐÞÕý»òɾ³ý¡£

Ïà¹ØÐÂÎÅ

ÁªÏµ×ðÁú¿­Ê±¹ÙÍøµÇ¼

18523999891

¿É΢ÐÅÔÚÏß×Éѯ

ÊÂÇéʱ¼ä£ºÖÜÒ»ÖÁÖÜÎå £¬9:30-18:30 £¬½ÚãåÈÕÐÝÏ¢

QR code
ÍøÕ¾µØͼ