未加星标

Ubuntu 16.04快速安装Ceph集群

字体大小 | |
[系统(linux) 所属分类 系统(linux) | 发布者 店小二03 | 时间 20160901 | 作者 红领巾 ] 0人收藏点击收藏
Ubuntu 16.04快速安装Ceph集群
准备工作

假设集群: 选一台作管理机
注意: ceph集群引用hostname,而非ip.
172.17.4.16 linuxidc16 #hostname必须是linuxidc16
172.17.4.17 linuxidc17 #hostname必须是linuxidc17
172.17.4.18 linuxidc18 #hostname必须是linuxidc18
172.17.4.19 linuxidc19 #hostname必须是linuxidc19, 选作管理机
172.17.4.20 linuxidc20 #hostname必须是linuxidc20
172.17.4.21 linuxidc21 #hostname必须是linuxidc21
172.17.4.22 linuxidc22 #hostname必须是linuxidc22
安装用户
注意: 建议不要使用"ceph",因为"apt install ceph"需要使用ceph. 用root最省事 ^_^
[email protected]:~# ssh-keygen #创建安装用rsa,安装完记得删除
[email protected]:~# less .ssh/id_rsa.pub
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDZAQ8ikono13kGzRLpyx1BCRfzICieEKg27WABW+2eFkYXmbvzLSu8XkmC3a0x7M0ADd2aW2FGv8ZtxPgHMRFzyaeoXwGZUFU5zmd9CASglHibKlWzdUgl5sW/DSdSxFYs+ooQvZcKSMmbFYlo70Ndv5kHja2FEMKnLexJpox4fFb9Rv1KEez0p1j28iICc3nHXLAZigezKkaFiv/Wfk/g59nk6ZCNAr1UnDvTdQOnVTIu6Q6UkpoiDx3+R5oeWRynI2l6T/bhrMpubO5PaluFKvas0DF3eGZLf2XQPR8sYzt7PkOGC1QANi7D11UxTqurZF8Meb0LdH0KEqE1kH7z [email protected]
# 在各台机执行,authorized_keys必须是600
mkdir /root/.ssh
echo -n 'ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDZAQ8ikono13kGzRLpyx1BCRfzICieEKg27WABW+2eFkYXmbvzLSu8XkmC3a0x7M0ADd2aW2FGv8ZtxPgHMRFzyaeoXwGZUFU5zmd9CASglHibKlWzdUgl5sW/DSdSxFYs+ooQvZcKSMmbFYlo70Ndv5kHja2FEMKnLexJpox4fFb9Rv1KEez0p1j28iICc3nHXLAZigezKkaFiv/Wfk/g59nk6ZCNAr1UnDvTdQOnVTIu6Q6UkpoiDx3+R5oeWRynI2l6T/bhrMpubO5PaluFKvas0DF3eGZLf2XQPR8sYzt7PkOGC1QANi7D11UxTqurZF8Meb0LdH0KEqE1kH7z' > /root/.ssh/authorized_keys && chmod 600 /root/.ssh/authorized_keys

测试用户

#在linuxidc19无密ssh
for node in 16 17 18 19 20 21 22; do
ssh linuxidc$node echo 123;
done;
#确认yes
The authenticity of host 'linuxidc22 (172.17.4.22)' can't be established.
ECDSA key fingerprint is SHA256:6S9mp0m8bV15bKX9RugP2CflINUvxORw82yCwJqVyrE.
Are you sure you want to continue connecting (yes/no)? yes

完成后记得将/root/.ssh/id_rsa从linuxidc19移除并妥善保管,以后可以用来维护集群.

更新源

[email protected]: for node in 16 17 18 19 20 21 22; do
ssh linuxidc$node \
wget -q -O- https://download.ceph.com/keys/release.asc | sudo apt-key add -;\
echo deb https://download.ceph.com/debian-jewel/ $(lsb_release -sc) main | sudo tee /etc/apt/sources.list.d/ceph.list;\
apt update && apt -y dist-upgrade && apt -y autoremove;
done
#apt使用-y默认Yes

安装ceph-deploy

[email protected]: apt install ceph-deploy

注意: 16.04下这二个版本都有bug.

1.5.32在执行ceph-deploy mon create-initial命令后生成的ceph.client.admin.keyring文件是空的!

1.5.34则在重装时不会替换/var/lib/ceph/bootstrap-osd/ceph.keyring, 造成ceph-deploy osd activate失败.

[email protected]:~# apt-cache policy ceph-deploy
ceph-deploy:
Installed: 1.5.34
Candidate: 1.5.34
Version table:
*** 1.5.34 999
999 https://download.ceph.com/debian-jewel xenial/main amd64 Packages
999 https://download.ceph.com/debian-jewel xenial/main i386 Packages
100 /var/lib/dpkg/status
1.5.32-0ubuntu1 500
500 http://hk.archive.ubuntu.com/ubuntu xenial/universe amd64 Packages
500 http://hk.archive.ubuntu.com/ubuntu xenial/universe i386 Packages

安装过程

