Skip to content

Commit 9063727

Browse files
committed
Add user management to dashboard
Add VM batch init script for testing Add ceph-exporter configuration Move ceph and cephos settings to /cephos
1 parent c51bb19 commit 9063727

29 files changed

+394
-68
lines changed

live_build_config/hooks/normal/0300-metrics.chroot

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ set -e
44

55
systemctl disable prometheus-node-exporter.service
66
systemctl disable telegraf.service
7+
systemctl disable ceph-exporter.service
78
systemctl disable smartctl-exporter.service
89

910
rm -rf /var/log/telegraf /etc/init.d/telegraf

live_build_config/hooks/normal/0400-clean-ceph.chroot

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,12 @@ do
77
systemctl disable $unit || true
88
done
99

10-
for dr in "/etc/ceph" "/var/lib/ceph" "/var/log/ceph" "/var/run/ceph"
10+
for dr in "/etc/ceph" "/var/lib/ceph"
11+
do
12+
rm -rf ${dr}
13+
done
14+
15+
for dr in "/var/log/ceph" "/var/run/ceph"
1116
do
1217
rm -rf ${dr}/*
1318
done
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Set the command-line arguments to pass to the server.
2+
# Due to shell escaping, to pass backslashes for regexes, you need to double
3+
# them (\\d for \d). If running under systemd, you need to double them again
4+
# (\\\\d to mean \d), and escape newlines too.
5+
ARGS="--addrs :: --port 9106"

live_build_config/includes.chroot_after_packages/etc/default/telegraf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
# Due to shell escaping, to pass backslashes for regexes, you need to double
33
# them (\\d for \d). If running under systemd, you need to double them again
44
# (\\\\d to mean \d), and escape newlines too.
5-
TELEGRAF_OPTS=""
5+
ARGS=""
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
[Unit]
2+
Description=Ceph cluster exporter daemon
3+
PartOf=ceph.target
4+
After=network-online.target local-fs.target
5+
Before=ceph.target
6+
Wants=network-online.target local-fs.target ceph.target ceph-mon.target
7+
8+
[Service]
9+
EnvironmentFile=/etc/default/ceph-exporter
10+
ExecReload=/bin/kill -HUP $MAINPID
11+
ExecStart=/usr/bin/ceph-exporter -f --id admin --setuser ceph --setgroup ceph $ARGS
12+
PrivateTmp=true
13+
Restart=on-failure
14+
RestartSec=10
15+
StartLimitBurst=3
16+
StartLimitInterval=30min
17+
StandardError=journal
18+
StandardOutput=journal
19+
SyslogIdentifier=ceph_exporter
20+
21+
[Install]
22+
WantedBy=multi-user.target ceph.target

live_build_config/includes.chroot_after_packages/etc/systemd/system/telegraf.service

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,15 @@ Wants=network-online.target
88
Type=notify
99
EnvironmentFile=-/etc/default/telegraf
1010
User=telegraf
11-
ExecStart=/usr/bin/telegraf -config /etc/telegraf/telegraf.conf -config-directory /etc/telegraf/telegraf.d $TELEGRAF_OPTS
11+
ExecStart=/usr/bin/telegraf -config /etc/telegraf/telegraf.conf -config-directory /etc/telegraf/telegraf.d $ARGS
1212
ExecReload=/bin/kill -HUP $MAINPID
1313
Restart=on-failure
1414
RestartForceExitStatus=SIGPIPE
1515
KillMode=control-group
1616
LimitMEMLOCK=8M:8M
17+
StandardError=journal
18+
StandardOutput=journal
19+
SyslogIdentifier=telegraf
1720

1821
[Install]
1922
WantedBy=multi-user.target
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#!/usr/bin/env bash
2+
3+
. /usr/local/lib/cephos/base.sh.lib
4+
. /usr/local/lib/cephos/config.sh.lib
5+
. /usr/local/lib/cephos/cephos.sh.lib
6+
7+
function apply_environment()
8+
{
9+
echo "CLUSTER=ceph"
10+
echo "CEPH_CLUSTER=ceph"
11+
echo "CEPH_CONF='${ceph_main_conf}'"
12+
}

live_build_config/includes.chroot_after_packages/usr/local/bin/cephos-append-disk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ if [[ ! -f "${ceph_conf_dir}/ceph.client.bootstrap-osd.keyring" ]]
5959
then
6060
sudo ln -s ${ceph_data_dir}/bootstrap-osd/ceph.keyring ${ceph_conf_dir}/ceph.client.bootstrap-osd.keyring
6161
fi
62-
sudo ceph-volume \
62+
${sudo_ceph} ceph-volume \
6363
lvm create \
6464
--data "${block_device}" \
6565
--objectstore bluestore

live_build_config/includes.chroot_after_packages/usr/local/bin/cephos-cephfs-top

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@
44
. /usr/local/lib/cephos/config.sh.lib
55
. /usr/local/lib/cephos/cephos.sh.lib
66

7-
sudo cephfs-top --conffile ${ceph_main_conf} --cluster ceph --id admin
7+
${sudo_ceph} cephfs-top --conffile ${ceph_main_conf} --cluster ceph --id admin

live_build_config/includes.chroot_after_packages/usr/local/bin/cephos-connect-to-cluster

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ spread_ssh_key "${user_home}" "${current_user}" "${cluster_node}"
115115
log_info "SSH key successfully copied to ${cluster_node}"
116116

117117
create_directories
118-
copy_file_from_host "${cluster_node}" "${cephos_environment_location}/cluster.ini"
118+
copy_file_from_host "${cluster_node}" "${cephos_conf}/cluster.ini"
119119
copy_file_from_host "${cluster_node}" "${ceph_conf_dir}/ceph.conf"
120120
copy_file_from_host "${cluster_node}" "${ceph_conf_dir}/ceph.client.admin.keyring"
121121
copy_file_from_host "${cluster_node}" "${ceph_data_dir}/bootstrap-osd/ceph.keyring"

0 commit comments

Comments
 (0)