- Ceph Cookbook(Second Edition)
- Vikhyat Umrao Michael Hackett Karan Singh
- 477字
- 2021-07-02 23:19:06
How to do it...
Once you have installed the mentioned software, we will proceed with virtual machine creation:
- git clone ceph-cookbook repositories to your VirtualBox host machine:
$ git clone https://github.com/PacktPublishing/Ceph-Cookbook-Second-Edition

- Under the cloned directory, you will find vagrantfile, which is our Vagrant configuration file that basically instructs VirtualBox to launch the VMs that we require at different stages of this book. Vagrant will automate the VM's creation, installation, and configuration for you; it makes the initial environment easy to set up:
$ cd Ceph-Cookbook-Second-Edition ; ls -l

- Next, we will launch three VMs using Vagrant; they are required throughout this chapter:
$ vagrant up ceph-node1 ceph-node2 ceph-node3
If the default Vagrant provider is not set to VirtualBox, set it to VirtualBox. To make it permanent, it can be added to user .bashrc file:
# export VAGRANT_DEFAULT_PROVIDER=virtualbox
# echo $VAGRANT_DEFAULT_PROVIDER

- Run vagrant up ceph-node1 ceph-node2 ceph-node3:

- Check the status of your virtual machines:
$ vagrant status ceph-node1 ceph-node2 ceph-node3

The username and password that Vagrant uses to configure virtual machine is vagrant, and Vagrant has sudo rights. The default password for the root user is vagrant.
- Vagrant will, by default, set up hostnames as ceph-node<node_number> and IP address subnet as 192.168.1.X and will create three additional disks that will be used as OSDs by the Ceph cluster. Log in to each of these machines one by one and check whether the hostname, networking, and additional disks have been set up correctly by Vagrant:
$ vagrant ssh ceph-node1
$ ip addr show
$ sudo fdisk -l
$ exit
- Vagrant is configured to update hosts file on the VMs. For convenience, update the /etc/hosts file on your host machine with the following content:
192.168.1.101 ceph-node1
192.168.1.102 ceph-node2
192.168.1.103 ceph-node3

- Update all the three VM's to the latest CentOS release and reboot to the latest kernel:

- Generate root SSH keys for ceph-node1 and copy the keys to ceph-node2 and ceph-node3. The password for the root user on these VMs is vagrant. Enter the root user password when asked by the ssh-copy-id command and proceed with the default settings:
$ vagrant ssh ceph-node1
$ sudo su -
# ssh-keygen
# ssh-copy-id root@ceph-node1
# ssh-copy-id root@ceph-node2
# ssh-copy-id root@ceph-node3

- Once the SSH keys are copied to ceph-node2 and ceph-node3, the root user from ceph-node1 can do an ssh login to VMs without entering the password:
# ssh ceph-node2 hostname
# ssh ceph-node3 hostname

- Enable ports that are required by the Ceph MON, OSD, and MDS on the operating system's firewall. Execute the following commands on all VMs:
# firewall-cmd --zone=public --add-port=6789/tcp --permanent
# firewall-cmd --zone=public --add-port=6800-7100/tcp --permanent
# firewall-cmd --reload
# firewall-cmd --zone=public --list-all

- Install and configure NTP on all VMs:
# yum install ntp ntpdate -y
# ntpdate pool.ntp.org
# systemctl restart ntpdate.service
# systemctl restart ntpd.service
# systemctl enable ntpd.service
# systemctl enable ntpdate.service
推薦閱讀
- LabVIEW虛擬儀器從入門到測控應用130例
- 手把手教你學AutoCAD 2010
- 數據運營之路:掘金數據化時代
- 自主研拋機器人技術
- 工業機器人入門實用教程(KUKA機器人)
- 自動化控制工程設計
- Hadoop Real-World Solutions Cookbook(Second Edition)
- Creo Parametric 1.0中文版從入門到精通
- LMMS:A Complete Guide to Dance Music Production Beginner's Guide
- Visual Studio 2010 (C#) Windows數據庫項目開發
- Mastering Exploratory Analysis with pandas
- 典型Hadoop云計算
- 電腦故障排除與維護終極技巧金典
- Visual Basic項目開發案例精粹
- 軟件測試管理