包含标签 Docker articles

使用 Docker swarm 构建 PostgreSQL 集群

又是一个渣翻,Copyright belongs to the original text。

原文地址

背景

PostgreSQL 在 9.0 版本已经开始持续接收大量的增强,包括:

  1. 异步拓展
  2. 同步拓展
  3. 仲裁提交
  4. 级联拓展
  5. 逻辑拓展

PostgreSQL 文档也提供了一个 overview 以及 不同拓展方法的比较。详见PostgreSQL 集群策略比较

用于部署 PostgreSQL 的拓展的主拓展的方法论,是一个重要的工具来为你的数据库集群创建高可用的环境。需要一个合适的部署策略来确保你的数据被保存到不同磁盘,以及不同的数据中心。

……

Continue reading

使用Docker时遇到的sitemap问题

这两天感觉博客访问量已经不能靠用嘴宣传了,于是决定做一下sitemap,但是发现django自带的sitemap生成器存在这样的问题:生成的sitemap是依照container的hostname来显示的。 为此我查询了一下其他人是怎么搞的,发现他们都把nginx和django放在一个容器下——但是如此构建不仅麻烦,似乎违背了docker的构建思路,在一个container里面放了多个进程。因此,我认为下面的方案是合理的。 解决方案 Enabling the sites framework To enable the sites framework, follow these steps: Add ‘django.contrib.sites’ to your INSTALLED_APPS setting. Define a SITE_ID setting: SITE_ID = 1 Run migrate. django.contrib.sites registers a post_migrate signal handler which creates a default site named example.com with the domain example.com. This site will also be created after Django creates the test database. To set the correct name and domain for your project, you can use a data migration.……

Continue reading

使用Docker的一些Tips

Docker是一种强大的DevOps工具,使用其无论是作为开发环境还是生产环境,但是非常

好的选择;在这篇文章中,讲讲Docker的几个开发Tips。

……

Continue reading

Latest articles

Categories

Tags

Meta