Skip to content

Commit

Permalink
Merge pull request #84 from rhcs-dashboard/multisite-in-ceph2
Browse files Browse the repository at this point in the history
support multisite in ceph2 setup
  • Loading branch information
nizamial09 authored Jun 3, 2024
2 parents 1f8e87a + 24cfeb2 commit 99bdde2
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 25 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -308,14 +308,14 @@ docker-compose exec ceph /docker/sso/sso-disable.sh
RGW_MULTISITE=1
```

* Start ceph (cluster 1) + ceph cluster 2:
* Start ceph (cluster 1) + ceph2 (cluster 2):
```
docker-compose up -d --scale ceph-cluster2=1
docker-compose up -d --scale ceph2=1 --scale prometheus2=1
```

* Run 100s duration [benchmark](https://github.com/markhpc/hsbench#usage):
```
docker-compose exec ceph-cluster2 bash
docker-compose exec ceph2 bash
hsbench -a <rgw-user-access-key> -s <rgw-user-secret-key> -u http://127.0.0.1:8000 -z 4K -d 100 -t 10 -b 10
```

Expand Down
6 changes: 0 additions & 6 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,6 @@ services:
ports: ['${CEPH_PROXY_HOST_PORT:-4200}:4200','${CEPH_HOST_PORT:-11000}:11000']
scale: 1

ceph-cluster2:
extends:
service: ceph-base
container_name: ceph-cluster2
hostname: ceph-cluster2

ceph-host2:
extends:
service: ceph-base
Expand Down
2 changes: 1 addition & 1 deletion docker/ceph/set-rgw.sh
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ if [[ "$RGW_MULTISITE" == 1 ]]; then
echo -n "{$(cat ${RGW_REALM_USER_ACCESS_KEY_FILE} | sed 's/,$//')}" > "${RGW_REALM_USER_ACCESS_KEY_FILE}"
echo -n "{$(cat ${RGW_REALM_USER_SECRET_KEY_FILE} | sed 's/,$//')}" > "${RGW_REALM_USER_SECRET_KEY_FILE}"
else
readonly FIRST_CLUSTER_HOSTNAME=$(hostname | sed -e 's/-cluster.//')
readonly FIRST_CLUSTER_HOSTNAME=$(hostname | sed -e 's/2//g')
readonly CLUSTER2_PULL_REALM="${REALM_NAME_PREFIX}1"
readonly CLUSTER2_ZONEGROUP="${ZONEGROUP_NAME_PREFIX}1-${CLUSTER2_PULL_REALM}"
readonly CLUSTER2_ZONE="${ZONE_NAME_PREFIX}3-${CLUSTER2_ZONEGROUP}"
Expand Down
11 changes: 2 additions & 9 deletions docker/ceph/set-start-env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,14 @@ set -e
[[ -d "$MGR_PYTHON_PATH"/dashboard/frontend ]] && export IS_UPSTREAM_LUMINOUS=0
[[ -z "$RGW" ]] && export RGW=1

export IS_FIRST_CLUSTER=$(hostname | grep -v cluster | wc -l)
export IS_FIRST_CLUSTER=$(hostname | grep -v ceph2 | wc -l)

[[ ("$IS_CEPH_RPM" == 0 || -n "$CEPH_REPO_DIR") && "$IS_UPSTREAM_LUMINOUS" == 0 && "$IS_FIRST_CLUSTER" == 1 ]] \
[[ ("$IS_CEPH_RPM" == 0 || -n "$CEPH_REPO_DIR") && "$IS_UPSTREAM_LUMINOUS" == 0 ]] \
&& export FRONTEND_BUILD_REQUIRED=1
FRONTEND_BUILD_OPTIONS=${FRONTEND_BUILD_OPTIONS:-"--deleteOutputPath=false"}

if [[ "$RGW_MULTISITE" == 1 ]]; then
export RGW=0 # Required to prevent vstart from starting any rgw daemon.

if [[ "$IS_FIRST_CLUSTER" == 0 ]]; then
export FS=0
export MDS=0
export MGR=0
export MON=1
fi
fi

RGW_DEBUG=''
Expand Down
10 changes: 4 additions & 6 deletions docker/ceph/start-ceph.sh
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,8 @@ if [[ "$RGW" -gt 0 || "$RGW_MULTISITE" == 1 ]]; then
fi

# Enable prometheus module
if [[ "$IS_FIRST_CLUSTER" == 1 ]]; then
"$CEPH_BIN"/ceph mgr module enable prometheus
echo 'Prometheus mgr module enabled.'
fi
"$CEPH_BIN"/ceph mgr module enable prometheus
echo 'Prometheus mgr module enabled.'

#Enable and set test_orchestrator module
if [[ "$TEST_ORCHESTRATOR" == 1 ]]; then
Expand All @@ -75,7 +73,7 @@ fi

# Disable ssl (if selected)
readonly VSTART_HAS_SSL_FLAG=$(cat /ceph/src/vstart.sh | grep DASHBOARD_SSL | wc -l)
if [[ "$DASHBOARD_SSL" == 0 && "$VSTART_HAS_SSL_FLAG" == 0 && "$IS_FIRST_CLUSTER" == 1 ]]; then
if [[ "$DASHBOARD_SSL" == 0 && "$VSTART_HAS_SSL_FLAG" == 0 ]]; then
echo "Disabling SSL..."

SSL_OPTIONS='--force'
Expand All @@ -91,7 +89,7 @@ if [[ "$DASHBOARD_SSL" == 0 && "$VSTART_HAS_SSL_FLAG" == 0 && "$IS_FIRST_CLUSTER
fi

# Secondary cluster start (or upstream mimic start) ends here.
[[ "$IS_FIRST_CLUSTER" == 0 || "$CEPH_VERSION" -le '13' ]] && exit 0
[[ "$CEPH_VERSION" -le '13' ]] && exit 0

# Create dashboard "test" user:
[[ "$CEPH_VERSION" -gt '14' ]] && DASHBOARD_USER_CREATE_OPTIONS='--force-password'
Expand Down

0 comments on commit 99bdde2

Please sign in to comment.