如何重新加载催化剂中的配置
当 Catalyst Web 框架中的配置发生更改并且需要重新加载配置而不重新启动 Catalyst 服务器时,如何重新加载配置。
How to reload the configuration when ever the configuration changed in catalyst web framework and need to reload the configuration with out restarting the catalyst server.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您需要重新启动 fastcgi 实例来重新加载 Catalyst 配置,因为该配置主要在启动时应用。
对于您自己的应用程序级别配置,您可以使其基于数据库并编写自己的例程来定期从数据库中获取数据。
如果您想在不停机的情况下重新启动 Catalyst,您可以在多个机器之间进行负载平衡,并重新启动每个机器的 fastcgi 进程 (FastCGIExternalServer)。
另一种解决方案是在关闭旧实例之前启动“新实例”,因此始终某事接受()-s新请求。
这两种解决方案都假设您的配置更改并不剧烈,以防止在升级期间使用两种不同配置的应用程序的两个实例同时运行。
You need to restart the fastcgi instance to reload the Catalyst configuration, as the config is applied at startup time mostly.
For your own application level config, you can make it database based and write your own routine that fetches out of a database periodically.
If you want to restart Catalyst without downtime, you can loadbalance between multiple boxes and restart the fastcgi processes per box (FastCGIExternalServer).
Another solution would be to start up the "new instance" before shutting down the old one, so at all times something accept()-s new requests.
Both of these solutions assume that your configuration changes are not drastic to prevent two instances of the application running beside each other with two different configurations for the duration of the upgrade.