openshift 数据库和数据目录

openshift database and data directory

我正在查看一个 README 文件,该文件提出了一些关于 Openshift 上的数据库持久性的问题。

Note: Every time you push, everything in your remote repo dir gets recreated please store long term items (like an sqlite database) in the OpenShift data directory, which will persist between pushes of your repo. The OpenShift data directory is accessible relative to the remote repo directory (../data) or via an environment variable OPENSHIFT_DATA_DIR.

https://github.com/ryanj/nodejs-custom-version-openshift/blob/master/README#L24

但是,我在 Openshift 网站上找不到这方面的确认信息。这个自述文件过时了吗?我不想对此进行测试,因此如果有人愿意分享任何第一手知识,我们将不胜感激。

是的,关于 SQLite 的自述文件是最新的。所有齿轮都安装了 SQLite。数据应存储在设备上的永久存储目录中。这不适用于 MySQL/MongoDB/PostgreSQL,因为这些数据库是预先配置为使用持久存储的附加盒,而 SQLite 只需安装即可使用。

在此处查看 OpenShift Origin 文档中的第一个通知:https://docs.openshift.org/origin-m4/oo_cartridge_guide.html

具体来说:

Cartridges and Persistent Storage: Every time you push, everything in your remote repo directory is recreated. Store long term items (like an sqlite database) in the OpenShift data directory, which will persist between pushes of your repo. The OpenShift data directory can be found via the environment variable $OPENSHIFT_DATA_DIR.

官方 OpenShift Django QuickStart 展示了通过部署操作挂钩将 SQLite 添加到应用程序时应遵循的设计模式。参见:https://github.com/openshift/django-example/blob/master/.openshift/action_hooks/deploy