From 9dd5b5ea35e19f1bdf71a5d1de458fd1cadfa3af Mon Sep 17 00:00:00 2001 From: root Date: Tue, 4 Aug 2026 07:09:37 +0000 Subject: [PATCH 1/4] docs: expand time synchronization section in installation prerequisites Add comprehensive NTP documentation across all 5 languages (en, zh, ja, de, fr): - Explain why time sync is critical for distributed deployments - Add clock drift tolerance warnings (15min max, 1s recommended) - Document 3 NTP tools: chrony (recommended), systemd-timesyncd, ntpd - Add verification commands: timedatectl, chronyc tracking/sources, ntpq - Add cross-node clock consistency check instructions Co-Authored-By: Claude --- .../linux/prerequisites-and-service.md | 145 +++++++++++++++++- .../linux/prerequisites-and-service.md | 145 +++++++++++++++++- .../linux/prerequisites-and-service.md | 145 +++++++++++++++++- .../linux/prerequisites-and-service.md | 145 +++++++++++++++++- .../linux/prerequisites-and-service.md | 145 +++++++++++++++++- 5 files changed, 710 insertions(+), 15 deletions(-) diff --git a/content/de/installation/linux/prerequisites-and-service.md b/content/de/installation/linux/prerequisites-and-service.md index 8917c54e..ae303e6c 100644 --- a/content/de/installation/linux/prerequisites-and-service.md +++ b/content/de/installation/linux/prerequisites-and-service.md @@ -40,15 +40,154 @@ RustFS requires at least 2 GB of memory for a test environment; production envir ## Time Synchronization -Multi-node consistency requires a time server to keep clocks consistent, otherwise services may fail to start. Use tools such as `ntp`, `timedatectl`, or `timesyncd`. +Alle Knoten in einer verteilten RustFS-Deployment müssen synchronisierte Uhren aufweisen. RustFS ist auf Zeitstempel für Anfragesignaturen, Objektversionierung, verteiltes Locking und Replikation angewiesen. Eine erhebliche Uhrenabweichung zwischen Knoten kann Folgendes verursachen: -Check the synchronization status with: +- **Fehler bei Anfragesignaturen** — Die S3-Signaturprüfung erfordert genaue Zeitstempel. +- **Replikations- und Konsistenzprobleme** — Uhrenversatz kann zu veralteten oder widersprüchlichen Objektversionen führen. +- **Lock-Konflikte** — Verteilte Locks verwenden Zeitstempel für die Leasedauer. +- **Fehler beim Starten des Dienstes** — RustFS verweigert den Start, wenn der Uhrenversatz zwischen den Knoten den sicheren Schwellenwert überschreitet. + +:::warning +Die Uhrenabweichung zwischen zwei Knoten darf **15 Minuten** nicht überschreiten. Für Produktionsumgebungen empfehlen wir, die Abweichung unter **1 Sekunde** zu halten. +::: + +### Empfohlene NTP-Tools + +Verwenden Sie auf **jedem Knoten** einen der folgenden Zeitsynchronisationsdienste. Wählen Sie ein Tool und konfigurieren Sie es einheitlich in der gesamten Deployment. + +#### chrony (Empfohlen) + +`chrony` ist die bevorzugte NTP-Implementierung für moderne Linux-Distributionen. Es synchronisiert schneller und geht besser mit intermittierender Netzwerkkonnektivität um als das ältere `ntpd`. + +chrony installieren: + +```bash +# RHEL / CentOS / Rocky Linux +sudo dnf install chrony -y + +# Ubuntu / Debian +sudo apt install chrony -y +``` + +Bearbeiten Sie die Konfigurationsdatei `/etc/chrony.conf` (RHEL) oder `/etc/chrony/chrony.conf` (Debian/Ubuntu), um Ihre bevorzugten NTP-Server anzugeben: + +```conf +server time1.google.com iburst +server time2.google.com iburst +server time3.google.com iburst +server time4.google.com iburst +``` + +> Ersetzen Sie die Serveradressen durch die internen NTP-Server Ihrer Organisation, falls verfügbar. Die Verwendung von `iburst` beschleunigt die Erstsynchronisation. + +Dienst aktivieren und starten: + +```bash +sudo systemctl enable chronyd +sudo systemctl start chronyd +``` + +#### systemd-timesyncd + +`systemd-timesyncd` ist ein leichtgewichtiger SNTP-Client, der in systemd-basierten Distributionen integriert ist. Er eignet sich für Umgebungen, in denen kein vollständiger NTP-Daemon erforderlich ist. + +Bearbeiten Sie `/etc/systemd/timesyncd.conf`, um NTP-Server zu konfigurieren: + +```ini +[Time] +NTP=time1.google.com time2.google.com time3.google.com time4.google.com +FallbackNTP=0.pool.ntp.org 1.pool.ntp.org +``` + +Dienst aktivieren und starten: + +```bash +sudo timedatectl set-ntp true +sudo systemctl enable systemd-timesyncd +sudo systemctl start systemd-timesyncd +``` + +#### ntpd (Veraltet) + +Der klassische `ntpd` aus der NTP-Referenzimplementierung ist noch weit verbreitet. Verwenden Sie `chrony`, es sei denn, Ihre Umgebung erfordert ausdrücklich `ntpd`. + +```bash +# RHEL / CentOS / Rocky Linux +sudo dnf install ntp -y + +# Ubuntu / Debian +sudo apt install ntp -y +``` + +Bearbeiten Sie `/etc/ntp.conf`, um NTP-Server festzulegen, dann aktivieren und starten: + +```bash +sudo systemctl enable ntpd +sudo systemctl start ntpd +``` + +### Zeitsynchronisation überprüfen + +Nach der Konfiguration des NTP-Dienstes überprüfen Sie den Synchronisationsstatus auf jedem Knoten. + +Systemuhr-Status prüfen: ```bash timedatectl status ``` -If the status is "synchronized", time synchronization is working properly. +Die Ausgabe sollte `System clock synchronized: yes` und `NTP service: active` anzeigen. + +Für `chrony` verwenden Sie den folgenden Befehl für detaillierte Synchronisationsinformationen: + +```bash +chronyc tracking +``` + +Wichtige Felder zur Überprüfung: + +- **Leap status** — Sollte `Normal` sein (nicht `Not synchronised`). +- **System time** — Der Offset vom Referenzserver. Sollte nahe `0.000000000 seconds` liegen. +- **Root delay** — Roundtrip-Zeit zum Referenzserver. + +Aktuelle NTP-Quellen und deren Status auflisten: + +```bash +chronyc sources -v +``` + +Zu beachtende Spalten: + +- **`*`** — Die aktuell gewählte Synchronisationsquelle. +- **`+`** — Andere akzeptable Quellen. +- **`-`** — Vom Auswahlalgorithmus abgelehnte Quellen. +- **`?`** — Quellen mit fraglicher Konnektivität. + +Für `ntpd`: + +```bash +ntpq -p +``` + +### Übergreifende Uhrenkonsistenz prüfen + +Nachdem alle Knoten synchronisiert sind, überprüfen Sie, dass die Uhren im gesamten Cluster konsistent sind. Vergleichen Sie Zeitstempel auf jedem Knoten: + +```bash +# Auf jedem Knoten ausführen und Ausgabe vergleichen +date -u '+%Y-%m-%d %H:%M:%S' +``` + +Für einen präziseren Vergleich installieren Sie `sshpass` und führen Folgendes aus: + +```bash +for host in node1 node2 node3 node4; do + echo -n "$host: " + ssh "$host" date -u '+%Y-%m-%d %H:%M:%S.%N' +done +``` + +In einer korrekt konfigurierten Umgebung sollte der Unterschied zwischen zwei Knoten vernachlässigbar sein (unter 1 Millisekunde). ## Capacity Planning diff --git a/content/en/installation/linux/prerequisites-and-service.md b/content/en/installation/linux/prerequisites-and-service.md index 8917c54e..a4e1c303 100644 --- a/content/en/installation/linux/prerequisites-and-service.md +++ b/content/en/installation/linux/prerequisites-and-service.md @@ -40,15 +40,154 @@ RustFS requires at least 2 GB of memory for a test environment; production envir ## Time Synchronization -Multi-node consistency requires a time server to keep clocks consistent, otherwise services may fail to start. Use tools such as `ntp`, `timedatectl`, or `timesyncd`. +All nodes in a RustFS distributed deployment **must** maintain synchronized clocks. RustFS relies on timestamps for request signing, object versioning, distributed locking, and replication. Significant clock drift between nodes can cause: -Check the synchronization status with: +- **Request signing failures** — S3 signature verification depends on accurate timestamps. +- **Replication and consistency issues** — Clock skew can lead to stale or conflicting object versions. +- **Lock contention problems** — Distributed locks use timestamps for lease expiration. +- **Service startup failures** — RustFS refuses to start if clock skew between nodes exceeds safe thresholds. + +:::warning +Clock drift between any two nodes should not exceed **15 minutes**. For production environments, we recommend keeping drift under **1 second**. +::: + +### Recommended NTP Tools + +Use any of the following time synchronization services on **every** node. Choose one and configure it consistently across the deployment. + +#### chrony (Recommended) + +`chrony` is the preferred NTP implementation for modern Linux distributions. It synchronizes faster and handles intermittent network connectivity better than legacy `ntpd`. + +Install chrony: + +```bash +# RHEL / CentOS / Rocky Linux +sudo dnf install chrony -y + +# Ubuntu / Debian +sudo apt install chrony -y +``` + +Edit the configuration file `/etc/chrony.conf` (RHEL) or `/etc/chrony/chrony.conf` (Debian/Ubuntu) to point to your preferred NTP servers: + +```conf +server time1.google.com iburst +server time2.google.com iburst +server time3.google.com iburst +server time4.google.com iburst +``` + +> Replace the server addresses with your organization's internal NTP servers if available. Using `iburst` speeds up initial synchronization. + +Enable and start the service: + +```bash +sudo systemctl enable chronyd +sudo systemctl start chronyd +``` + +#### systemd-timesyncd + +`systemd-timesyncd` is a lightweight SNTP client built into systemd-based distributions. It is suitable for environments where a full NTP daemon is not required. + +Edit `/etc/systemd/timesyncd.conf` to configure NTP servers: + +```ini +[Time] +NTP=time1.google.com time2.google.com time3.google.com time4.google.com +FallbackNTP=0.pool.ntp.org 1.pool.ntp.org +``` + +Enable and start the service: + +```bash +sudo timedatectl set-ntp true +sudo systemctl enable systemd-timesyncd +sudo systemctl start systemd-timesyncd +``` + +#### ntpd (Legacy) + +The classic `ntpd` from the NTP reference implementation is still widely available. Use `chrony` instead unless your environment specifically requires `ntpd`. + +```bash +# RHEL / CentOS / Rocky Linux +sudo dnf install ntp -y + +# Ubuntu / Debian +sudo apt install ntp -y +``` + +Edit `/etc/ntp.conf` to set your NTP servers, then enable and start: + +```bash +sudo systemctl enable ntpd +sudo systemctl start ntpd +``` + +### Verifying Time Synchronization + +After configuring your NTP service, verify synchronization on each node. + +Check the system clock status: ```bash timedatectl status ``` -If the status is "synchronized", time synchronization is working properly. +The output should show `System clock synchronized: yes` and `NTP service: active`. + +For `chrony`, use the following command to check detailed synchronization status: + +```bash +chronyc tracking +``` + +Key fields to verify: + +- **Leap status** — Should be `Normal` (not `Not synchronised`). +- **System time** — The offset from the reference server. Should be close to `0.000000000 seconds`. +- **Root delay** — Round-trip time to the reference server. + +To list the current NTP sources and their status: + +```bash +chronyc sources -v +``` + +Columns to watch: + +- **`*`** — The currently selected synchronization source. +- **`+`** — Other acceptable sources. +- **`-`** — Sources rejected by the selection algorithm. +- **`?`** — Sources whose connectivity is in question. + +For `ntpd`, use: + +```bash +ntpq -p +``` + +### Verifying Cross-Node Clock Consistency + +After all nodes are synchronized, verify that clocks are consistent across the cluster. On each node, compare timestamps: + +```bash +# Run on each node and compare the output +date -u '+%Y-%m-%d %H:%M:%S' +``` + +For a more precise comparison, install `sshpass` and run: + +```bash +for host in node1 node2 node3 node4; do + echo -n "$host: " + ssh "$host" date -u '+%Y-%m-%d %H:%M:%S.%N' +done +``` + +The difference between any two nodes should be negligible (under 1 millisecond in a well-configured environment). ## Capacity Planning diff --git a/content/fr/installation/linux/prerequisites-and-service.md b/content/fr/installation/linux/prerequisites-and-service.md index 8917c54e..83ec7184 100644 --- a/content/fr/installation/linux/prerequisites-and-service.md +++ b/content/fr/installation/linux/prerequisites-and-service.md @@ -40,15 +40,154 @@ RustFS requires at least 2 GB of memory for a test environment; production envir ## Time Synchronization -Multi-node consistency requires a time server to keep clocks consistent, otherwise services may fail to start. Use tools such as `ntp`, `timedatectl`, or `timesyncd`. +Tous les nœuds d'un déploiement distribué RustFS **doivent** maintenir des horloges synchronisées. RustFS s'appuie sur les horodatages pour la signature des requêtes, le versionnement des objets, le verrouillage distribué et la réplication. Une dérive significative de l'horloge entre les nœuds peut provoquer : -Check the synchronization status with: +- **Échecs de signature de requête** — La vérification des signatures S3 dépend d'horodatages précis. +- **Problèmes de réplication et de cohérence** — Un décalage d'horloge peut entraîner des versions d'objets obsolètes ou conflictuelles. +- **Problèmes de contention de verrouillage** — Les verrous distribués utilisent des horodatages pour l'expiration des baux. +- **Échecs de démarrage du service** — RustFS refuse de démarrer si le décalage d'horloge entre les nœuds dépasse les seuils de sécurité. + +:::warning +La dérive d'horloge entre deux nœuds ne doit pas dépasser **15 minutes**. Pour les environnements de production, nous recommandons de maintenir la dérive en dessous d'**1 seconde**. +::: + +### Outils NTP recommandés + +Utilisez l'un des services de synchronisation temporelle suivants sur **chaque nœud**. Choisissez un outil et configurez-le de manière cohérente sur l'ensemble du déploiement. + +#### chrony (Recommandé) + +`chrony` est l'implémentation NTP préférée pour les distributions Linux modernes. Il synchronise plus rapidement et gère mieux la connectivité réseau intermittente que l'ancien `ntpd`. + +Installer chrony : + +```bash +# RHEL / CentOS / Rocky Linux +sudo dnf install chrony -y + +# Ubuntu / Debian +sudo apt install chrony -y +``` + +Modifiez le fichier de configuration `/etc/chrony.conf` (RHEL) ou `/etc/chrony/chrony.conf` (Debian/Ubuntu) pour pointer vers vos serveurs NTP préférés : + +```conf +server time1.google.com iburst +server time2.google.com iburst +server time3.google.com iburst +server time4.google.com iburst +``` + +> Remplacez les adresses serveur par les serveurs NTP internes de votre organisation, si disponibles. L'utilisation d'`iburst` accélère la synchronisation initiale. + +Activer et démarrer le service : + +```bash +sudo systemctl enable chronyd +sudo systemctl start chronyd +``` + +#### systemd-timesyncd + +`systemd-timesyncd` est un client SNTP léger intégré aux distributions basées sur systemd. Il convient aux environnements où un démon NTP complet n'est pas nécessaire. + +Modifiez `/etc/systemd/timesyncd.conf` pour configurer les serveurs NTP : + +```ini +[Time] +NTP=time1.google.com time2.google.com time3.google.com time4.google.com +FallbackNTP=0.pool.ntp.org 1.pool.ntp.org +``` + +Activer et démarrer le service : + +```bash +sudo timedatectl set-ntp true +sudo systemctl enable systemd-timesyncd +sudo systemctl start systemd-timesyncd +``` + +#### ntpd (Ancien) + +Le classique `ntpd` de l'implémentation de référence NTP est toujours largement disponible. Utilisez `chrony` à la place, sauf si votre environnement nécessite spécifiquement `ntpd`. + +```bash +# RHEL / CentOS / Rocky Linux +sudo dnf install ntp -y + +# Ubuntu / Debian +sudo apt install ntp -y +``` + +Modifiez `/etc/ntp.conf` pour définir vos serveurs NTP, puis activez et démarrez : + +```bash +sudo systemctl enable ntpd +sudo systemctl start ntpd +``` + +### Vérification de la synchronisation temporelle + +Après avoir configuré le service NTP, vérifiez l'état de la synchronisation sur chaque nœud. + +Vérifier l'état de l'horloge système : ```bash timedatectl status ``` -If the status is "synchronized", time synchronization is working properly. +La sortie doit afficher `System clock synchronized: yes` et `NTP service: active`. + +Pour `chrony`, utilisez la commande suivante pour un état détaillé de la synchronisation : + +```bash +chronyc tracking +``` + +Champs clés à vérifier : + +- **Leap status** — Doit être `Normal` (pas `Not synchronised`). +- **System time** — Le décalage par rapport au serveur de référence. Doit être proche de `0.000000000 seconds`. +- **Root delay** — Temps aller-retour vers le serveur de référence. + +Lister les sources NTP actuelles et leur statut : + +```bash +chronyc sources -v +``` + +Colonnes à surveiller : + +- **`*`** — La source de synchronisation actuellement sélectionnée. +- **`+`** — Autres sources acceptables. +- **`-`** — Sources rejetées par l'algorithme de sélection. +- **`?`** — Sources dont la connectivité est incertaine. + +Pour `ntpd` : + +```bash +ntpq -p +``` + +### Vérification de la cohérence inter-nœuds + +Après la synchronisation de tous les nœuds, vérifiez que les horloges sont cohérentes dans tout le cluster. Comparez les horodatages sur chaque nœud : + +```bash +# Exécuter sur chaque nœud et comparer la sortie +date -u '+%Y-%m-%d %H:%M:%S' +``` + +Pour une comparaison plus précise, installez `sshpass` et exécutez : + +```bash +for host in node1 node2 node3 node4; do + echo -n "$host: " + ssh "$host" date -u '+%Y-%m-%d %H:%M:%S.%N' +done +``` + +Dans un environnement correctement configuré, la différence entre deux nœuds doit être négligeable (inférieure à 1 milliseconde). ## Capacity Planning diff --git a/content/ja/installation/linux/prerequisites-and-service.md b/content/ja/installation/linux/prerequisites-and-service.md index 8917c54e..1aeda4ca 100644 --- a/content/ja/installation/linux/prerequisites-and-service.md +++ b/content/ja/installation/linux/prerequisites-and-service.md @@ -40,15 +40,154 @@ RustFS requires at least 2 GB of memory for a test environment; production envir ## Time Synchronization -Multi-node consistency requires a time server to keep clocks consistent, otherwise services may fail to start. Use tools such as `ntp`, `timedatectl`, or `timesyncd`. +RustFS の分散デプロイメントでは、すべてのノードのクロックを同期させる必要があります。RustFS はリクエスト署名、オブジェクトバージョニング、分散ロック、レプリケーションにタイムスタンプに依存しています。ノード間のクロックドリフトにより、以下のような問題が発生する可能性があります: -Check the synchronization status with: +- **リクエスト署名の失敗** — S3 署名の検証は正確なタイムスタンプに依存します。 +- **レプリケーションと整合性の問題** — クロックスキーによりオブジェクトバージョンが古くなったり競合したりする可能性があります。 +- **ロック競合の問題** — 分散ロックはリース期限にタイムスタンプを使用します。 +- **サービス起動の失敗** — ノード間のクロックスキーが安全な閾値を超えると、RustFS は起動を拒否します。 + +:::warning +任意の 2 ノード間のクロックドリフトは **15 分**を超えてはなりません。本番環境では、ドリフトを **1 秒**以内に抑えることを推奨します。 +::: + +### 推奨 NTP ツール + +**すべてのノード**で以下のいずれかの時間同期サービスを使用してください。1 つのツールを選択し、デプロイメント全体で統一して設定します。 + +#### chrony(推奨) + +`chrony` は最新の Linux ディストリビューションで推奨される NTP 実装です。レガシーの `ntpd` と比較して同期が速く、断続的なネットワーク接続にもより適切に対応します。 + +chrony のインストール: + +```bash +# RHEL / CentOS / Rocky Linux +sudo dnf install chrony -y + +# Ubuntu / Debian +sudo apt install chrony -y +``` + +設定ファイル `/etc/chrony.conf`(RHEL)または `/etc/chrony/chrony.conf`(Debian/Ubuntu)を編集し、使用する NTP サーバーを指定します: + +```conf +server time1.google.com iburst +server time2.google.com iburst +server time3.google.com iburst +server time4.google.com iburst +``` + +> サーバーアドレスは組織内の NTP サーバーがある場合はそれに置き換えてください。`iburst` を使用すると初期同期が高速化されます。 + +サービスを有効化して起動: + +```bash +sudo systemctl enable chronyd +sudo systemctl start chronyd +``` + +#### systemd-timesyncd + +`systemd-timesyncd` は systemd ベースのディストリビューションに組み込まれた軽量 SNTP クライアントです。フル NTP デーモンが不要な環境に適しています。 + +`/etc/systemd/timesyncd.conf` を編集して NTP サーバーを設定: + +```ini +[Time] +NTP=time1.google.com time2.google.com time3.google.com time4.google.com +FallbackNTP=0.pool.ntp.org 1.pool.ntp.org +``` + +サービスを有効化して起動: + +```bash +sudo timedatectl set-ntp true +sudo systemctl enable systemd-timesyncd +sudo systemctl start systemd-timesyncd +``` + +#### ntpd(レガシー) + +NTP リファレンス実装のクラシックな `ntpd` は現在も広く利用可能です。環境で特に `ntpd` が必要な場合を除き、`chrony` を使用してください。 + +```bash +# RHEL / CentOS / Rocky Linux +sudo dnf install ntp -y + +# Ubuntu / Debian +sudo apt install ntp -y +``` + +`/etc/ntp.conf` を編集して NTP サーバーを設定し、有効化して起動: + +```bash +sudo systemctl enable ntpd +sudo systemctl start ntpd +``` + +### 時間同期の検証 + +NTP サービスを設定した後、各ノードで同期状態を確認してください。 + +システムクロックの状態を確認: ```bash timedatectl status ``` -If the status is "synchronized", time synchronization is working properly. +出力には `System clock synchronized: yes` および `NTP service: active` と表示される必要があります。 + +`chrony` の場合、以下のコマンドで詳細な同期状態を確認できます: + +```bash +chronyc tracking +``` + +確認すべき重要な項目: + +- **Leap status** — `Normal` であるべきです(`Not synchronised` ではないこと)。 +- **System time** — 参照サーバーからのオフセット。`0.000000000 seconds` に近い必要があります。 +- **Root delay** — 参照サーバーまでの往復時間。 + +現在の NTP ソースとその状態を一覧表示: + +```bash +chronyc sources -v +``` + +注目すべき列: + +- **`*`** — 現在選択されている同期ソース。 +- **`+`** — その他の許容可能なソース。 +- **`-`** — 選択アルゴリズムによって拒否されたソース。 +- **`?`** — 接続状態に問題がある可能性のあるソース。 + +`ntpd` の場合: + +```bash +ntpq -p +``` + +### クロスノードクロック整合性の検証 + +すべてのノードが同期した後、クラスタ全体でクロックが一致していることを確認してください。各ノードでタイムスタンプを比較: + +```bash +# 各ノードで実行し、出力を比較 +date -u '+%Y-%m-%d %H:%M:%S' +``` + +より精密な比較が必要な場合は、`sshpass` をインストールして以下を実行: + +```bash +for host in node1 node2 node3 node4; do + echo -n "$host: " + ssh "$host" date -u '+%Y-%m-%d %H:%M:%S.%N' +done +``` + +適切に設定された環境では、任意の 2 ノード間の差異は無視できる程度(1 ミリ秒未満)である必要があります。 ## Capacity Planning diff --git a/content/zh/installation/linux/prerequisites-and-service.md b/content/zh/installation/linux/prerequisites-and-service.md index d14f1cc1..b3560d71 100644 --- a/content/zh/installation/linux/prerequisites-and-service.md +++ b/content/zh/installation/linux/prerequisites-and-service.md @@ -40,15 +40,154 @@ firewall-cmd --reload ## 时间同步 -多节点一致性需要时间服务器保持时钟一致,否则服务可能无法启动。可使用 `ntp`、`timedatectl` 或 `timesyncd` 等工具。 +RustFS 分布式部署中的所有节点**必须**保持时钟同步。RustFS 依赖时间戳进行请求签名、对象版本控制、分布式锁和复制。节点间的时钟漂移可能导致: -使用以下命令检查同步状态: +- **请求签名失败** — S3 签名验证依赖准确的时间戳。 +- **复制和一致性问题** — 时钟偏移可能导致对象版本过时或冲突。 +- **锁竞争问题** — 分布式锁使用时间戳进行租约过期。 +- **服务启动失败** — 如果节点间时钟偏移超过安全阈值,RustFS 将拒绝启动。 + +:::warning +任意两个节点之间的时钟漂移不应超过 **15 分钟**。对于生产环境,建议将漂移控制在 **1 秒**以内。 +::: + +### 推荐的 NTP 工具 + +在**每个**节点上使用以下任一时间同步服务。请选择一种工具并在整个部署中统一配置。 + +#### chrony(推荐) + +`chrony` 是现代 Linux 发行版首选的 NTP 实现。与传统的 `ntpd` 相比,它同步速度更快,能更好地处理间歇性网络连接。 + +安装 chrony: + +```bash +# RHEL / CentOS / Rocky Linux +sudo dnf install chrony -y + +# Ubuntu / Debian +sudo apt install chrony -y +``` + +编辑配置文件 `/etc/chrony.conf`(RHEL)或 `/etc/chrony/chrony.conf`(Debian/Ubuntu),指向您首选的 NTP 服务器: + +```conf +server time1.google.com iburst +server time2.google.com iburst +server time3.google.com iburst +server time4.google.com iburst +``` + +> 请将服务器地址替换为贵组织的内部 NTP 服务器(如有)。使用 `iburst` 可加速初始同步。 + +启用并启动服务: + +```bash +sudo systemctl enable chronyd +sudo systemctl start chronyd +``` + +#### systemd-timesyncd + +`systemd-timesyncd` 是 systemd 发行版内置的轻量级 SNTP 客户端,适用于不需要完整 NTP 守护进程的环境。 + +编辑 `/etc/systemd/timesyncd.conf` 配置 NTP 服务器: + +```ini +[Time] +NTP=time1.google.com time2.google.com time3.google.com time4.google.com +FallbackNTP=0.pool.ntp.org 1.pool.ntp.org +``` + +启用并启动服务: + +```bash +sudo timedatectl set-ntp true +sudo systemctl enable systemd-timesyncd +sudo systemctl start systemd-timesyncd +``` + +#### ntpd(传统方式) + +经典的 `ntpd` 来自 NTP 参考实现,仍然广泛可用。除非您的环境特别需要 `ntpd`,否则建议使用 `chrony`。 + +```bash +# RHEL / CentOS / Rocky Linux +sudo dnf install ntp -y + +# Ubuntu / Debian +sudo apt install ntp -y +``` + +编辑 `/etc/ntp.conf` 设置 NTP 服务器,然后启用并启动: + +```bash +sudo systemctl enable ntpd +sudo systemctl start ntpd +``` + +### 验证时间同步 + +配置 NTP 服务后,请在每个节点上验证同步状态。 + +检查系统时钟状态: ```bash timedatectl status ``` -如果状态为 "synchronized",则时间同步工作正常。 +输出应显示 `System clock synchronized: yes` 和 `NTP service: active`。 + +对于 `chrony`,使用以下命令查看详细的同步状态: + +```bash +chronyc tracking +``` + +关键字段说明: + +- **Leap status** — 应为 `Normal`(而非 `Not synchronised`)。 +- **System time** — 与参考服务器的偏移量,应接近 `0.000000000 seconds`。 +- **Root delay** — 到参考服务器的往返时间。 + +列出当前 NTP 源及其状态: + +```bash +chronyc sources -v +``` + +需关注的列: + +- **`*`** — 当前选定的同步源。 +- **`+`** — 其他可接受的源。 +- **`-`** — 被选择算法拒绝的源。 +- **`?`** — 连接状态存疑的源。 + +对于 `ntpd`,使用: + +```bash +ntpq -p +``` + +### 验证跨节点时钟一致性 + +所有节点同步后,请验证集群中时钟是否一致。在每个节点上比较时间戳: + +```bash +# 在每个节点上运行并比较输出 +date -u '+%Y-%m-%d %H:%M:%S' +``` + +如需更精确的比较,可安装 `sshpass` 并运行: + +```bash +for host in node1 node2 node3 node4; do + echo -n "$host: " + ssh "$host" date -u '+%Y-%m-%d %H:%M:%S.%N' +done +``` + +在配置良好的环境中,任意两个节点之间的差异应可忽略不计(低于 1 毫秒)。 ## 容量规划 From 43865ca15f2f446b7e1a85c1eacaea4dc5f2c761 Mon Sep 17 00:00:00 2001 From: root Date: Tue, 4 Aug 2026 08:11:52 +0000 Subject: [PATCH 2/4] fix: admonition syntax and code block parity in time sync docs - Add required title to :::warning admonition blocks (fumadocs remark-admonition requires :::warning[title]) - Fix translated comments inside code blocks to match English version (docs-check requirement) Co-Authored-By: Claude --- content/de/installation/linux/prerequisites-and-service.md | 4 ++-- content/en/installation/linux/prerequisites-and-service.md | 2 +- content/fr/installation/linux/prerequisites-and-service.md | 4 ++-- content/ja/installation/linux/prerequisites-and-service.md | 4 ++-- content/zh/installation/linux/prerequisites-and-service.md | 4 ++-- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/content/de/installation/linux/prerequisites-and-service.md b/content/de/installation/linux/prerequisites-and-service.md index ae303e6c..4a7f574d 100644 --- a/content/de/installation/linux/prerequisites-and-service.md +++ b/content/de/installation/linux/prerequisites-and-service.md @@ -47,7 +47,7 @@ Alle Knoten in einer verteilten RustFS-Deployment müssen synchronisierte Uhren - **Lock-Konflikte** — Verteilte Locks verwenden Zeitstempel für die Leasedauer. - **Fehler beim Starten des Dienstes** — RustFS verweigert den Start, wenn der Uhrenversatz zwischen den Knoten den sicheren Schwellenwert überschreitet. -:::warning +:::warning[Uhrenabweichung Toleranz] Die Uhrenabweichung zwischen zwei Knoten darf **15 Minuten** nicht überschreiten. Für Produktionsumgebungen empfehlen wir, die Abweichung unter **1 Sekunde** zu halten. ::: @@ -174,7 +174,7 @@ ntpq -p Nachdem alle Knoten synchronisiert sind, überprüfen Sie, dass die Uhren im gesamten Cluster konsistent sind. Vergleichen Sie Zeitstempel auf jedem Knoten: ```bash -# Auf jedem Knoten ausführen und Ausgabe vergleichen +# Run on each node and compare the output date -u '+%Y-%m-%d %H:%M:%S' ``` diff --git a/content/en/installation/linux/prerequisites-and-service.md b/content/en/installation/linux/prerequisites-and-service.md index a4e1c303..03c26a9f 100644 --- a/content/en/installation/linux/prerequisites-and-service.md +++ b/content/en/installation/linux/prerequisites-and-service.md @@ -47,7 +47,7 @@ All nodes in a RustFS distributed deployment **must** maintain synchronized cloc - **Lock contention problems** — Distributed locks use timestamps for lease expiration. - **Service startup failures** — RustFS refuses to start if clock skew between nodes exceeds safe thresholds. -:::warning +:::warning[Clock Drift Tolerance] Clock drift between any two nodes should not exceed **15 minutes**. For production environments, we recommend keeping drift under **1 second**. ::: diff --git a/content/fr/installation/linux/prerequisites-and-service.md b/content/fr/installation/linux/prerequisites-and-service.md index 83ec7184..e7502e8c 100644 --- a/content/fr/installation/linux/prerequisites-and-service.md +++ b/content/fr/installation/linux/prerequisites-and-service.md @@ -47,7 +47,7 @@ Tous les nœuds d'un déploiement distribué RustFS **doivent** maintenir des ho - **Problèmes de contention de verrouillage** — Les verrous distribués utilisent des horodatages pour l'expiration des baux. - **Échecs de démarrage du service** — RustFS refuse de démarrer si le décalage d'horloge entre les nœuds dépasse les seuils de sécurité. -:::warning +:::warning[Tolérance de dérive d'horloge] La dérive d'horloge entre deux nœuds ne doit pas dépasser **15 minutes**. Pour les environnements de production, nous recommandons de maintenir la dérive en dessous d'**1 seconde**. ::: @@ -174,7 +174,7 @@ ntpq -p Après la synchronisation de tous les nœuds, vérifiez que les horloges sont cohérentes dans tout le cluster. Comparez les horodatages sur chaque nœud : ```bash -# Exécuter sur chaque nœud et comparer la sortie +# Run on each node and compare the output date -u '+%Y-%m-%d %H:%M:%S' ``` diff --git a/content/ja/installation/linux/prerequisites-and-service.md b/content/ja/installation/linux/prerequisites-and-service.md index 1aeda4ca..39e6120c 100644 --- a/content/ja/installation/linux/prerequisites-and-service.md +++ b/content/ja/installation/linux/prerequisites-and-service.md @@ -47,7 +47,7 @@ RustFS の分散デプロイメントでは、すべてのノードのクロッ - **ロック競合の問題** — 分散ロックはリース期限にタイムスタンプを使用します。 - **サービス起動の失敗** — ノード間のクロックスキーが安全な閾値を超えると、RustFS は起動を拒否します。 -:::warning +:::warning[クロックドリフト許容範囲] 任意の 2 ノード間のクロックドリフトは **15 分**を超えてはなりません。本番環境では、ドリフトを **1 秒**以内に抑えることを推奨します。 ::: @@ -174,7 +174,7 @@ ntpq -p すべてのノードが同期した後、クラスタ全体でクロックが一致していることを確認してください。各ノードでタイムスタンプを比較: ```bash -# 各ノードで実行し、出力を比較 +# Run on each node and compare the output date -u '+%Y-%m-%d %H:%M:%S' ``` diff --git a/content/zh/installation/linux/prerequisites-and-service.md b/content/zh/installation/linux/prerequisites-and-service.md index b3560d71..0eec17f2 100644 --- a/content/zh/installation/linux/prerequisites-and-service.md +++ b/content/zh/installation/linux/prerequisites-and-service.md @@ -47,7 +47,7 @@ RustFS 分布式部署中的所有节点**必须**保持时钟同步。RustFS - **锁竞争问题** — 分布式锁使用时间戳进行租约过期。 - **服务启动失败** — 如果节点间时钟偏移超过安全阈值,RustFS 将拒绝启动。 -:::warning +:::warning[时钟漂移容忍度] 任意两个节点之间的时钟漂移不应超过 **15 分钟**。对于生产环境,建议将漂移控制在 **1 秒**以内。 ::: @@ -174,7 +174,7 @@ ntpq -p 所有节点同步后,请验证集群中时钟是否一致。在每个节点上比较时间戳: ```bash -# 在每个节点上运行并比较输出 +# Run on each node and compare the output date -u '+%Y-%m-%d %H:%M:%S' ``` From f5673c6686e3a62656a053d95b53330253440f22 Mon Sep 17 00:00:00 2001 From: root Date: Tue, 4 Aug 2026 08:17:57 +0000 Subject: [PATCH 3/4] fix: use admonition format without title to match existing patterns Remove [title] from :::warning blocks and add required blank lines to match the working admonition format used elsewhere in the docs. Co-Authored-By: Claude --- content/de/installation/linux/prerequisites-and-service.md | 4 +++- content/en/installation/linux/prerequisites-and-service.md | 4 +++- content/fr/installation/linux/prerequisites-and-service.md | 4 +++- content/ja/installation/linux/prerequisites-and-service.md | 4 +++- content/zh/installation/linux/prerequisites-and-service.md | 4 +++- 5 files changed, 15 insertions(+), 5 deletions(-) diff --git a/content/de/installation/linux/prerequisites-and-service.md b/content/de/installation/linux/prerequisites-and-service.md index 4a7f574d..b5d4fdfc 100644 --- a/content/de/installation/linux/prerequisites-and-service.md +++ b/content/de/installation/linux/prerequisites-and-service.md @@ -47,8 +47,10 @@ Alle Knoten in einer verteilten RustFS-Deployment müssen synchronisierte Uhren - **Lock-Konflikte** — Verteilte Locks verwenden Zeitstempel für die Leasedauer. - **Fehler beim Starten des Dienstes** — RustFS verweigert den Start, wenn der Uhrenversatz zwischen den Knoten den sicheren Schwellenwert überschreitet. -:::warning[Uhrenabweichung Toleranz] +:::warning + Die Uhrenabweichung zwischen zwei Knoten darf **15 Minuten** nicht überschreiten. Für Produktionsumgebungen empfehlen wir, die Abweichung unter **1 Sekunde** zu halten. + ::: ### Empfohlene NTP-Tools diff --git a/content/en/installation/linux/prerequisites-and-service.md b/content/en/installation/linux/prerequisites-and-service.md index 03c26a9f..38eaa962 100644 --- a/content/en/installation/linux/prerequisites-and-service.md +++ b/content/en/installation/linux/prerequisites-and-service.md @@ -47,8 +47,10 @@ All nodes in a RustFS distributed deployment **must** maintain synchronized cloc - **Lock contention problems** — Distributed locks use timestamps for lease expiration. - **Service startup failures** — RustFS refuses to start if clock skew between nodes exceeds safe thresholds. -:::warning[Clock Drift Tolerance] +:::warning + Clock drift between any two nodes should not exceed **15 minutes**. For production environments, we recommend keeping drift under **1 second**. + ::: ### Recommended NTP Tools diff --git a/content/fr/installation/linux/prerequisites-and-service.md b/content/fr/installation/linux/prerequisites-and-service.md index e7502e8c..f6941e98 100644 --- a/content/fr/installation/linux/prerequisites-and-service.md +++ b/content/fr/installation/linux/prerequisites-and-service.md @@ -47,8 +47,10 @@ Tous les nœuds d'un déploiement distribué RustFS **doivent** maintenir des ho - **Problèmes de contention de verrouillage** — Les verrous distribués utilisent des horodatages pour l'expiration des baux. - **Échecs de démarrage du service** — RustFS refuse de démarrer si le décalage d'horloge entre les nœuds dépasse les seuils de sécurité. -:::warning[Tolérance de dérive d'horloge] +:::warning + La dérive d'horloge entre deux nœuds ne doit pas dépasser **15 minutes**. Pour les environnements de production, nous recommandons de maintenir la dérive en dessous d'**1 seconde**. + ::: ### Outils NTP recommandés diff --git a/content/ja/installation/linux/prerequisites-and-service.md b/content/ja/installation/linux/prerequisites-and-service.md index 39e6120c..cdc46238 100644 --- a/content/ja/installation/linux/prerequisites-and-service.md +++ b/content/ja/installation/linux/prerequisites-and-service.md @@ -47,8 +47,10 @@ RustFS の分散デプロイメントでは、すべてのノードのクロッ - **ロック競合の問題** — 分散ロックはリース期限にタイムスタンプを使用します。 - **サービス起動の失敗** — ノード間のクロックスキーが安全な閾値を超えると、RustFS は起動を拒否します。 -:::warning[クロックドリフト許容範囲] +:::warning + 任意の 2 ノード間のクロックドリフトは **15 分**を超えてはなりません。本番環境では、ドリフトを **1 秒**以内に抑えることを推奨します。 + ::: ### 推奨 NTP ツール diff --git a/content/zh/installation/linux/prerequisites-and-service.md b/content/zh/installation/linux/prerequisites-and-service.md index 0eec17f2..c44c0ab5 100644 --- a/content/zh/installation/linux/prerequisites-and-service.md +++ b/content/zh/installation/linux/prerequisites-and-service.md @@ -47,8 +47,10 @@ RustFS 分布式部署中的所有节点**必须**保持时钟同步。RustFS - **锁竞争问题** — 分布式锁使用时间戳进行租约过期。 - **服务启动失败** — 如果节点间时钟偏移超过安全阈值,RustFS 将拒绝启动。 -:::warning[时钟漂移容忍度] +:::warning + 任意两个节点之间的时钟漂移不应超过 **15 分钟**。对于生产环境,建议将漂移控制在 **1 秒**以内。 + ::: ### 推荐的 NTP 工具 From 8b71480f320092d5e2712bb7f6df1bd249326305 Mon Sep 17 00:00:00 2001 From: hector Date: Tue, 4 Aug 2026 08:29:11 +0000 Subject: [PATCH 4/4] fix: change code fence language from conf to ini for Shiki compatibility Shiki syntax highlighter does not support 'conf' language. Use 'ini' which is the standard for config files in this project. --- content/de/installation/linux/prerequisites-and-service.md | 2 +- content/en/installation/linux/prerequisites-and-service.md | 2 +- content/fr/installation/linux/prerequisites-and-service.md | 2 +- content/ja/installation/linux/prerequisites-and-service.md | 2 +- content/zh/installation/linux/prerequisites-and-service.md | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/content/de/installation/linux/prerequisites-and-service.md b/content/de/installation/linux/prerequisites-and-service.md index b5d4fdfc..d50e8a84 100644 --- a/content/de/installation/linux/prerequisites-and-service.md +++ b/content/de/installation/linux/prerequisites-and-service.md @@ -73,7 +73,7 @@ sudo apt install chrony -y Bearbeiten Sie die Konfigurationsdatei `/etc/chrony.conf` (RHEL) oder `/etc/chrony/chrony.conf` (Debian/Ubuntu), um Ihre bevorzugten NTP-Server anzugeben: -```conf +```ini server time1.google.com iburst server time2.google.com iburst server time3.google.com iburst diff --git a/content/en/installation/linux/prerequisites-and-service.md b/content/en/installation/linux/prerequisites-and-service.md index 38eaa962..184bd225 100644 --- a/content/en/installation/linux/prerequisites-and-service.md +++ b/content/en/installation/linux/prerequisites-and-service.md @@ -73,7 +73,7 @@ sudo apt install chrony -y Edit the configuration file `/etc/chrony.conf` (RHEL) or `/etc/chrony/chrony.conf` (Debian/Ubuntu) to point to your preferred NTP servers: -```conf +```ini server time1.google.com iburst server time2.google.com iburst server time3.google.com iburst diff --git a/content/fr/installation/linux/prerequisites-and-service.md b/content/fr/installation/linux/prerequisites-and-service.md index f6941e98..313c6f99 100644 --- a/content/fr/installation/linux/prerequisites-and-service.md +++ b/content/fr/installation/linux/prerequisites-and-service.md @@ -73,7 +73,7 @@ sudo apt install chrony -y Modifiez le fichier de configuration `/etc/chrony.conf` (RHEL) ou `/etc/chrony/chrony.conf` (Debian/Ubuntu) pour pointer vers vos serveurs NTP préférés : -```conf +```ini server time1.google.com iburst server time2.google.com iburst server time3.google.com iburst diff --git a/content/ja/installation/linux/prerequisites-and-service.md b/content/ja/installation/linux/prerequisites-and-service.md index cdc46238..bda9a69f 100644 --- a/content/ja/installation/linux/prerequisites-and-service.md +++ b/content/ja/installation/linux/prerequisites-and-service.md @@ -73,7 +73,7 @@ sudo apt install chrony -y 設定ファイル `/etc/chrony.conf`(RHEL)または `/etc/chrony/chrony.conf`(Debian/Ubuntu)を編集し、使用する NTP サーバーを指定します: -```conf +```ini server time1.google.com iburst server time2.google.com iburst server time3.google.com iburst diff --git a/content/zh/installation/linux/prerequisites-and-service.md b/content/zh/installation/linux/prerequisites-and-service.md index c44c0ab5..8e8156fe 100644 --- a/content/zh/installation/linux/prerequisites-and-service.md +++ b/content/zh/installation/linux/prerequisites-and-service.md @@ -73,7 +73,7 @@ sudo apt install chrony -y 编辑配置文件 `/etc/chrony.conf`(RHEL)或 `/etc/chrony/chrony.conf`(Debian/Ubuntu),指向您首选的 NTP 服务器: -```conf +```ini server time1.google.com iburst server time2.google.com iburst server time3.google.com iburst