1
1
# REX-Ray + Ceph RBD
2
2
3
- This is a Vagrant environment using ` VirtualBox ` and
4
- ` Virtual Media ` as storage for Ceph to be consumed by REX-Ray along with
5
- Docker as the container runtime. This can be used as a quick way
6
- to get started working with Ceph and REX-Ray.
3
+ This Vagrant environment uses ` VirtualBox ` and ` Virtual Media ` as storage for
4
+ Ceph to be consumed by REX-Ray. Docker is used as the container runtime allowing
5
+ a quick way to get started using Ceph and REX-Ray.
7
6
8
7
The ` RBD ` storage driver within REX-Ray is attaching RADOS Block Devices (RBD)
9
- to the Vagrant VMs. This enables the persistent volumes to be
10
- moved between containers, which allow container hosts to be immutable and
11
- containers to remain non-persistent.
8
+ to the Vagrant VMs. This enables the persistent volumes to be moved between
9
+ containers, which allow container hosts to be immutable and containers to remain
10
+ non-persistent.
11
+
12
+ The environment uses 3 Virtual Machines. One machine labeled as ` ceph-admin ` to
13
+ be used for running the containers and checking cluster status. The other two
14
+ machines, ` ceph-server-1 ` and ` ceph-server-2 ` are providing storage.
12
15
13
16
## Installation
14
17
15
18
### Clone the repo
16
19
```
17
20
git clone https://github.com/codedellemc/vagrant
18
21
cd vagrant/ceph
22
+ ssh-add ~/.vagrant.d/insecure_private_key
19
23
vagrant up
20
24
```
21
25
22
- ## Usage
23
- When the Vagrant environment is up and running, you can now run
24
- ` vagrant ssh ceph-admin ` to get into the VM. Since REX-Ray requires root
25
- privileges for mounting, etc you can at this point issue something similar to
26
- ` sudo -i ` to ensure you are running as root.
27
-
28
- You can check the status of the Ceph cluster with ` ceph -s ` . You should be
29
- able to immediately run commands like ` rexray volume create ` and
30
- ` rexray volume ls ` , or do the same thing with docker via ` docker volume create `
31
- and ` docker volume ls `
32
-
33
26
** NOTE** : The VMs contain the default Vagrant insecure SSH public key, such that
34
27
` vagrant ssh ` works by default. However, the ` ceph-admin ` VM needs to be able to
35
28
SSH to the other VMs in order to configure Ceph via ` ceph-deploy ` . In order to
36
- do this, the Vagrant SSH private key must be in your local SSH agent. The most
29
+ do this, the Vagrant SSH private key must be in your local SSH agent. Configuration of the Ceph cluster will not work without this step. The most
37
30
typical way to accomplish this on a nix-like machine is by running the command:
38
31
39
32
```
40
33
ssh-add ~/.vagrant.d/insecure_private_key
41
34
```
42
35
43
- Configuration of the Ceph cluster will not work without this step.
36
+
37
+ ## Usage
38
+ When the Vagrant environment is up and running, run ` vagrant ssh ceph-admin ` to
39
+ get into the VM. Since REX-Ray requires root privileges for mounting, etc,
40
+ run the rest of the lab as root:
41
+
42
+ ```
43
+ sudo -i
44
+ ```
45
+
46
+ Check the status of the Ceph cluster with:
47
+
48
+ ```
49
+ ceph -s
50
+ ```
51
+
52
+ The REX-Ray command line is available at this time:
53
+
54
+ ```
55
+ rexray volume create <name> --size=X
56
+ rexray volume ls
57
+ ```
58
+
59
+ The Docker Command line can be invoked as well for volume operation
60
+
61
+ ```
62
+ docker volume create -d rexray --name <name> --opt=size=X
63
+ docker volume ls
64
+ ```
65
+
66
+ Go to the [ Application Demo of {code} Labs] ( https://github.com/codedellemc/labs#application-demo ) to look at running applications like Postgres.
67
+
44
68
45
69
## Options
46
70
There are optional fields in the ` Vagrantfile ` that can be modified or
@@ -57,7 +81,7 @@ commented and uncommented.
57
81
58
82
Only one of the install options is intended to be set to true at one time.
59
83
Setting multiple to true will result in wasted work, as each one overwrites the
60
- other. Setting all to false will result in no new rexray being installed,
84
+ other. Setting all to ` false ` will result in rexray not being installed,
61
85
leaving whatever happens to be pre-installed in the vagrant box.
62
86
63
87
When using ` install_rex_from_source ` , it is also possible to modify the
@@ -69,15 +93,21 @@ Consult the full REX-Ray documentation [here](http://rexray.readthedocs.org/en/s
69
93
70
94
Get information on the existing volumes:
71
95
72
- ` rexray volume ls `
96
+ ```
97
+ rexray volume ls
98
+ ```
73
99
74
100
Create a new volume:
75
101
76
- ` rexray volume create --size=20 test `
102
+ ```
103
+ rexray volume create --size=20 test
104
+ ```
77
105
78
106
Delete a volume:
79
107
80
- ` rexray volume remove test `
108
+ ```
109
+ rexray volume remove test
110
+ ```
81
111
82
112
## Docker
83
113
Consult the Docker and REX-Ray documentation [ here] ( http://rexray.readthedocs.io/en/stable/user-guide/schedulers/#docker ) .
0 commit comments