Zum Inhalt springen
View in the app

A better way to browse. Learn more.

Fachinformatiker.de

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Wie sage ich einem Tomcat 9.5 unter Centos 8.3, dass er auf das MySQL warten soll, damit die datenbankgestützte Anwendung auch sauber startet?

Empfohlene Antworten

Veröffentlicht

Hallo

Wie sage ich einem Tomcat 9.5 unter Centos 8.3, dass er auf das MySQL warten soll, damit die datenbankgestützte Anwendung auch sauber startet?

Ciao

naja, der Tomcat hat zieht ein WAR, in dem eine Anwendung enthalten ist,

ungefähr "Broschuerenversand.firma.de",

diese speichert Informationen in der MySQL-Datenbank, damit später Broschürenversand erfolgen kann.

Zitat

The problem of waiting for a database (for example) to be ready is really just a subset of a much larger problem of distributed systems. In production, your database could become unavailable or move hosts at any time. Your application needs to be resilient to these types of failures.

To handle this, design your application to attempt to re-establish a connection to the database after a failure. If the application retries the connection, it can eventually connect to the database.

https://docs.docker.com/compose/startup-order/

Docker-Compose hatte eine Funktionalität um beispielsweise auf eine DB zu warten, die aber wieder entfernt wurde. Ich denke auch, dass eine Anwendung mit Datenbankausfällen klarkommen  muss. Dies würde ich auch außerhalb vom Dockeruniversum unterschreiben.

@han_trio yo, das wars, bin da noch nicht so sattelfest mit den Unit-Files.

Wenn du keinen Einfluss auf die Anwendung hast, kannst du Skripte wie wait-for-it nutzen, um auf die Datenbank zu warten. Dies löst aber nur das Problem beim Start der Anwendung.

Es kann immer mal sein, das die Datenbank nicht zur Verfügung steht  (Netzwerkprobleme oder Ähnliches). Dieses Scenario muss die Anwendung selbst abfangen.

Erstelle ein Konto oder melde dich an, um einen Kommentar zu schreiben.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.