我有 2 个 MAAS 区域控制器正在运行。我在 ubuntu 16.04 上使用 MAAS 2.0。我在 hot_standby 配置中设置了 posgresql 流。我能够使两个服务器都进行负载平衡,并且设置了 VIP 并使其正常工作。问题是,当我停止主服务器上的 postgresql 数据库服务时,备用服务器接管,但结果非常奇怪。如果您继续刷新 Web 界面,您将获得一些 MAAS 屏幕,但不是所有数据。postgresql 日志收到大量 read_only 错误。
我正在使用本教程:https://maas.ubuntu.com/docs/ha.html
有没有办法让 MAAS 在备用节点上使用只读 hot_standby 数据库正常运行?
备用日志错误:
2016-12-26 14:41:50 CST [3646-1] maas@maasdb ERROR: cannot execute LISTEN during recovery
2016-12-26 14:41:50 CST [3646-2] maas@maasdb STATEMENT: LISTEN device_create;
2016-12-26 14:41:50 CST [3647-1] maas@maasdb ERROR: cannot execute LISTEN during recovery
2016-12-26 14:41:50 CST [3647-2] maas@maasdb STATEMENT: LISTEN config_create;
2016-12-26 14:41:50 CST [3655-1] maas@maasdb ERROR: cannot execute LISTEN during recovery
2016-12-26 14:41:50 CST [3655-2] maas@maasdb STATEMENT: LISTEN space_create;
2016-12-26 14:41:51 CST [3606-1] maas@maasdb ERROR: cannot execute DELETE in a read-only transaction
2016-12-26 14:41:51 CST [3606-2] maas@maasdb STATEMENT: DELETE FROM "maasserver_bootsourcecache" WHERE "maasserver_bootsourcecache"."boot_source_id" = 1
2016-12-26 14:41:51 CST [3657-1] maas@maasdb ERROR: cannot execute LISTEN during recovery
2016-12-26 14:41:51 CST [3657-2] maas@maasdb STATEMENT: LISTEN sshkey_create;
2016-12-26 14:41:51 CST [3593-3] maas@maasdb ERROR: cannot execute INSERT in a read-only transaction
2016-12-26 14:41:51 CST [3593-4] maas@maasdb STATEMENT: INSERT INTO "maasserver_regioncontrollerprocess" ("created", "updated", "region_id", "pid") VALUES ('2016-12-26T14:41:51.707866'::timestamp, '2016-12-26T14:41:51.707866'::timestamp, 2, 3531) RETURNING "maasserver_regioncontrollerprocess"."id"
谢谢你的时间,克里斯
答案1
以下是我如何解决 HA 问题的视频和内容。