- c - 在位数组中找到第一个零
- linux - Unix 显示有关匹配两种模式之一的文件的信息
- 正则表达式替换多个文件
- linux - 隐藏来自 xtrace 的命令
我有一个使用 django + wsgi 的扩展,它在开发和生产中运行良好。唯一的问题是,当我对 buildout.cfg 进行更改或添加并且必须运行 bin/buildout 时,网站会从 buildout 开始到完成时离线。这可能需要 5 分钟以上的时间。
有没有办法在生产中优雅地运行构建?也许我不知道的一个参数会在不先卸载所有内容的情况下运行构建?该网站在一台网络服务器上运行。负载平衡器和额外的 Web 服务器将是一个不错的解决方案,但目前不可行。
欢迎对我的构建脚本提出任何其他意见/建议/批评。
谢谢!
这是我的 buildout.cfg:
[buildout]
download-cache = downloads
unzip = true
parts =
scripts
django
djangoprod
eggs =
${scripts:eggs}
${pipscripts:eggs}
[scripts]
recipe = zc.recipe.egg
unzip = true
download-cache = ${buildout:download-cache}
eggs =
ipython
docutils
feedparser
pygments
South
django-grappelli
django-extensions
django-mobile
django-photologue
django-filebrowser
django-indexer
django-paging
django-templatetag-sugar
django-sentry
MySQL-python
find-links =
http://dist.repoze.org/
http://github.com/
http://bitbucket.org/
http://googlecode.com/
http://surfnet.dl.sourceforge.net/
[pipscripts]
recipe = gp.recipe.pip
unzip = true
download-cache = ${buildout:download-cache}
editables =
hg+https://bitbucket.org/ubernostrum/django-registration#egg=django_registration
git://github.com/jtauber/django-mailer.git#egg=django_mailer
eggs =
django-registration
django-mailer
PIL
install =
http://effbot.org/downloads/Imaging-1.1.7.tar.gz
[django]
recipe = djangorecipe
download-cache = ${buildout:download-cache}
eggs = ${buildout:eggs}
version = 1.3
project = project
[djangoprod]
recipe = djangorecipe
download-cache = ${django:download-cache}
version = ${django:version}
settings = production
wsgi = true
eggs = ${django:eggs}
project = ${django:project}
最佳答案
Buildout 只会更新配置已更改的部分(或者在愚蠢的配方实现的情况下)。一种选择是将构建配置复制/ checkout 到新位置,重新运行构建,然后停止旧实例,然后在新安装上重新启动实例。在某些情况下,我们会维护安装
/data/buildout_<date1>
/data/buildout_<date2>
/data/current
其中“current”是指向当前“buildout_”安装的符号链接(symbolic link)。
当然:在负载均衡器后面运行多个实例,您可以在构建阶段从均衡器中删除一个实例。
关于python - 通过扩建和最少的停机时间部署到生产环境?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6112682/
kubectl drain首先是否确保带有replicas=1的Pod在其他某个节点上是健康的? 假设Pod由部署控制,并且Pod确实可以移动到其他节点。 目前,如我所见,它仅从节点逐出(删除Pod)
在上一篇文章 STM8单片机低功耗—等待(Wait)模式实现 中介绍了低功耗模式中的等待(Wait)模式代码实现方法,这篇文章就来演示一下 停机(Halt)模式的代码实现。 停机(Halt)模式的进入
默认情况下,AWS 使用 LATEST更新了最新 lambda 版本的别名,我假设执行以下步骤。 现在,LATEST别名点版本 5。 用户部署新版本的 lambda。 部署新版本时,LATEST别名仍
情况 App Engine Flex 上的自定义运行时(Docker/Node) 当我们自己管理资源时手动扩展到 1 个单个实例(2 cpu/6 gb ram) 配置了活性和就绪检查 正如预期的那样,
我是一名优秀的程序员,十分优秀!