]> git.proxmox.com Git - pve-docs.git/blob - ceph-server.adoc
add ceph macro
[pve-docs.git] / ceph-server.adoc
1 Ceph Server on Proxmox VE Cluster
2 ---------------------------------
3
4 It is possible to install the Ceph storage server directly on the
5 Proxmox VE cluster nodes. The VMs and Containers can access that
6 storage using the
7 xref:ceph_rados_block_devices[Ceph RADOS Block Devices (RBD)] storage
8 driver.
9
10
11 Precondition
12 ~~~~~~~~~~~~
13
14 There should be at least three (preferably) identical servers for setup which build together a Proxmox Cluster.
15
16
17 A 10Gb network is recommmended, exclusively used for Ceph. If there are no 10Gb switches available meshed network is
18 also an option, see {webwiki-url}Full_Mesh_Network_for_Ceph_Server[wiki].
19
20
21 Check also the recommendations from http://docs.ceph.com/docs/jewel/start/hardware-recommendations/[Ceph's Website].
22
23
24 Installation of Ceph Packages
25 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
26
27
28 On each node run the installation script as follows:
29
30 [source,bash]
31 ----
32 pveceph install -version jewel
33 ----
34
35
36 This sets up an 'apt' package repository in /etc/apt/sources.list.d/ceph.list and installs the required software.
37
38
39 Creating initial Ceph configuration
40 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
41
42 After installation of packages, you need to create an initial Ceph configuration on just one node, based on your network (10.10.10.0/24 in the following example) dedicated for Ceph:
43
44 [source,bash]
45 ----
46 pveceph init --network 10.10.10.0/24
47 ----
48
49 This creates an initial config at /etc/pve/ceph.conf. That file is automatically distributed to all Proxmox VE nodes by using xref:chapter_pmxcfs[pmxcfs]. The command also creates a symbolic link from /etc/ceph/ceph.conf pointing to that file. So you can simply run Ceph commands without the need to specify a configuration file.
50
51
52 Creating Ceph Monitors
53 ~~~~~~~~~~~~~~~~~~~~~~
54
55 On each node where a monitor is requested (at least 3 are recommended) create it by using the "Ceph" item in the GUI or run
56
57
58 [source,bash]
59 ----
60 pveceph createmon
61 ----
62
63
64 Creating Ceph OSDs
65 ~~~~~~~~~~~~~~~~~~
66
67
68 via GUI or via CLI as follows:
69
70 [source,bash]
71 ----
72 pveceph createosd /dev/sd[X]
73 ----
74
75 If you want to use a dedicated SSD journal disk:
76
77 NOTE: In order to use a dedicated journal disk (SSD), the disk needs to have a GPT partition table. You can create this with 'gdisk /dev/sd(x)'. If there is no GPT, you cannot select the disk as journal. Currently the journal size is fixed to 5 GB.
78
79
80 [source,bash]
81 ----
82 pveceph createosd /dev/sd[X] -journal_dev /dev/sd[X]
83 ----
84
85 Example: /dev/sdf as data disk (4TB) and /dev/sdb is the dedicated SSD journal disk
86
87 [source,bash]
88 ----
89 pveceph createosd /dev/sdf -journal_dev /dev/sdb
90 ----
91
92
93 This partitions the disk (data and journal partition), creates filesystems and starts the OSD, afterwards it is running and fully functional. Please create at least 12 OSDs, distributed among your nodes (4 on each node).
94
95 It should be noted that this command refuses to initialize disk when it detects existing data. So if you want to overwrite a disk you should remove existing data first. You can do that using:
96
97 [source,bash]
98 ----
99 ceph-disk zap /dev/sd[X]
100 ----
101
102
103 You can create OSDs containing both journal and data partitions or you can place the journal on a dedicated SSD. Using a SSD journal disk is highly recommended if you expect good performance.
104
105
106
107 Ceph Pools
108 ~~~~~~~~~~
109
110
111 The standard installation creates per default the pool 'rbd', additional pools can be created via GUI.
112
113
114
115 Ceph Client
116 ~~~~~~~~~~~
117
118
119 You can then configure Proxmox VE to use such pools to store VM images, just use the GUI ("Add Storage": RBD, see section xref:ceph_rados_block_devices[Ceph RADOS Block Devices (RBD)]).
120
121
122 You also need to copy the keyring to a predefined location.
123 NOTE: that the file name needs to be storage id + .keyring - storage id is the expression after 'rbd:' in /etc/pve/storage.cfg which is 'my-ceph-storage' in the following example:
124
125 [source,bash]
126 ----
127 mkdir /etc/pve/priv/ceph
128 cp /etc/ceph/ceph.client.admin.keyring /etc/pve/priv/ceph/my-ceph-storage.keyring
129 ----
130
131
132
133
134
135
136
137
138
139
140