首先强调一下,文档是写给自己看的,所以并不是很细致,但是把大体的内容都写出来了。注意,仅供参考!
1、放开端口(所有节点)
# iptables -I INPUT -s 192.168.217.0/24 -p tcp -d 192.168.217.0/24 -m multiport --dports 3000,3300,6789,6800:6820,8443,9092:9094,9100,9283 -j ACCEPT
2、安装(Ansible节点)
# yum install centos-release-ceph-nautilus
# yum install ceph-ansible
3、配置免密登录(Ansible节点)
# ssh-keygen
# ssh-copy-id -i .ssh/id_rsa.pub <Node>
4、定义ansible-playbook变量(Ansible节点)
[root@os-controller1 group_vars]# egrep -v "^#|^$" /usr/share/ceph-ansible/group_vars/osds.yml
---
dummy:
devices:
- /dev/sdb
[root@os-controller1 group_vars]# egrep -v "^#|^$" /usr/share/ceph-ansible/group_vars/all.yml
---
dummy:
cluster: ceph
configure_firewall: False
ceph_origin: repository
ceph_repository: community
ceph_mirror: https://mirrors.aliyun.com/ceph
ceph_stable_key: https://mirrors.aliyun.com/ceph/keys/release.asc
ceph_stable_release: nautilus
ceph_stable_repo: "{{ ceph_mirror }}/rpm-{{ ceph_stable_release }}"
monitor_interface: ens33
ip_version: ipv4
public_network: "192.168.217.0/24"
cluster_network: "192.168.217.0/24"
radosgw_interface: ens33
dashboard_enabled: True
dashboard_port: 8443
dashboard_admin_user: admin
dashboard_admin_password: p@ssw0rd
node_exporter_port: 9100
grafana_admin_user: admin
grafana_admin_password: admin
grafana_port: 3000
prometheus_port: 9092
[root@os-controller1 group_vars]# egrep -v "^#|^$" /etc/ansible/hosts
[mons]
OS-controller1 monitor_address=192.168.217.143
OS-compute1 monitor_address=192.168.217.144
os-compute2 monitor_address=192.168.217.145
[osds]
OS-controller1
OS-compute1
os-compute2
[mgrs]
OS-controller1
OS-compute1
os-compute2
[grafana-server]
os-compute2
5、Ansible会自动安装Docker用于grafana,提前准备好daemon.json文件(所有节点)
[root@os-compute2 docker]# cat /etc/docker/daemon.json
{
"registry-mirrors": ["https://docker.mirrors.ustc.edu.cn"],
"live-restore": true
}
6、部署Ceph集群
# cd /usr/share/ceph-ansible/
# cp site.yml.sample site.yml
# ansible-playbook site.yml -vvv
7、查看集群健康状态
# ceph -s
HEALTH_WARN:pools have too many placement groups
解决方法∶
# ceph mgr module disable pg_autoscaler
HEALTH_WARN: mons are allowing insecure global_id reclaim
解决方法:
# ceph config set mon auth_allow_insecure_global_id_reclaim false
8、查看相关页面
# ceph mgr services
Prometheus
http://192.168.217.145:9092/
grafana
https://192.168.217.145:3000/
Alertmanager
http://192.168.217.145:9093/
Dashboard
https://os-compute2:8443/
Ceph Exporter
http://os-compute2:9283/
Node Exporter
http://192.168.217.145:9100/