7ea04f7953dde5ab05e92c7055979be5cfbeeec2
java/com.sap.sailing.landscape.common/META-INF/MANIFEST.MF
| ... | ... | @@ -11,3 +11,4 @@ Require-Bundle: com.sap.sse.security.common, |
| 11 | 11 | com.sap.sse.landscape.aws.common |
| 12 | 12 | Bundle-ActivationPolicy: lazy |
| 13 | 13 | Export-Package: com.sap.sailing.landscape.common |
| 14 | +Import-Package: software.amazon.awssdk.regions |
java/com.sap.sailing.landscape.common/src/com/sap/sailing/landscape/common/SharedLandscapeConstants.java
| ... | ... | @@ -20,6 +20,15 @@ public interface SharedLandscapeConstants { |
| 20 | 20 | */ |
| 21 | 21 | String DEFAULT_SECURITY_SERVICE_REPLICA_SET_NAME = "security-service"; |
| 22 | 22 | |
| 23 | + String RABBIT_IN_DEFAULT_REGION_HOSTNAME = "rabbit.internal.sapsailing.com"; |
|
| 24 | + |
|
| 25 | + String DEFAULT_REGION = "eu-west-1"; |
|
| 26 | + |
|
| 27 | + /** |
|
| 28 | + * We maintain a DNS entry for "rabbit.internal.sapsailing.com" (see {@link #RABBIT_IN_DEFAULT_REGION_HOSTNAME}) in this region |
|
| 29 | + */ |
|
| 30 | + String REGION_WITH_RABBITMQ_DNS_HOSTNAME = DEFAULT_REGION; |
|
| 31 | + |
|
| 23 | 32 | /** |
| 24 | 33 | * This is the region of the load balancer handling the default traffic for {@code *.sapsailing.com}. It is also |
| 25 | 34 | * called the "dynamic" load balancer because adding, removing or changing any hostname-based rule in its HTTPS |
| ... | ... | @@ -38,8 +47,14 @@ public interface SharedLandscapeConstants { |
| 38 | 47 | * for archived events. If such a state is reached, "dynamic" load balancing may potentially be used regardless |
| 39 | 48 | * the region. |
| 40 | 49 | */ |
| 41 | - String REGION_WITH_DEFAULT_LOAD_BALANCER = "eu-west-1"; |
|
| 42 | - |
|
| 50 | + String REGION_WITH_DEFAULT_LOAD_BALANCER = DEFAULT_REGION; |
|
| 51 | + |
|
| 52 | + /** |
|
| 53 | + * Tag name used to identify instances on which a RabbitMQ installation is running. The tag value is currently interpreted to |
|
| 54 | + * be the port number (usually 5672) on which the RabbitMQ endpoint can be reached. |
|
| 55 | + */ |
|
| 56 | + String RABBITMQ_TAG_NAME = "RabbitMQEndpoint"; |
|
| 57 | + |
|
| 43 | 58 | /** |
| 44 | 59 | * The tag value used to identify host images that can be launched in order to run one or more Sailing Analytics |
| 45 | 60 | * server processes on it. |
java/com.sap.sailing.www/release_notes_admin.html
| ... | ... | @@ -23,6 +23,15 @@ |
| 23 | 23 | <div class="mainContent"> |
| 24 | 24 | <h2 class="releaseHeadline">Release Notes - Administration Console</h2> |
| 25 | 25 | <div class="innerContent"> |
| 26 | + <h2 class="articleSubheadline">January 2024</h2> |
|
| 27 | + <ul class="bulletList"> |
|
| 28 | + <li>When launching a new application replica set in a region, the choice of the default RabbitMQ |
|
| 29 | + server now depends on the region: in our "default" region "eu-west-1", RabbitMQ is identified |
|
| 30 | + by the DNS-mapped host name "rabbit.internal.sapsailing.com". Elsewhere, the RabbitMQ server |
|
| 31 | + in the region is explored using the RabbitMQEndpoint tag. If not found, again |
|
| 32 | + "rabbit.internal.sapsailing.com" will be used, assuming there may be a VPC peering across |
|
| 33 | + regions.</li> |
|
| 34 | + </ul> |
|
| 26 | 35 | <h2 class="articleSubheadline">October 2023</h2> |
| 27 | 36 | <ul class="bulletList"> |
| 28 | 37 | <li>TracTrac and YellowBrick passwords are no longer sent back to the client; there were ways to discover |
java/com.sap.sse.landscape.aws.test/src/com/sap/sse/landscape/aws/ConnectivityTest.java
| ... | ... | @@ -51,6 +51,7 @@ import com.sap.sse.landscape.aws.orchestration.CreateDNSBasedLoadBalancerMapping |
| 51 | 51 | import com.sap.sse.landscape.impl.ReleaseRepositoryImpl; |
| 52 | 52 | import com.sap.sse.landscape.mongodb.MongoEndpoint; |
| 53 | 53 | import com.sap.sse.landscape.mongodb.impl.DatabaseImpl; |
| 54 | +import com.sap.sse.landscape.rabbitmq.RabbitMQEndpoint; |
|
| 54 | 55 | import com.sap.sse.landscape.ssh.SSHKeyPair; |
| 55 | 56 | import com.sap.sse.landscape.ssh.SshCommandChannel; |
| 56 | 57 | |
| ... | ... | @@ -535,4 +536,25 @@ public class ConnectivityTest<ProcessT extends AwsApplicationProcess<String, Sai |
| 535 | 536 | assertEquals(200, healthCheckConnection.getResponseCode()); |
| 536 | 537 | healthCheckConnection.disconnect(); |
| 537 | 538 | } |
| 539 | + |
|
| 540 | + @Test |
|
| 541 | + public void getDefaultRabbitConfigForEuWest1() { |
|
| 542 | + final RabbitMQEndpoint rabbitConfig = landscape.getDefaultRabbitConfiguration(new AwsRegion(Region.EU_WEST_1, landscape)); |
|
| 543 | + assertEquals("rabbit.internal.sapsailing.com", rabbitConfig.getNodeName()); |
|
| 544 | + assertEquals(5672, rabbitConfig.getPort()); |
|
| 545 | + } |
|
| 546 | + |
|
| 547 | + @Test |
|
| 548 | + public void getDefaultRabbitConfigForEuWest2() { |
|
| 549 | + final RabbitMQEndpoint rabbitConfig = landscape.getDefaultRabbitConfiguration(new AwsRegion(Region.EU_WEST_2, landscape)); |
|
| 550 | + assertTrue(rabbitConfig.getNodeName().startsWith("172.31.")); |
|
| 551 | + assertEquals(5672, rabbitConfig.getPort()); |
|
| 552 | + } |
|
| 553 | + |
|
| 554 | + @Test |
|
| 555 | + public void getDefaultRabbitConfigForRegionWithNoTaggedInstanceInIt() { |
|
| 556 | + final RabbitMQEndpoint rabbitConfig = landscape.getDefaultRabbitConfiguration(new AwsRegion(Region.US_EAST_2, landscape)); |
|
| 557 | + assertEquals("rabbit.internal.sapsailing.com", rabbitConfig.getNodeName()); |
|
| 558 | + assertEquals(5672, rabbitConfig.getPort()); |
|
| 559 | + } |
|
| 538 | 560 | } |
java/com.sap.sse.landscape.aws/META-INF/MANIFEST.MF
| ... | ... | @@ -26,7 +26,8 @@ Require-Bundle: com.amazon.aws.aws-java-api;bundle-version="2.13.50", |
| 26 | 26 | com.sap.sse.replication.interfaces, |
| 27 | 27 | com.sap.sse.operationaltransformation, |
| 28 | 28 | org.mongodb.driver-core;bundle-version="4.3.1", |
| 29 | - org.mongodb.driver-sync;bundle-version="4.3.1" |
|
| 29 | + org.mongodb.driver-sync;bundle-version="4.3.1", |
|
| 30 | + com.sap.sailing.landscape.common |
|
| 30 | 31 | Web-ContextPath: /landscape |
| 31 | 32 | Import-Package: org.apache.shiro;version="1.2.2", |
| 32 | 33 | org.osgi.framework;version="1.8.0", |
java/com.sap.sse.landscape.aws/src/com/sap/sse/landscape/aws/AwsLandscape.java
| ... | ... | @@ -34,7 +34,6 @@ import com.sap.sse.landscape.mongodb.MongoProcess; |
| 34 | 34 | import com.sap.sse.landscape.mongodb.MongoProcessInReplicaSet; |
| 35 | 35 | import com.sap.sse.landscape.mongodb.MongoReplicaSet; |
| 36 | 36 | import com.sap.sse.landscape.mongodb.impl.MongoProcessImpl; |
| 37 | -import com.sap.sse.landscape.rabbitmq.RabbitMQEndpoint; |
|
| 38 | 37 | import com.sap.sse.landscape.ssh.SSHKeyPair; |
| 39 | 38 | |
| 40 | 39 | import software.amazon.awssdk.auth.credentials.AwsBasicCredentials; |
| ... | ... | @@ -129,12 +128,6 @@ public interface AwsLandscape<ShardingKey> extends Landscape<ShardingKey> { |
| 129 | 128 | |
| 130 | 129 | String MONGO_REPLICA_SET_NAME_AND_PORT_SEPARATOR = ":"; |
| 131 | 130 | |
| 132 | - /** |
|
| 133 | - * Tag name used to identify instances on which a RabbitMQ installation is running. The tag value is currently interpreted to |
|
| 134 | - * be the port number (usually 5672) on which the RabbitMQ endpoint can be reached. |
|
| 135 | - */ |
|
| 136 | - String RABBITMQ_TAG_NAME = "RabbitMQEndpoint"; |
|
| 137 | - |
|
| 138 | 131 | String CENTRAL_REVERSE_PROXY_TAG_NAME = "CentralReverseProxy"; |
| 139 | 132 | |
| 140 | 133 | /** |
| ... | ... | @@ -677,13 +670,6 @@ public interface AwsLandscape<ShardingKey> extends Landscape<ShardingKey> { |
| 677 | 670 | |
| 678 | 671 | Iterable<MongoEndpoint> getMongoEndpoints(Region region); |
| 679 | 672 | |
| 680 | - /** |
|
| 681 | - * Gets a default RabbitMQ configuration for the {@code region} specified.<p> |
|
| 682 | - * |
|
| 683 | - * TODO For now, the method searches for accordingly-tagged instances and picks the first one it finds. We need to extend this to RabbitMQ replication. |
|
| 684 | - */ |
|
| 685 | - RabbitMQEndpoint getDefaultRabbitConfiguration(AwsRegion region); |
|
| 686 | - |
|
| 687 | 673 | Database getDatabase(Region region, String databaseName); |
| 688 | 674 | |
| 689 | 675 | /** |
java/com.sap.sse.landscape.aws/src/com/sap/sse/landscape/aws/impl/AwsLandscapeImpl.java
| ... | ... | @@ -35,6 +35,7 @@ import java.util.regex.Pattern; |
| 35 | 35 | import com.jcraft.jsch.JSch; |
| 36 | 36 | import com.jcraft.jsch.JSchException; |
| 37 | 37 | import com.jcraft.jsch.KeyPair; |
| 38 | +import com.sap.sailing.landscape.common.SharedLandscapeConstants; |
|
| 38 | 39 | import com.sap.sse.common.Duration; |
| 39 | 40 | import com.sap.sse.common.TimePoint; |
| 40 | 41 | import com.sap.sse.common.Util; |
| ... | ... | @@ -1463,26 +1464,32 @@ public class AwsLandscapeImpl<ShardingKey> implements AwsLandscape<ShardingKey> |
| 1463 | 1464 | } |
| 1464 | 1465 | |
| 1465 | 1466 | @Override |
| 1466 | - public RabbitMQEndpoint getDefaultRabbitConfiguration(AwsRegion region) { |
|
| 1467 | + public RabbitMQEndpoint getDefaultRabbitConfiguration(com.sap.sse.landscape.Region region) { |
|
| 1468 | + final RabbitMQEndpoint defaultRabbitMQInDefaultRegion = ()->SharedLandscapeConstants.RABBIT_IN_DEFAULT_REGION_HOSTNAME; // using default port RabbitMQEndpoint.DEFAULT_PORT |
|
| 1467 | 1469 | final RabbitMQEndpoint result; |
| 1468 | - final Iterable<AwsInstance<ShardingKey>> rabbitMQHostsInRegion = getRunningHostsWithTag(region, RABBITMQ_TAG_NAME, AwsInstanceImpl::new); |
|
| 1469 | - if (rabbitMQHostsInRegion.iterator().hasNext()) { |
|
| 1470 | - final AwsInstance<ShardingKey> anyRabbitMQHost = rabbitMQHostsInRegion.iterator().next(); |
|
| 1471 | - result = new RabbitMQEndpoint() { |
|
| 1472 | - @Override |
|
| 1473 | - public int getPort() { |
|
| 1474 | - return getTag(anyRabbitMQHost, RABBITMQ_TAG_NAME) |
|
| 1475 | - .map(t -> t.trim().isEmpty() ? RabbitMQEndpoint.DEFAULT_PORT : Integer.valueOf(t.trim())) |
|
| 1476 | - .orElse(RabbitMQEndpoint.DEFAULT_PORT); |
|
| 1477 | - } |
|
| 1478 | - |
|
| 1479 | - @Override |
|
| 1480 | - public String getNodeName() { |
|
| 1481 | - return anyRabbitMQHost.getPrivateAddress().getHostAddress(); |
|
| 1482 | - } |
|
| 1483 | - }; |
|
| 1470 | + if (region.getId().equals(Region.EU_WEST_1.id())) { |
|
| 1471 | + result = defaultRabbitMQInDefaultRegion; |
|
| 1484 | 1472 | } else { |
| 1485 | - result = null; |
|
| 1473 | + final Iterable<AwsInstance<ShardingKey>> rabbitMQHostsInRegion = getRunningHostsWithTag( |
|
| 1474 | + region, SharedLandscapeConstants.RABBITMQ_TAG_NAME, AwsInstanceImpl::new); |
|
| 1475 | + if (rabbitMQHostsInRegion.iterator().hasNext()) { |
|
| 1476 | + final AwsInstance<ShardingKey> anyRabbitMQHost = rabbitMQHostsInRegion.iterator().next(); |
|
| 1477 | + result = new RabbitMQEndpoint() { |
|
| 1478 | + @Override |
|
| 1479 | + public int getPort() { |
|
| 1480 | + return getTag(anyRabbitMQHost, SharedLandscapeConstants.RABBITMQ_TAG_NAME) |
|
| 1481 | + .map(t -> t.trim().isEmpty() ? RabbitMQEndpoint.DEFAULT_PORT : Integer.valueOf(t.trim())) |
|
| 1482 | + .orElse(RabbitMQEndpoint.DEFAULT_PORT); |
|
| 1483 | + } |
|
| 1484 | + |
|
| 1485 | + @Override |
|
| 1486 | + public String getNodeName() { |
|
| 1487 | + return anyRabbitMQHost.getPrivateAddress().getHostAddress(); |
|
| 1488 | + } |
|
| 1489 | + }; |
|
| 1490 | + } else { |
|
| 1491 | + result = defaultRabbitMQInDefaultRegion; // no instance with tag found; hope for VPC peering and use RabbitMQ hostname from default region |
|
| 1492 | + } |
|
| 1486 | 1493 | } |
| 1487 | 1494 | return result; |
| 1488 | 1495 | } |
| ... | ... | @@ -1493,17 +1500,6 @@ public class AwsLandscapeImpl<ShardingKey> implements AwsLandscape<ShardingKey> |
| 1493 | 1500 | } |
| 1494 | 1501 | |
| 1495 | 1502 | @Override |
| 1496 | - public RabbitMQEndpoint getMessagingConfigurationForDefaultCluster(com.sap.sse.landscape.Region region) { |
|
| 1497 | - final RabbitMQEndpoint result; |
|
| 1498 | - if (region.getId().equals(Region.EU_WEST_1.id())) { |
|
| 1499 | - result = ()->"rabbit.internal.sapsailing.com"; |
|
| 1500 | - } else { |
|
| 1501 | - result = null; |
|
| 1502 | - } |
|
| 1503 | - return result; |
|
| 1504 | - } |
|
| 1505 | - |
|
| 1506 | - @Override |
|
| 1507 | 1503 | public <MetricsT extends ApplicationProcessMetrics, ProcessT extends AwsApplicationProcess<ShardingKey, MetricsT, ProcessT>, |
| 1508 | 1504 | HostT extends ApplicationProcessHost<ShardingKey, MetricsT, ProcessT>> |
| 1509 | 1505 | Iterable<HostT> getApplicationProcessHostsByTag(com.sap.sse.landscape.Region region, String tagName, |
java/com.sap.sse.landscape.aws/src/com/sap/sse/landscape/aws/orchestration/AwsApplicationConfiguration.java
| ... | ... | @@ -9,6 +9,7 @@ import com.sap.sse.landscape.DefaultProcessConfigurationVariables; |
| 9 | 9 | import com.sap.sse.landscape.InboundReplicationConfiguration; |
| 10 | 10 | import com.sap.sse.landscape.OutboundReplicationConfiguration; |
| 11 | 11 | import com.sap.sse.landscape.ProcessConfigurationVariable; |
| 12 | +import com.sap.sse.landscape.Region; |
|
| 12 | 13 | import com.sap.sse.landscape.Release; |
| 13 | 14 | import com.sap.sse.landscape.UserDataProvider; |
| 14 | 15 | import com.sap.sse.landscape.application.ApplicationProcess; |
| ... | ... | @@ -43,7 +44,7 @@ implements UserDataProvider { |
| 43 | 44 | * {@link #getServerName() server name}.</li> |
| 44 | 45 | * <li>The {@link #setInboundReplicationConfiguration(InboundReplicationConfiguration) inbound replication} |
| 45 | 46 | * {@link InboundReplicationConfiguration#getInboundRabbitMQEndpoint() RabbitMQ endpoint} defaults to the region's |
| 46 | - * {@link AwsLandscape#getDefaultRabbitConfiguration(com.sap.sse.landscape.aws.impl.AwsRegion) default RabbitMQ |
|
| 47 | + * {@link AwsLandscape#getDefaultRabbitConfiguration(Region) default RabbitMQ |
|
| 47 | 48 | * configuration}. Note that this setting will take effect only if auto-replication is activated for one or more |
| 48 | 49 | * replicables (see {@link InboundReplicationConfiguration#getReplicableIds()}).</li> |
| 49 | 50 | * <li>The {@link #setOutboundReplicationConfiguration() outbound replication} |
java/com.sap.sse.landscape/src/com/sap/sse/landscape/Landscape.java
| ... | ... | @@ -49,10 +49,15 @@ public interface Landscape<ShardingKey> { |
| 49 | 49 | /** |
| 50 | 50 | * Obtains the default RabbitMQ configuration for the {@code region} specified. If nothing else is specified |
| 51 | 51 | * explicitly, application server replica sets launched in the {@code region} shall use this for their replication |
| 52 | - * message channels and exchanges. |
|
| 52 | + * message channels and exchanges.<p> |
|
| 53 | + * |
|
| 54 | + * For our default region, this will return a DNS name always pointing to the current private IP of |
|
| 55 | + * the instance running the default RabbitMQ service in the region. In other regions, the private IP |
|
| 56 | + * of the regional default RabbitMQ instance is discovered by scanning for running instances tagged |
|
| 57 | + * with {@link SharedLandscapeConstants#RABBITMQ_TAG_NAME}. |
|
| 53 | 58 | */ |
| 54 | - RabbitMQEndpoint getMessagingConfigurationForDefaultCluster(Region region); |
|
| 55 | - |
|
| 59 | + RabbitMQEndpoint getDefaultRabbitConfiguration(Region region); |
|
| 60 | + |
|
| 56 | 61 | /** |
| 57 | 62 | * Tells the regions supported. The underlying hyperscaler may have more, but we may not want to run in all. |
| 58 | 63 | */ |
wiki/info/landscape/amazon-ec2.md
| ... | ... | @@ -187,10 +187,17 @@ A failover instance is kept ready to switch to in case the primary production ar |
| 187 | 187 | ### Important Amazon Machine Images (AMIs) |
| 188 | 188 | |
| 189 | 189 | In our default region ``eu-west-1`` there are four Amazon Machine Image (AMI) types that are relevant for the operation of the landscape. They all have a base name to which, separated by a space character, a version number consisting of a major and minor version, separated by a dot, is appended. Each of these AMIs has a tag ``image-type`` whose value reflects the type of the image. |
| 190 | -- SAP Sailing Analytics, ``image-type`` is ``sailing-analytics-server`` |
|
| 191 | -- MongoDB Live Replica Set NVMe, ``image-type`` is ``mongodb-server`` |
|
| 192 | -- Hudson Ubuntu Slave, ``image-type`` is ``hudson-slave`` |
|
| 193 | -- Webserver, ``image-type`` is ``webserver`` |
|
| 190 | +- SAP Sailing Analytics, ``image-type`` is ``sailing-analytics-server``, see [here](/wiki/info/landscape/creating-ec2-image-from-scratch) |
|
| 191 | +- MongoDB Live Replica Set NVMe, ``image-type`` is ``mongodb-server``, see [here](/wiki/info/landscape/creating-ec2-mongodb-image-from-scratch) |
|
| 192 | +- Hudson Debian/Ubuntu Slave, ``image-type`` is ``hudson-slave`` |
|
| 193 | +- Webserver, ``image-type`` is ``webserver``, see [here](/wiki/info/landscape/creating-ec2-image-for-webserver-from-scratch) |
|
| 194 | + |
|
| 195 | +There are furthermore instance types that we can configure automatically, based on a clean Amazon Linux 2 instance launched from the respective default Amazon image: |
|
| 196 | +- Hudson / dev.sapsailing.com server, see [here](/wiki/info/landscape/creating-ec2-image-for-hudson-from-scratch) |
|
| 197 | +- MySQL / MariaDB database server holding the data for our ``bugzilla.sapsailing.com`` bug/issue tracker, see [here](/wiki/info/landscape/creating-ec2-image-for-mysql-from-scratch) |
|
| 198 | +- RabbitMQ default instance used by all default sailing servers for replication, see [here](/wiki/info/landscape/creating-ec2-image-for-rabbitmq-from-scratch) |
|
| 199 | + |
|
| 200 | +We try to maintain setup scripts that help us with setting up those instance types from scratch. See the respective Wiki pages referenced from the lists above for more details. |
|
| 194 | 201 | |
| 195 | 202 | The SAP Sailing Analytics image is used to launch new instances, shared or dedicated, that host one or more Sailing Analytics application processes. The image contains an installation of the SAP JVM 8 under /opt/sapjvm_8, an Apache httpd service that is not currently used by default for reverse proxying / rewriting / logging activities, an initially empty directory ``/home/sailing/servers`` used to host default application process configurations, and an initialization script under ``/etc/init.d/sailing`` that handles the instance's initialization with a default application process from the EC2 instance's user data. Instructions for setting up such an image from scratch can be found [here](/wiki/info/landscape/creating-ec2-image-from-scratch). |
| 196 | 203 |
wiki/info/landscape/creating-ec2-image-for-mysql-from-scratch.md
| ... | ... | @@ -1,5 +1,17 @@ |
| 1 | -TODO: link here from some higher-level MarkDown Wiki document |
|
| 1 | +# Setting up an Instance for the MySQL / MariaDB Bugzilla Database |
|
| 2 | 2 | |
| 3 | -TODO: this is all based on configuration/mysql_instance_setup and in particular the setup-mysql-server.sh script therein |
|
| 3 | +Our Bugzilla system at [bugzilla.sapsailing.com](https://bugzilla.sapsailing.com) uses a relational database to store all the bugs and issues. This used to be a MySQL database and has been migrated to MariaDB at the beginning of 2024. |
|
| 4 | 4 | |
| 5 | -TODO: talk about the DNS record for mysql.internal.sapsailing.com which is used by Bugzilla running on the central reverse proxy |
|
| ... | ... | \ No newline at end of file |
| 0 | +We don't provide a dedicated AMI for this because we don't need to scale this out or replicate this by any means. Instead, we provide a script to set this up, starting from a clean Amazon Linux 2 instance. |
|
| 1 | + |
|
| 2 | +Launch a new instance, based on the latest Amazon Linux 2 AMI maintained by AWS, and configure the root volume size to be, e.g., 16GB. As of this writing, the total size consumed by the database contents on disk is less than 1GB. Tag the volume with a tag key ``WeeklySailingInfrastructureBackup`` and value ``Yes`` to include it in the weekly backup schedule. |
|
| 3 | + |
|
| 4 | +When the instance has finished booting up, run the following script, passing the external IP address of the instance as mandatory argument: |
|
| 5 | +``` |
|
| 6 | + configuration/mysql_instance_setup/setup-mysql-server.sh a.b.c.d |
|
| 7 | +``` |
|
| 8 | +where ``a.b.c.d`` stands for the external IP address you have to specify. Before the IP address you may optionally specify the passwords for the ``root`` and the ``bugs`` user of the existing database to be cloned to the new instance. Provide the ``root`` password with the ``-r`` option, the ``bugs`` password with the ``-b`` option. Passwords not provided this way will be prompted for. |
|
| 9 | + |
|
| 10 | +The script will then transfer itself to the instance and execute itself there, forwarding the passwords required. On the instance, it will then establish the periodic management of the login user's ``authorized_keys`` file for all landscape managers' keys, install the packages required (in particular mariadb105-server and cronie), then run a backup on the existing ``mysql.internal.sapsailing.com`` database using the ``root`` user and its password. The ``mysqldump`` client for this is run on ``sapsailing.com``, and the result is stored in the ``/tmp`` folder on the new instance where it is then imported. The import is a bit tricky in case this is a migration from MySQL to MariaDB where the users table has become a view. Therefore, a few additional ``DROP TABLE`` and ``DROP VIEW`` commands are issued before importing the data. When the import is complete, user privileges are flushed so they match with what has been imported. The DB is then re-started in "safe" mode so that the user passwords can be adjusted, in case this was a migration from MySQL to MariaDB. Finally, the DB is restarted properly with the new user passwords. |
|
| 11 | + |
|
| 12 | +The instance then is generally available for testing. Run a few ``mysql`` commands, check out the ``bugs`` database and its contents, especially those of the ``bugs.bugs`` table. If this all looks good, switch the DNS record for ``mysql.internal.sapsailing.com`` to the private IP of the new instance. This will be used by the Bugzilla installation running on our central reverse proxy. When this is done you can consider stopping and ultimately terminating the old DB server. |
wiki/info/landscape/creating-ec2-image-for-rabbitmq-from-scratch.md
| ... | ... | @@ -1,5 +1,19 @@ |
| 1 | -TODO: link here from some higher-level MarkDown Wiki document |
|
| 1 | +# Setting up a RabbitMQ Server Instance |
|
| 2 | 2 | |
| 3 | -TODO: this is all based on configuration/rabbitmq_instance_setup and in particular the setup-rabbitmq-server.sh script therein |
|
| 3 | +RabbitMQ is hard to install on latest versions of Amazon Linux (e.g., 2, or 2023). Therefore, we use a latest Debian 12 default image to start with. |
|
| 4 | 4 | |
| 5 | -TODO: don't forget to talk about the DNS entries and the elastic IP (is the elastic IP for the external RabbitMQ server's address really required?) as well as the tagging |
|
| ... | ... | \ No newline at end of file |
| 0 | +Configure the root volume to be at least 8GB. The empty installation takes about 1.6GB, so you will have enough room for messages queued persistently. |
|
| 1 | + |
|
| 2 | +When the instance has finished booting and SSH access is possible, invoke the following script, providing the instance's external IP address as only parameter: |
|
| 3 | +``` |
|
| 4 | + configuration/rabbitmq_instance_setup/setup-rabbitmq-server.sh a.b.c.d`` |
|
| 5 | +``` |
|
| 6 | +where ``a.b.c.d`` is the external IP address of your fresh instance. |
|
| 7 | + |
|
| 8 | +The script will ensure the login user's ``authorized_keys`` are updated periodically to contain those of the landscape managers, then will install the necessary packages, particularly ``rabbitmq-server`` and, to get real log files under ``/var/log``, the ``syslog-ng`` package. It then enables the ``rabbitmq_management`` plugin, so access to the management UI becomes possible through port ``15672``. The configuration file under ``/etc/rabbitmq/rabbitmq.conf`` is patched such that guest logins are possible also from non-localhost addresses, by adding the ``loopback_users = none`` directive to the config file. It finally (re-)starts the RabbitMQ server to let these config changes take effect. |
|
| 9 | + |
|
| 10 | +Your RabbitMQ server then should be ready to handle requests. Test this by invoking the management UI, e.g., through an ssh port forward to port ``15672``. When this seems good, pick a smart time to change the DNS record for ``rabbit.internal.sapsailing.com`` because there will be a short time of interruptions on all application processes currently connected to the old RabbitMQ which you then have to stop. Those client applications will temporarily lose connection, but our replication component will re-establish these connections, using the DNS name which gets resolved again based on the DNS entry's TTL. |
|
| 11 | + |
|
| 12 | +Then associate the elastic IP ``54.76.64.42`` as the external IP of the new instance. This will let ``rabbit.sapsailing.com`` point to the public IP of the instance. |
|
| 13 | + |
|
| 14 | +Add a tag with key ``RabbitMQEndpoint`` and value ``5672``, specifying the port on which the RabbitMQ server listens. This tag can be used by our landscape automation procedures to discover the RabbitMQ default instance in the region. |