In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly explains "how to use ceph-deploy to deploy ceph on ubuntu server14.04 and other configurations". The explanation in this article is simple and clear, easy to learn and understand. Please follow the editor's ideas to study and learn "how to use ceph-deploy to deploy ceph on ubuntu server14.04 and other configurations".
1. Environment and explanation
Deploy ceph-0.87; on ubuntu14.04 server to set up rbdmap to automatically mount / unmount rbd block devices; use tgt with rbd support to export iscsi's rbd blocks.
two。 Install ceph
1) configure hostname and login without password
An example of root@mon0:/etc/ceph# cat / etc/hosts127.0.0.1 localhost192.168.108.4 osd2.osd2 osd2192.168.108.3 osd1.osd1 osd1192.168.108.2 mon0.mon0 mon0# is ssh-keygenssh-copy-id-I / root/.ssh/id_rsa.pub osd1
2) install ceph-deploy
Wget-Q-O-'https://ceph.com/git/?p=ceph.git;a=blob_plain;f=keys/release.asc' | sudo apt-key add-echo deb http://ceph.com/debian-dumpling/ $(lsb_release-sc) main | sudo tee / etc/apt/sources.list.d/ceph.listapt-get updateapt-get install ceph-deploy
3) install ceph
Ceph-deploy new mon0 osd1 osd2ceph-deploy install-- release giant mon0 osd1 osd2ceph-deploy mon create mon0 osd1 osd2ceph-deploy gatherkeys mon0 osd1 osd2# needs to create the mount directory / cephmp1 and / cephmp2 corresponding to the OSD disk. And mount the ceph-deploy osd prepare mon0:/cephmp1:/dev/sdf1 mon0:/cephmp2:/dev/sdf2 osd1:/cephmp1:/dev/sdf1 osd1:/cephmp2:/dev/sdf2 osd2:/cephmp1:/dev/sdf1 osd2:/cephmp2:/dev/sdf2ceph-deploy osd activate mon0:/cephmp1:/dev/sdf1 mon0:/cephmp2:/dev/sdf2 osd1:/cephmp1:/dev/sdf1 osd1:/cephmp2:/dev/sdf2 osd2:/cephmp1:/dev/sdf1 disk to these directories Osd2:/cephmp2:/dev/sdf2ceph-deploy mds create mon0 osd1 osd2
After installation, you can modify the / etc/ceph/ceph.conf file as needed, and then use the ceph-deploy-- overwrite-conf config push osd1 osd2 command to push the modified configuration file to other hosts. Then restart with the following command:
Restart ceph-all
The problem here is that although / etc/apt/sources.list.d/ceph.list has been modified, ceph-deploy will modify the file and configure it to firefly, so the installation is 0.80.7. After the installation is complete, modify the ceph.list file:
Root@mon0:/etc/ceph# cat / etc/apt/sources.list.d/ceph.list deb http://ceph.com/debian-giant/ trusty main
After being modified to giant version:
Apt-get updateapt-get upgrade cephrestart ceph-all
This upgrades ceph to giant 0.87.
3. Configure rbdmap
After creating a rbd block device and rbd map, if you do not rbd unmap in time, the system will hung on the umount rbd device when shutting down. So it is necessary to configure rbdmap. First download and set up the boot rbdmap
$sudo wget https://raw.github.com/ceph/ceph/a4ddf704868832e119d7949e96fe35ab1920f06a/src/init-rbdmap-O / etc/init.d/rbdmap$ sudo chmod + x / etc/init.d/rbdmap$ sudo update-rc.d rbdmap defaults
Then create a rbd block device, mount it with rbd map, and format it with mkfs. The result is as follows:
Root@mon0:/etc/ceph# rbd ls iscsiiscsi-rbdroot@mon0:/etc/ceph# rbd showmappedid pool image snap device 1 iscsiiscsi-rbd-/ dev/rbd1 mkfs.xfs / dev/rbd1
Modify / etc/init.d/rbdmap, change / etc/rbdmap to the actual path of your rbdmap, and then write the mount information to / etc/ceph/rbdmap (my rbdmap path):
Root@mon0:/etc/ceph# cat / etc/ceph/rbdmap# RbdDevice Parameters#poolname/imagename id=client,keyring=/etc/ceph/ceph.client.keyringiscsi/iscsi-rbd
Because I disabled cephx, I don't have to configure keyring.
This allows manual control, and the switch can automatically mount and uninstall rbd block devices.
4. Configure iscsi that supports rbd export
Install tgt and check if rbd is supported
Root@mon0:/etc/ceph# apt-get install tgtroot@mon0:/etc/ceph# tgtadm-lld iscsi-op show-mode system | grep rbd rbd (bsoflags sync:direct)
Create a rbd block device and map and format it; then modify / etc/tgt/targets.conf:
Root@mon0:/etc/ceph# cat / etc/tgt/targets.conf # Empty targets configuration file-- please see the package# documentation directory for an example.## You can drop individual config snippets into / etc/tgt/conf.dinclude / etc/tgt/conf.d/*.conf driver iscsi bs-type rbd backing-store iscsi/iscsi-rbd # Format is / service tgt reload
Summary: it is the first time to deal with ceph on ubuntu, which needs to be summed up and adapted slowly. I also hope that the children's shoes I have done will not hesitate to give me some advice.
Thank you for reading, the above is "how to use ceph-deploy to deploy ceph on ubuntu server14.04 and other configuration" content, after the study of this article, I believe you on how to use ceph-deploy to deploy ceph on ubuntu server14.04 and other configuration of this problem has a deeper understanding, the specific use also needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.