80f5988b9ccf94a2061f1d6625ce968d79f0056a
configuration/on-site-scripts/paris2024/launch-replicas-in-all-regions.sh
| ... | ... | @@ -15,7 +15,7 @@ if [ $# -eq 0 ]; then |
| 15 | 15 | echo "Will launch as many new replicas in regions $( cat `dirname $0`/regions.txt ) with the release specified with -R" |
| 16 | 16 | echo "as there are currently healthy auto-replicas registered with the S-paris2024 target group in the region (at least one)" |
| 17 | 17 | echo "which will register at the master proxy paris-ssh.internal.sapsailing.com:8888 and RabbitMQ at" |
| 18 | - echo "rabbit-ap-northeast-1.sapsailing.com:5672, then when healthy get added to target group S-paris2024" |
|
| 18 | + echo "rabbit-eu-west-3.sapsailing.com:5672, then when healthy get added to target group S-paris2024" |
|
| 19 | 19 | echo "in that region, with all auto-replicas registered before removed from the target group." |
| 20 | 20 | exit 2 |
| 21 | 21 | fi |
configuration/on-site-scripts/paris2024/launch-replicas-in-region.sh
| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | #!/bin/bash |
| 2 | -INSTANCE_TYPE=c5.2xlarge |
|
| 2 | +INSTANCE_TYPE=c5.4xlarge |
|
| 3 | 3 | REPLICA_SET_NAME=replica |
| 4 | 4 | REPLICA_SET_PRIMARY=localhost |
| 5 | 5 | KEY_NAME=Axel |
| ... | ... | @@ -25,7 +25,7 @@ if [ $# -eq 0 ]; then |
| 25 | 25 | echo |
| 26 | 26 | echo "Will launch one or more (see -c) new replicas in the AWS region specified with -g with the release specified with -R" |
| 27 | 27 | echo "which will register at the master proxy paris-ssh.internal.sapsailing.com:8888 and RabbitMQ at" |
| 28 | - echo "rabbit-ap-northeast-1.sapsailing.com:5672, then when healthy get added to target group S-paris2024" |
|
| 28 | + echo "rabbit-eu-west-3.sapsailing.com:5672, then when healthy get added to target group S-paris2024" |
|
| 29 | 29 | echo "in that region, with all auto-replicas registered before removed from the target group." |
| 30 | 30 | echo "Specify -r and -p if you are launching in eu-west-1 because it has a special non-default environment." |
| 31 | 31 | exit 2 |
| ... | ... | @@ -79,7 +79,7 @@ REPLICATE_MASTER_SERVLET_PORT=8888 |
| 79 | 79 | REPLICATE_MASTER_EXCHANGE_NAME=paris2024 |
| 80 | 80 | REPLICATE_MASTER_QUEUE_HOST=rabbit-eu-west-3.sapsailing.com |
| 81 | 81 | REPLICATE_MASTER_BEARER_TOKEN=${BEARER_TOKEN} |
| 82 | -ADDITIONAL_JAVA_ARGS=\"${ADDITIONAL_JAVA_ARGS} -Dcom.sap.sse.debranding=true\"" --ebs-optimized --key-name $KEY_NAME --tag-specifications "ResourceType=instance,Tags=[{Key=Name,Value=SL Paris2024 (Upgrade Replica)},{Key=sailing-analytics-server,Value=paris2024}]" "ResourceType=volume,Tags=[{Key=Name,Value=SL Paris2024 (Upgrade Replica)}]" | jq -r '.Instances[].PrivateIpAddress + " " + .Instances[].InstanceId' ) |
|
| 82 | +ADDITIONAL_JAVA_ARGS=\"${ADDITIONAL_JAVA_ARGS} -Dcom.sap.sse.debranding=false\"" --ebs-optimized --key-name $KEY_NAME --tag-specifications "ResourceType=instance,Tags=[{Key=Name,Value=SL Paris2024 (Upgrade Replica)},{Key=sailing-analytics-server,Value=paris2024}]" "ResourceType=volume,Tags=[{Key=Name,Value=SL Paris2024 (Upgrade Replica)}]" | jq -r '.Instances[].PrivateIpAddress + " " + .Instances[].InstanceId' ) |
|
| 83 | 83 | EXIT_CODE=$? |
| 84 | 84 | if [ "${EXIT_CODE}" != "0" ]; then |
| 85 | 85 | echo "Error launching instance in region ${REGION}. Exiting with status ${EXIT_CODE}" |
configuration/on-site-scripts/paris2024/monitor-tokyo2020-reachability-from-regions
| ... | ... | @@ -1,34 +0,0 @@ |
| 1 | -#!/bin/bash |
|
| 2 | -# Probe for valid AWS MFA token |
|
| 3 | -EXPIRY_MARKER_FILE=/tmp/aws-mfa-token-expired |
|
| 4 | -aws ec2 describe-instances >/dev/null 2>/dev/null |
|
| 5 | -EXIT_CODE=$? |
|
| 6 | -if [ "${EXIT_CODE}" = "255" ]; then |
|
| 7 | - if [ ! -f "${EXPIRY_MARKER_FILE}" ]; then |
|
| 8 | - message="AWS MFA token seems to have expired. aws ec2 describe-instances exited with code ${EXIT_CODE}. Not messaging you again. Try another awsmfa as root@sapsailing.com's tmux." |
|
| 9 | - echo "${message}" | notify-operators "AWS MFA token expired" |
|
| 10 | - touch "${EXPIRY_MARKER_FILE}" |
|
| 11 | - else |
|
| 12 | - echo "AWS MFA token expired, but we had sent e-mail already." |
|
| 13 | - fi |
|
| 14 | -else |
|
| 15 | - # Discover replicas |
|
| 16 | - IPs="" |
|
| 17 | - for i in $( cat `dirname $0`/regions.txt ); do |
|
| 18 | - IPs="$( aws --region $i ec2 describe-instances --filters Name=instance-state-name,Values=running Name=tag:sailing-analytics-server,Values=paris2024 | jq .Reservations[].Instances[].PublicIpAddress -r )" |
|
| 19 | - if [ -z "${IPs}" ]; then |
|
| 20 | - echo "Couldn't find a running replica in region $i" >&2 |
|
| 21 | - message="Couldn't find a running replica in region $i" |
|
| 22 | - echo "${message}" | notify-operators "${message}" |
|
| 23 | - else |
|
| 24 | - read first others <<<"${IPs}" |
|
| 25 | - if ! ssh -o StrictHostKeyChecking=no root@${first} "curl https://paris2024.sapsailing.com/gwt/status 2>/dev/null >/dev/null"; then |
|
| 26 | - echo "Problem reaching paris2024.sapsailing.com from instance ${first} in region ${i}" >&2 |
|
| 27 | - message="Problem reaching paris2024.sapsailing.com from instance ${first} in region ${i}" |
|
| 28 | - echo "${message}" | notify-operators "${message}" |
|
| 29 | - else |
|
| 30 | - echo "Access from region ${i}, IP ${first} OK." >&2 |
|
| 31 | - fi |
|
| 32 | - fi |
|
| 33 | - done |
|
| 34 | -fi |
configuration/on-site-scripts/paris2024/upgrade-landscape.sh
| ... | ... | @@ -3,20 +3,19 @@ |
| 3 | 3 | # The procedure works in the following steps: |
| 4 | 4 | # - patch *.conf files in sap-p1-1:servers/[master|security_service] and sap-p1-2:servers/[secondary_master|replica|master|security_service] so |
| 5 | 5 | # their INSTALL_FROM_RELEASE points to the new ${RELEASE} |
| 6 | -# - Install new releases to sap-p1-1:servers/[master|security_service] and sap-p1-2:servers/[replica|master|security_service] |
|
| 6 | +# - Install new releases to sap-p1-1:servers/[master|security_service] and sap-p1-2:servers/[secondary_master|replica|master|security_service] |
|
| 7 | 7 | # - Update all launch configurations and auto-scaling groups in the cloud (update-launch-configuration.sh) |
| 8 | 8 | # - Tell all replicas in the cloud to stop replicating (stop-all-cloud-replicas.sh) |
| 9 | -# - Tell sap-p1-2 to stop replicating |
|
| 9 | +# - Tell sap-p1-2 secondary_master to restart (./stop; ./start) |
|
| 10 | 10 | # - on sap-p1-1:servers/master run ./stop; ./start to bring the master to the new release |
| 11 | 11 | # - wait until master is healthy |
| 12 | -# - on sap-p1-2:servers/replica run ./stop; ./start to bring up on-site replica again |
|
| 13 | 12 | # - launch upgraded cloud replicas and replace old replicas in target group (launch-replicas-in-all-regions.sh) |
| 14 | -# - terminate all instances named "SL Paris2024 (auto-replica)"; this should cause the auto-scaling group to launch new instances as required |
|
| 13 | +# - terminate all instances named "SL paris2024 (Auto-Replica)"; this should cause the auto-scaling group to launch new instances as required |
|
| 15 | 14 | # - manually inspect the health of everything and terminate the "SL Paris2024 (Upgrade Replica)" instances when enough new instances |
| 16 | -# named "SL Paris2024 (auto-replica)" are available |
|
| 15 | +# named "SL paris2024 (Auto-Replica)" are available |
|
| 17 | 16 | # |
| 18 | 17 | KEY_NAME=Axel |
| 19 | -INSTANCE_NAME_TO_TERMINATE="SL Paris2024 (auto-replica)" |
|
| 18 | +INSTANCE_NAME_TO_TERMINATE="SL paris2024 (Auto-Replica)" |
|
| 20 | 19 | if [ $# -eq 0 ]; then |
| 21 | 20 | echo "$0 -R <release-name> -b <replication-bearer-token> [-t <instance-type>] [-i <ami-id>] [-k <key-pair-name>] [-s]" |
| 22 | 21 | echo "" |
| ... | ... | @@ -35,14 +34,13 @@ if [ $# -eq 0 ]; then |
| 35 | 34 | echo " - Install new releases to sap-p1-1:servers/[master|security_service] and sap-p1-2:servers/[secondary_master|replica|master|security_service]" |
| 36 | 35 | echo " - Update all launch configurations and auto-scaling groups in the cloud (update-launch-configuration.sh)" |
| 37 | 36 | echo " - Tell all replicas in the cloud to stop replicating (stop-all-cloud-replicas.sh)" |
| 38 | - echo " - Tell sap-p1-2 to stop replicating" |
|
| 37 | + echo " - Tell sap-p1-2 secondary_master to restart (./stop; ./start)" |
|
| 39 | 38 | echo " - on sap-p1-1:servers/master run ./stop; ./start to bring the master to the new release" |
| 40 | 39 | echo " - wait until master is healthy" |
| 41 | - echo " - on sap-p1-2:servers/replica run ./stop; ./start to bring up on-site replica again" |
|
| 42 | 40 | echo " - launch upgraded cloud replicas and replace old replicas in target group (launch-replicas-in-all-regions.sh)" |
| 43 | - echo " - terminate all instances named \"SL Paris2024 (auto-replica)\"; this should cause the auto-scaling group to launch new instances as required" |
|
| 41 | + echo " - terminate all instances named \"${INSTANCE_NAME_TO_TERMINATE}\"; this should cause the auto-scaling group to launch new instances as required" |
|
| 44 | 42 | echo " - manually inspect the health of everything and terminate the \"SL Paris2024 (Upgrade Replica)\" instances when enough new instances" |
| 45 | - echo " named \"SL Paris2024 (auto-replica)\" are available" |
|
| 43 | + echo " named \"${INSTANCE_NAME_TO_TERMINATE}\" are available" |
|
| 46 | 44 | exit 2 |
| 47 | 45 | fi |
| 48 | 46 | options='R:b:t:i:k:s' |
| ... | ... | @@ -104,11 +102,11 @@ if [ "${EXIT_CODE}" != "0" ]; then |
| 104 | 102 | echo "Telling cloud replicas to stop replicating failed with exit code ${EXIT_CODE}" |
| 105 | 103 | exit ${EXIT_CODE} |
| 106 | 104 | fi |
| 107 | -echo " * Telling replica on sap-p1-2 to stop replicating" |
|
| 108 | -ssh sailing@sap-p1-2 "cd servers/replica; ./stopReplicating.sh ${BEARER_TOKEN}" |
|
| 105 | +echo " * Re-launching secondary master on sap-p1-2 to new release ${RELEASE}" |
|
| 106 | +ssh sailing@sap-p1-2 "bash --login -c 'cd servers/secondary_master; ./stop; ./start'" |
|
| 109 | 107 | EXIT_CODE=$? |
| 110 | 108 | if [ "${EXIT_CODE}" != "0" ]; then |
| 111 | - echo "Telling sap-p1-2 replica to stop replicating failed with exit code ${EXIT_CODE}" |
|
| 109 | + echo "Re-launching secondary master on sap-p1-2 failed with exit code ${EXIT_CODE}" |
|
| 112 | 110 | exit ${EXIT_CODE} |
| 113 | 111 | fi |
| 114 | 112 | echo " * Re-launching master on sap-p1-1 to new release ${RELEASE} and waiting for it to become healthy" |
| ... | ... | @@ -118,13 +116,6 @@ if [ "${EXIT_CODE}" != "0" ]; then |
| 118 | 116 | echo "Re-launching master on sap-p1-1 failed with exit code ${EXIT_CODE}" |
| 119 | 117 | exit ${EXIT_CODE} |
| 120 | 118 | fi |
| 121 | -echo " * Re-launching replica on sap-p1-2 to new release ${RELEASE}" |
|
| 122 | -ssh sailing@sap-p1-2 "bash --login -c 'cd servers/replica; ./stop; ./start'" |
|
| 123 | -EXIT_CODE=$? |
|
| 124 | -if [ "${EXIT_CODE}" != "0" ]; then |
|
| 125 | - echo "Re-launching replica on sap-p1-2 failed with exit code ${EXIT_CODE}" |
|
| 126 | - exit ${EXIT_CODE} |
|
| 127 | -fi |
|
| 128 | 119 | echo " * Launching upgraded replicas SL Paris2024 (Upgrade Replica) in the regions" |
| 129 | 120 | OPTIONS="-b ${BEARER_TOKEN} -R ${RELEASE}" |
| 130 | 121 | if [ -n "${IMAGE_ID}" ]; then |
wiki/info/landscape/paris2024/olympic-setup.md
| ... | ... | @@ -294,6 +294,9 @@ server { |
| 294 | 294 | ssl_protocols TLSv1 TLSv1.1 TLSv1.2; |
| 295 | 295 | ssl_ciphers HIGH:!aNULL:!MD5; |
| 296 | 296 | |
| 297 | + # set client body size to 100MB |
|
| 298 | + client_max_body_size 100M; |
|
| 299 | + |
|
| 297 | 300 | location / { |
| 298 | 301 | proxy_pass http://127.0.0.1:8888; |
| 299 | 302 | } |
| ... | ... | @@ -315,6 +318,9 @@ server { |
| 315 | 318 | ssl_protocols TLSv1 TLSv1.1 TLSv1.2; |
| 316 | 319 | ssl_ciphers HIGH:!aNULL:!MD5; |
| 317 | 320 | |
| 321 | + # set client body size to 100MB |
|
| 322 | + client_max_body_size 100M; |
|
| 323 | + |
|
| 318 | 324 | location / { |
| 319 | 325 | proxy_pass http://127.0.0.1:8888; |
| 320 | 326 | } |
| ... | ... | @@ -604,22 +610,21 @@ The ``Event`` object is owned by ``paris2024-moderators``, and that group grants |
| 604 | 610 | |
| 605 | 611 | ## Landscape Upgrade Procedure |
| 606 | 612 | |
| 607 | -In the ``configuration/on-site-scripts`` we have prepared a number of scripts intended to be useful for local and cloud landscape management. TL;DR: |
|
| 613 | +In the ``configuration/on-site-scripts/paris2024`` we have prepared a number of scripts intended to be useful for local and cloud landscape management. TL;DR: |
|
| 608 | 614 | ``` |
| 609 | 615 | configuration/on-site-scripts/upgrade-landscape.sh -R {release-name} -b {replication-bearer-token} |
| 610 | 616 | ``` |
| 611 | 617 | will upgrade the entire landscape to the release ``{release-name}`` (e.g., build-202107210711). The ``{replication-bearer-token}`` must be provided such that the user authenticated by that token will have the permission to stop replication and to replicate the ``paris2024`` master. |
| 612 | 618 | |
| 613 | 619 | The script will proceed in the following steps: |
| 614 | - - patch ``*.conf`` files in ``sap-p1-1:servers/[master|security_service]`` and ``sap-p1-2:servers/[replica|master|security_service]`` so |
|
| 620 | + - patch ``*.conf`` files in ``sap-p1-1:servers/[master|security_service]`` and ``sap-p1-2:servers/[secondary_master|replica|master|security_service]`` so |
|
| 615 | 621 | their ``INSTALL_FROM_RELEASE`` points to the new ``${RELEASE}`` |
| 616 | - - Install new releases to ``sap-p1-1:servers/[master|security_service]`` and ``sap-p1-2:servers/[replica|master|security_service]`` |
|
| 622 | + - Install new releases to ``sap-p1-1:servers/[master|security_service]`` and ``sap-p1-2:servers/[secondary_master|replica|master|security_service]`` |
|
| 617 | 623 | - Update all launch configurations and auto-scaling groups in the cloud (``update-launch-configuration.sh``) |
| 618 | 624 | - Tell all replicas in the cloud to stop replicating (``stop-all-cloud-replicas.sh``) |
| 619 | - - Tell ``sap-p1-2`` to stop replicating |
|
| 625 | + - Tell ``sap-p1-2:servers/secondary_master`` to restart (./stop; ./start) |
|
| 620 | 626 | - on ``sap-p1-1:servers/master`` run ``./stop; ./start`` to bring the master to the new release |
| 621 | 627 | - wait until master is healthy |
| 622 | - - on ``sap-p1-2:servers/replica`` run ``./stop; ./start`` to bring up on-site replica again |
|
| 623 | 628 | - launch upgraded cloud replicas and replace old replicas in target group (``launch-replicas-in-all-regions.sh``) |
| 624 | 629 | - terminate all instances named "SL Paris2024 (auto-replica)"; this should cause the auto-scaling group to launch new instances as required |
| 625 | 630 | - manually inspect the health of everything and terminate the "SL Paris2024 (Upgrade Replica)" instances when enough new instances |