1200字范文,内容丰富有趣,写作的好帮手!
1200字范文 > Rook+ceph+wordpress部署

Rook+ceph+wordpress部署

时间:2019-11-28 09:55:44

相关推荐

Rook+ceph+wordpress部署

接Ceph Storage Quickstart

ceph部署完成后,又部署了toolbox

查看到已经部署到了192-168-60-14节点

kubectl -n rook-ceph get pod -l "app=rook-ceph-tools" -o wide NAME READY STATUS RESTARTS AGE IP NODE NOMINATED NODE READINESS GATESrook-ceph-tools-bffbf4d8f-j95t4 1/1 Running 0 2d3h 192.168.60.14 192-168-60-14 <none> <none>

登陆到pod

kubectl -n rook-ceph exec -it rook-ceph-tools-bffbf4d8f-j95t4 bash

查看相关状态

ceph statuscluster:id: 839900a9-cd8b-4642-9abd-409044240a72health: HEALTH_OKservices:mon: 3 daemons, quorum a,d,fmgr: a(active)osd: 3 osds: 3 up, 3 indata:pools: 1 pools, 100 pgsobjects: 120 objects, 313 MiBusage: 29 GiB used, 67 GiB / 96 GiB availpgs: 100 active+cleanceph df GLOBAL:SIZE AVAIL RAW USED %RAW USED 96 GiB 67 GiB 29 GiB 30.03 POOLS:NAME ID USED %USED MAX AVAIL OBJECTS replicapool 3 313 MiB 0.51 60 GiB 120 ceph osd status+----+---------------+-------+-------+--------+---------+--------+---------+-----------+| id | host | used | avail | wr ops | wr data | rd ops | rd data | state |+----+---------------+-------+-------+--------+---------+--------+---------+-----------+| 0 | 192-168-60-14 | 8815M | 23.3G | 0 | 0 | 0 | 0 | exists,up || 1 | 192-168-60-13 | 10.4G | 21.5G | 0 | 0 | 0 | 0 | exists,up || 2 | 192-168-60-15 | 9973M | 22.2G | 0 | 0 | 0 | 0 | exists,up |+----+---------------+-------+-------+--------+---------+--------+---------+-----------+

rook创建pool和storageclass

cd rook/cluster/examples/kubernetes/cephkubectl create -f storageclass.yamlkubectl get storageclass

查看配置

cat storageclass.yaml apiVersion: ceph.rook.io/v1kind: CephBlockPoolmetadata:name: replicapool //pool名称namespace: rook-ceph //namespace名称spec:replicated:size: 1---apiVersion: storage.k8s.io/v1kind: StorageClassmetadata:name: rook-ceph-block //storageclass名称provisioner: ceph.rook.io/blockparameters:blockPool: replicapool# Specify the namespace of the rook cluster from which to create volumes.# If not specified, it will use `rook` as the default namespace of the cluster.# This is also the namespace where the cluster will beclusterNamespace: rook-ceph# Specify the filesystem type of the volume. If not specified, it will use `ext4`.fstype: xfs# (Optional) Specify an existing Ceph user that will be used for mounting storage with this StorageClass.#mountUser: user1# (Optional) Specify an existing Kubernetes secret name containing just one key holding the Ceph user secret.# The secret must exist in each namespace(s) where the storage will be consumed.#mountSecret: ceph-user1-secret

创建wordpress范例

kubectl create -f mysql.yaml kubectl create -f wordpress.yaml

可以在master节点查看pv

kubectl get pvcNAME STATUS VOLUME CAPACITY ACCESS MODES STORAGECLASS AGEmysql-pv-claim Bound pvc-3697baa1-7157-11e9-abeb-b8ac6f13153f 20Gi RWO rook-ceph-block 87mwp-pv-claim Bound pvc-3bd8669c-7157-11e9-abeb-b8ac6f13153f 20Gi RWO rook-ceph-block 87mkubectl get pvNAME CAPACITY ACCESS MODES RECLAIM POLICY STATUS CLAIM STORAGECLASS REASON AGEpvc-3697baa1-7157-11e9-abeb-b8ac6f13153f 20Gi RWO Delete Bound default/mysql-pv-claim rook-ceph-block 87mpvc-3bd8669c-7157-11e9-abeb-b8ac6f13153f 20Gi RWO Delete Bound default/wp-pv-claim rook-ceph-block 87m

也可以登陆到toolbox所在pod通过命令查看

rbd ls replicapool pvc-3697baa1-7157-11e9-abeb-b8ac6f13153fpvc-3bd8669c-7157-11e9-abeb-b8ac6f13153frbd info -p replicapool pvc-3697baa1-7157-11e9-abeb-b8ac6f13153frbd image 'pvc-3697baa1-7157-11e9-abeb-b8ac6f13153f':size 20 GiB in 5120 objectsorder 22 (4 MiB objects)id: cee46b8b4567block_name_prefix: rbd_data.cee46b8b4567format: 2features: layeringop_features: flags: create_timestamp: Wed May 8 06:05:03

登陆pod查看rbd块设备

kubectl get podNAME READY STATUS RESTARTS AGEwordpress-595685cc49-lrfms 1/1 Running 0 91mwordpress-mysql-b78774f44-rxj8z 1/1 Running 0 91m[root@192-168-60-13 kubernetes]# kubectl exec -it wordpress-595685cc49-lrfms bashroot@wordpress-595685cc49-lrfms:/var/www/html# df -h/dev/rbd1 20G 60M 20G 1% /var/www/html

查看wordpress的集群状态和端口

kubectl get svc wordpressNAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGEwordpress LoadBalancer 10.100.217.113 <pending> 80:32731/TCP 95m

ceph集群页面查看

wordpress

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。