Skip to content

Commit 29a55aa

Browse files
committed
Add README.md
1 parent 11c9bf6 commit 29a55aa

2 files changed

Lines changed: 76 additions & 9 deletions

File tree

README.md

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
# Docker Container for Apache CloudStack Management Server
2+
3+
This repository maintains the Dockerfile and scripts to build docker image for Apache CloudStack Management Server.
4+
5+
## Steps
6+
7+
### (Optional) Build docker image
8+
9+
docker build -f Dockerfile -t ustcweizhou/cloudstack-management .
10+
11+
### Update docker-compose configuration
12+
13+
Edit cloudstack-mgt01.yaml and update to proper configuration
14+
15+
### Install docker-compose
16+
17+
apt install docker-compose -y
18+
19+
### Create the containers
20+
21+
docker-compose -f cloudstack-mgt01.yaml up -d
22+
23+
### List the containers
24+
25+
docker-compose -f cloudstack-mgt01.yaml ps
26+
27+
## Advanced steps
28+
29+
### Access the containers via docker-compose
30+
31+
docker-compose -f cloudstack-mgt01.yaml exec mgt01 bash
32+
33+
### Access the containers via IP (from container host)
34+
35+
The container IP is accessible from other hosts, except the container host.
36+
37+
To access container IP from the container host, or vice versa:
38+
39+
ip link add cloudstack-nic link eth0 type macvlan mode bridge
40+
ip addr add 10.0.33.6/20 dev cloudstack-nic (only if the host IP is in different range as container IP)
41+
ip link set cloudstack-nic up
42+
ip route add 10.0.34.217/32 dev cloudstack-nic
43+
44+
### Install CloudStack database
45+
46+
You need to install mysql server in advance.
47+
You can create a mariadb galera cluster, refer to https://github.com/ustcweizhou/docker-mariadb-cluster
48+
49+
Please note, GET_LOCK is not supported if WSREP_ON is ON.
50+
51+
mysql> SELECT GET_LOCK('lock',10);
52+
ERROR 1235 (42000): This version of MariaDB doesn't yet support 'GET_LOCK in cluster (WSREP_ON=ON)'
53+
54+
To fix it, make the following change in the containers and restart them.
55+
56+
sed -i "s/wsrep_on = ON/wsrep_on = OFF/g" /etc/mysql/conf.d/90-galera.cnf
57+
58+
### Setup CloudStack database
59+
60+
cloudstack-setup-databases cloud:cloud@10.0.34.213:13306 \
61+
--deploy-as=root:cloudstack \
62+
-e file -m mgtkey -k dbkey -i 10.0.34.217
63+
64+
### Manage CloudStack services
65+
66+
To manage cloudstack management service:
67+
68+
/usr/bin/cloudstack-management status/start/stop/restart
69+
70+
To manage cloudstack usage service:
71+
72+
/usr/bin/cloudstack-usage status/start/stop/restart
73+

cloudstack-mgt01.yaml

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,14 @@
11
version: "2.4"
22
services:
33
mgt01:
4-
image: ubuntu:22.04
4+
image: ustcweizhou/cloudstack-management
55
hostname: mgt01
66
networks:
7-
cs:
7+
cloudstack:
88
ipv4_address: 10.0.34.217
9-
entrypoint: ["tail", "-f", "/dev/null"]
10-
expose:
11-
- 8250
12-
- 8080
13-
- 8096
14-
- 22
159

1610
networks:
17-
cs:
11+
cloudstack:
1812
driver: macvlan
1913
driver_opts:
2014
parent: eth0

0 commit comments

Comments
 (0)