MySQL Router 9.0  /  部署 MySQL Router

第 3 章 部署 MySQL Router

效能建議

為了獲得最佳效能,MySQL Router 通常安裝在使用它的應用程式所在的同一主機上。可能的原因包括

  • 允許本機 UNIX 網域通訊端連線至應用程式,而非 TCP/IP。

    注意

    Unix 網域通訊端可以與連線至 MySQL Router 的應用程式一起運作,但不能用於 MySQL Router 連線至 MySQL Server。

  • 減少網路延遲。

  • 允許 MySQL Router 連線至 MySQL,而無需為 Router 的主機額外建立帳戶,例如專為應用程式主機建立的 MySQL 帳戶,如 myapp@198.51.100.45,而不是像 myapp@% 這樣的值。

  • 通常,應用程式伺服器最容易擴展。

您可以在網路上執行多個 MySQL Router 執行個體,而且您不需要將 MySQL Router 隔離到單一機器。這是因為 MySQL Router 與任何特定的伺服器或主機沒有關聯。

圖 3.1 MySQL Router 部署範例

Example deployment shows a central Group Replication and Highly Available setup with three entities pointing towards or connected to it: MySQL Shell, and two stacks that each include MySQL Router, MySQL Connector, and the Application.