参考: INSTALLATION (QUICK)


创建管理目录

[email protected]:~# mkdir ceph-admin
[email protected]:~# cd ceph-admin/

初始配置

[email protected]:~/ceph-admin# ceph-deploy new linuxidc16 test17
drwxr-xr-x 2 root root 4096 Sep 14 10:28 ./
drwx------ 6 root root 4096 Sep 14 10:28 ../
-rw-r--r-- 1 root root 215 Sep 14 10:28 ceph.conf
-rw-r--r-- 1 root root 4080 Sep 14 10:28 ceph-deploy-ceph.log
-rw------- 1 root root 73 Sep 14 10:28 ceph.mon.keyring
[email protected]:~/ceph-admin# vi ceph.conf
[global]
fsid = c96ee478-4df7-4100-9792-c078cf44b3c4
mon_initial_members = linuxidc16, test17
mon_host = 172.17.4.16,172.17.4.17
auth_cluster_required = cephx
auth_service_required = cephx
auth_client_required = cephx
public_network = 172.17.4.0/24
cluster_network = 172.17.4.0/24
# 以下是针对ext4的bug
osd_max_object_name_len = 256
osd_max_object_namespace_len = 64
osd_check_max_object_name_len_on_startup = false

需要注意: jewel 10.2.1对EXT4格式有个文件名长度BUG!

安装ceph

[email protected]:~/ceph-admin# for node in 16 17 18 19 20 21 22; do ceph-deploy install linuxidc$node; done;

创建初始mon结点

[email protected]:~/ceph-admin# ceph-deploy mon create-initial

创建激活osd结点, 去掉16,17

[email protected]:~/ceph-admin# for node in 18 19 20 21 22; do ssh linuxidc$node 'mkdir -R /data/ceph/osd; chown ceph:ceph -R /data/ceph; rm -rf /data/ceph/osd/*'; ceph-deploy osd prepare linuxidc$node:/data/ceph/osd; ceph-deploy osd activate linuxidc$node:/data/ceph/osd; done;

分发管理配置

[email protected]:~/ceph-admin# for node in 16 17 18 19 20 21 22; do ceph-deploy admin linuxidc$node; ssh linuxidc$node 'chmod a+r /etc/ceph/ceph.client.admin.keyring'; done;
如果上述步骤需要重试,可以执行下述清理:
[email protected]:~/ceph-admin# ceph-deploy purgedata linuxidc16 test17 linuxidc18 test19 linuxidc20 test21 linuxidc22 [email protected]:~/ceph-admin# ceph-deploy forgetkeys [email protected]:~/ceph-admin# for node in 16 17 18 19 20 21 22; do ssh linuxidc$node rm -rf /data/ceph/osd/*; done;
另外, 重试命令需要带上"--overwrite-conf"选项!

测试集群是否安装成功

[email protected]:~/ceph-admin# ceph -s
[email protected]:~/ceph-admin# ceph osd tree
[email protected]:~/ceph-admin# ceph osd perf

Ceph环境配置文档 PDF http://www.codesec.net/Linux/2013-05/85212.htm

CentOS 6.3上部署Ceph http://www.codesec.net/Linux/2013-05/85213.htm

Ceph的安装过程 http://www.codesec.net/Linux/2013-05/85210.htm

HOWTO Install Ceph On FC12, FC上安装Ceph分布式文件系统 http://www.codesec.net/Linux/2013-05/85209.htm

Ceph 文件系统安装 http://www.codesec.net/Linux/2013-05/85208.htm

CentOS 6.2 64位上安装Ceph 0.47.2 http://www.codesec.net/Linux/2013-05/85206.htm

Ubuntu 12.04 Ceph分布式文件系统 http://www.codesec.net/Linux/2013-04/82588.htm

Fedora 14上安装 Ceph 0.24 http://www.codesec.net/Linux/2011-01/31580.htm

Ceph 的详细介绍:请点这里
Ceph 的下载地址:请点这里

本文地址:http://www.codesec.net/Linux/2016-09/135261.htm


Ubuntu 16.04快速安装Ceph集群

本文系统(linux)相关术语:linux系统 鸟哥的linux私房菜 linux命令大全 linux操作系统

主题: CephLinuxUbuntu分布式文件系统TIFUUFUIC删除
分页:12
转载请注明
本文标题:Ubuntu 16.04快速安装Ceph集群
本站链接:http://www.codesec.net/view/481873.html
分享请点击:


1.凡CodeSecTeam转载的文章,均出自其它媒体或其他官网介绍,目的在于传递更多的信息,并不代表本站赞同其观点和其真实性负责;
2.转载的文章仅代表原创作者观点,与本站无关。其原创性以及文中陈述文字和内容未经本站证实,本站对该文以及其中全部或者部分内容、文字的真实性、完整性、及时性,不作出任何保证或承若;
3.如本站转载稿涉及版权等问题,请作者及时联系本站,我们会及时处理。
登录后可拥有收藏文章、关注作者等权限...
技术大类 技术大类 | 系统(linux) | 评论(0) | 阅读(41)