Lesereplikatdatenbank für Systemaktivitäten erstellen
Mit Sammlungen den Überblick behalten
Sie können Inhalte basierend auf Ihren Einstellungen speichern und kategorisieren.
Die Funktion Elite-Systemaktivität ist nur für von Looker gehostete Instanzen verfügbar. Für vom Kunden gehostete Instanzen können Sie ein Lesereplikat der Looker-Backend-Datenbank erstellen, um einige der Vorteile der Elite-Systemaktivität zu nutzen.
So richten Sie ein Lesereplikat Ihrer MySQL-Backend-Datenbank ein und konfigurieren Looker so, dass es das Lesereplikat für Abfragen zu Systemaktivitäten verwendet:
Erstellen Sie ein Lesereplikat Ihrer MySQL-Backend-Datenbank. Wenn Sie beispielsweise ein MySQL-Lesereplikat in AWS erstellen möchten, folgen Sie der Anleitung in der Amazon-Dokumentation zum Arbeiten mit Lesereplikaten. Speichern Sie die DB-Instanz-ID und die Portnummer. Sie benötigen diese Informationen, um Looker im nächsten Schritt zu konfigurieren.
Erstellen Sie in Ihrer Looker-Instanz eine yaml-Datei mit dem Namen sa-db mit folgendem Inhalt:
Starten Sie Looker mit der Startoption--internal-analytics-connection-file sa-db.yml. Dadurch wird Looker so konfiguriert, dass für Abfragen zur Systemaktivität die in sa-db.yml konfigurierte Lesereplikatdatenbank verwendet wird.
Optional können Sie auch die folgenden Startoptionen verwenden, um die Konfiguration der Elite-Systemaktivität zu ändern:
--internal-analytics-retention-days=<number>: Standardmäßig werden unter „Systemaktivität“ Verlaufsdaten für 90 Tage gespeichert. Mit dieser Startoption können Sie angeben, wie viele Tage an Verlaufsdaten für die Systemaktivität gespeichert werden sollen. Wir empfehlen, die Datenaufbewahrung nicht über 90 Tage hinaus zu verlängern. Sie können sie jedoch verkürzen, um die Leistung zu verbessern. Wenn Sie die Aufbewahrungsdauer von Verlaufsdaten über die standardmäßigen 90 Tage hinaus verlängern möchten, fragen Sie Ihren Account Manager nach Looker-Hosting mit der Option Elite-Systemaktivität.
Wenn Sie mehr Tage als die Standardeinstellung benötigen, fragen Sie Ihren Account Manager nach Looker-Hosting mit der Option „Elite-Systemaktivität“.
--internal-analytics-connection-pool-size=<number>: Standardmäßig sind Abfragen zur Systemaktivität auf einen Datenbankverbindungspool mit einer Größe von 1 beschränkt. Das bedeutet, dass mehrere Abfragen für Systemanalysen in der Backend-Datenbank in der Warteschlange platziert und nacheinander ausgeführt werden. So wird verhindert, dass die interne Datenbank durch Abfragen der Systemanalyse überlastet wird. Mit dieser Startoption können Sie die Anzahl der gleichzeitigen System Analytics-Abfragen angeben, die ausgeführt werden können. Beispiel: 8.
Nachdem Sie die Leserreplikatdatenbank für Abfragen zur Systemaktivität konfiguriert haben, verwendet Looker weiterhin die Haupt-MySQL-Datenbank als interne Anwendungsdatenbank. Für Dashboards und Explores für die Systemaktivität wird die Datenbank mit dem Lesereplikat verwendet.
So prüfen Sie, ob Looker die Lesereplikdatenbank für Abfragen zur Systemaktivität verwendet:
Wenn Sie das Passwort in der Datei sa-db.yml ändern, geben Abfragen zur Systemaktivität einen Fehler zurück.
In der MySQL-Datenbank können Sie show processlist; ausführen, um die derzeit laufenden Prozesse aufzurufen. Die Haupt-Looker-Datenbank sollte viele offene Verbindungen im Ruhemodus enthalten, während in der looker__internal__analytics-Datenbank Analyseabfragen angezeigt werden.
Für Dashboards und Explores zur Systemaktivität wird die Datenbank des Lesereplikats verwendet. Bei den älteren i__looker-Explores wird jedoch weiterhin die primäre Backend-Datenbank abgefragt. Aktualisieren Sie alle gespeicherten Looks oder Dashboards, die i__looker abfragen, damit sie die Systemaktivität abfragen. Mit den auf dieser Dokumentationsseite beschriebenen Methoden können Sie dafür sorgen, dass für alle gespeicherten Looks und Dashboards die richtige Verbindung zur Datenbank mit dem Lesereplikat abgefragt wird.
[[["Leicht verständlich","easyToUnderstand","thumb-up"],["Mein Problem wurde gelöst","solvedMyProblem","thumb-up"],["Sonstiges","otherUp","thumb-up"]],[["Schwer verständlich","hardToUnderstand","thumb-down"],["Informationen oder Beispielcode falsch","incorrectInformationOrSampleCode","thumb-down"],["Benötigte Informationen/Beispiele nicht gefunden","missingTheInformationSamplesINeed","thumb-down"],["Problem mit der Übersetzung","translationIssue","thumb-down"],["Sonstiges","otherDown","thumb-down"]],["Zuletzt aktualisiert: 2025-07-31 (UTC)."],[],[],null,["# Creating a System Activity read replica database\n\nThe [Elite System Activity](/looker/docs/elite-system-activity) feature is available only for Looker-hosted instances. For customer-hosted instances, you can create a read replica of the Looker backend database to gain some of the benefits of Elite System Activity.\n\u003e To use this option, your instance must be configured to [use a MySQL backend database](/looker/docs/migrating-looker-backend-db-to-mysql).\n\u003e\n\u003e This option is available for customer-hosted instances only. For Looker-hosted instances, please [contact a Google Cloud sales specialist](https://cloud.google.com/contact).\n\nTo set up a read replica of your MySQL backend database and configure Looker to use the read replica for System Activity queries:\n\n1. Create a read replica of your MySQL backend database. For example, to create a MySQL read replica in AWS, follow the instructions in [Amazon's Working with Read Replicas](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_ReadRepl.html) documentation. Save the DB instance identifier and port number, you'll need those to configure Looker in the next step.\n\n2. On your Looker instance, create a `yaml` file named `sa-db`, containing the following:\n\n dialect: mysql\n host: \u003cDB instance identifier\u003e\n username: root\n password: \u003cpassword\u003e\n database: looker\n port: \u003cDB instance port\u003e\n\n3. Stop Looker.\n\n4. Start Looker with the [startup option](/looker/docs/startup-options) `--internal-analytics-connection-file sa-db.yml`. This configures Looker to use the read replica database configured in `sa-db.yml` for System Activity queries.\n\n5. Optionally, you can also use the following startup options to modify your Elite System Activity configuration:\n\n - `--internal-analytics-retention-days=\u003cnumber\u003e`: By default, System Activity stores 90 days of historical data. Use this startup option to specify how many days of historical data System Activty will store. We do not recommend increasing data retention beyond 90 days, but you can reduce the length of data retention to improve performance. If you want to increase historical data retention beyond the default 90 days, ask your account executive about Looker hosting with the [Elite System Activity](/looker/docs/elite-system-activity) option.\n\n If you want more days than the default, ask your account executive about Looker hosting with the Elite System Activity option\n - `--internal-analytics-connection-pool-size=\u003cnumber\u003e`: By default, System Activity queries are limited to a database connection pool size of 1, meaning that multiple System Analytics queries will queue and run serially in the backend database. This protects the internal database from being overloaded with System Analytics queries. Use this startup option to specify the number of concurrent System Analytics queries that can be run simultaneously. For example, 8.\n\nOnce configured to use the read replica database for System Activity queries, Looker will continue to use main MySQL database as the internal application database. System Activity dashboards and Explores will use the read replica database.\n\nTo verify that Looker is using the read replica database for System Activity queries:\n\n- If you change the password in the `sa-db.yml` file, System Activity queries will return an error.\n- On the MySQL database, you can run `show processlist;` to see the current running processes. The main Looker database should show many open connections that are in a sleep state, while the `looker__internal__analytics` database will show analytical queries.\n\n\u003e System Activity dashboards and Explores will use the read replica database, but the legacy `i__looker` Explores will still query the primary backend database. Update any saved Looks or dashboards that query `i__looker` to cause them to query System Activity. Use the methods described on this documentation page to ensure that any saved Looks and dashboards are querying the correct connection to the read replica database."]]