mkcephfs 使用

Creating a new file system

The 'mkcephfs' script is used to create a new cluster file system. The basic syntax is

/usr/sbin/mkcephfs [-c ceph.conf] [-a|--allhosts] [--mkbtrfs] [-k admin.keyring]
BE VERY VERY CAREFUL. MINIMAL CHECKS ARE MADE TO AVOID OVERWRITING OLD DATA.

The -a or --allhosts flag specifies that mkfs-related steps should be taken on _all_ hosts in the cluster. This will use ssh to set up remote hosts. If you don't want to do this, see the mkcephfs man page.

 

The --mkbtrfs option will create a new btrfs file system for each OSD and mount it for you. It requires that the 'btrfs devs' and 'btrfs path' (when it differs from the 'osd data' directory) are specified. NOTE THAT NO SAFETY CHECKS ARE MADE YET; be careful with the 'btrfs devs' option!

To use ext4 instead of btrfs, comment out "btrfs devs" in ceph.conf, point "osd data" to an already mounted ext4 partition and use mkcephfs without --mkbtrfs. The ext4 partition must be mounted with -o user_xattr or else mkcephfs will fail. Also using noatime,nodiratime boosts performance at no cost. When using ext4, you should disable the ext4 journal, because Ceph does its own journalling. This will boost performance.

Creating a new file system on an ext4 partition that already contains data, will invoke rm -rf to delete the data. If there is a lot of it, it might seem as if mkcephfs is hanging when it actually is not.

If for any reason you are re-creating the file system on a pre-existing cluster, recreating the journals too might save you some grief.

 

The -k admin.keyring option lets you specify where mkcephfs puts your master admin key file, which is necessary to administer the cluster when you have authentication enabled. Note that the various keys are generated even if authentication is disabled, so that it can be enabled later.

SSH keys

You will need to set up ssh keys so that the machine you are running mkcephfs on (master ) can ssh in to other nodes (slave ) as root. The usual way to do this (assuming you don't already have any keys or authorized_keys set up):

master# ssh-keygen -d




Generating public/private dsa key pair.
Enter file in which to save the key (/root/.ssh/id_dsa): 
Enter passphrase (empty for no passphrase): 
Enter same passphrase again: 
Your identification has been saved in /root/.ssh/id_dsa.
Your public key has been saved in /root/.ssh/id_dsa.pub.

Then for each other host,

# ssh-copy-id root@slave

Example

# mkcephfs -c /etc/ceph/ceph.conf -a --mkbtrfs -k /etc/ceph/keyring.bin




评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值