{% load i18n %}

🔁 {% trans "Replication" %}

{% trans "readiness · binlog / GTID · replicas" %}

{% include "partials/_banner.html" %}
{% trans "Readiness" %} {% if status.ready %} {% trans "ready as a source" %} {% else %} {% trans "not ready to replicate" %} {% endif %}
{% trans "role" %}
{{ status.role }}
log_bin
{% if status.log_bin %}ON{% else %}OFF{% endif %}
server_id
{{ status.server_id }}
gtid_mode
{{ status.gtid_mode }}
{% trans "binlog position" %}
{% if status.binlog_file %}{{ status.binlog_file }}:{{ status.binlog_pos }}{% else %}—{% endif %}
{% if status.role == 'replica' %}
{% trans "source host" %}
{{ status.source_host|default:"—" }}
IO
{% if status.io_running %}{% trans "running" %}{% else %}{% trans "stopped" %}{% endif %}
SQL
{% if status.sql_running %}{% trans "running" %}{% else %}{% trans "stopped" %}{% endif %}
{% trans "lag" %}
{% if status.seconds_behind is not None %}{{ status.seconds_behind }}s{% else %}—{% endif %}
{% endif %}
{% blocktrans %}A source needs log_bin ON and a non-zero server_id. GTID is recommended.{% endblocktrans %}
{% trans "1 · Make the source ready" %}
{% if recipe.ready %}

{% trans "✓ Binary logging and server_id are configured." %}

{% else %}

{% trans "Set these on the source, then restart it:" %}

{% for param, val in recipe.conf_changes %}
{{ param }} {{ val }}
{% endfor %}
{% endif %}
{% trans "2 · Create a replication user (on the source)" %}
{{ recipe.create_user_sql }}
{% trans "3 · Point the replica at the source (on the replica)" %}
{{ recipe.change_source_sql }}
{{ recipe.start_replica_sql }}

{% blocktrans with host=recipe.source_host port=recipe.source_port %}⚠ The replica must be able to reach {{ host }}:{{ port }} over the network and authenticate as the replication user. This is a starting point; see the MySQL docs for production (TLS, a dedicated account, GTID).{% endblocktrans %}

{% trans "Replicas" %} SHOW REPLICAS
{% if standbys %} {% for r in standbys %} {% endfor %}
server_id {% trans "Host" %} {% trans "Port" %}
{{ r.server_id }} {{ r.host|default:"—" }} {{ r.port|default:"—" }}
{% else %}

{% trans "No replica connected." %}

{% endif %}