亚洲av成人无遮挡网站在线观看,少妇性bbb搡bbb爽爽爽,亚洲av日韩精品久久久久久,兔费看少妇性l交大片免费,无码少妇一区二区三区

  免費(fèi)注冊(cè) 查看新帖 |

Chinaunix

  平臺(tái) 論壇 博客 文庫(kù)
最近訪問板塊 發(fā)新帖
查看: 33570 | 回復(fù): 5
打印 上一主題 下一主題

Delightful Database Seeding with Docker [復(fù)制鏈接]

論壇徽章:
32
CU大牛徽章
日期:2013-05-20 10:45:13每日論壇發(fā)貼之星
日期:2015-09-07 06:20:00每日論壇發(fā)貼之星
日期:2015-09-07 06:20:00數(shù)據(jù)庫(kù)技術(shù)版塊每日發(fā)帖之星
日期:2015-12-13 06:20:0015-16賽季CBA聯(lián)賽之江蘇
日期:2016-03-03 11:56:13IT運(yùn)維版塊每日發(fā)帖之星
日期:2016-03-06 06:20:00fulanqi
日期:2016-06-17 17:54:25IT運(yùn)維版塊每日發(fā)帖之星
日期:2016-07-23 06:20:0015-16賽季CBA聯(lián)賽之佛山
日期:2016-08-11 18:06:41JAVA
日期:2016-10-25 16:09:072017金雞報(bào)曉
日期:2017-01-10 15:13:292017金雞報(bào)曉
日期:2017-02-08 10:33:21
跳轉(zhuǎn)到指定樓層
1 [收藏(0)] [報(bào)告]
發(fā)表于 2015-09-20 15:19 |只看該作者 |倒序?yàn)g覽
Our entire application stack is packaged using Docker. One particular aspect of getting our application stack up and running is the initial data population. Having streamlined this, we’re able to have a complete environment up and running within minutes.

Prior to setting up seeding with Docker we often had problems with outdated examples and leftover data from previous demos. We also spent too much time manually keeping everything in sync. As our customer base grew, this was not a sustainable situation.

Using Docker we have created a user friendly tool that anyone in our organization can use, (even sales) both when resetting a demo laptop, and when getting a new on-site installation quickly up and running.

論壇徽章:
32
CU大;照
日期:2013-05-20 10:45:13每日論壇發(fā)貼之星
日期:2015-09-07 06:20:00每日論壇發(fā)貼之星
日期:2015-09-07 06:20:00數(shù)據(jù)庫(kù)技術(shù)版塊每日發(fā)帖之星
日期:2015-12-13 06:20:0015-16賽季CBA聯(lián)賽之江蘇
日期:2016-03-03 11:56:13IT運(yùn)維版塊每日發(fā)帖之星
日期:2016-03-06 06:20:00fulanqi
日期:2016-06-17 17:54:25IT運(yùn)維版塊每日發(fā)帖之星
日期:2016-07-23 06:20:0015-16賽季CBA聯(lián)賽之佛山
日期:2016-08-11 18:06:41JAVA
日期:2016-10-25 16:09:072017金雞報(bào)曉
日期:2017-01-10 15:13:292017金雞報(bào)曉
日期:2017-02-08 10:33:21
2 [報(bào)告]
發(fā)表于 2015-09-20 15:19 |只看該作者
Now, let’s dive into the details!

We maintain all our demo workspaces, tutorials and help texts in our SaaS-production environment – this makes it easier to keep everything up-to-date. When running offline demos or setting up on-site solutions at customers, we need a way to copy data from the production environment to seed theses installations.

Prior to using Docker this was an error prone and ad-hoc activity. After moving to Docker we are now able to do this as part of every build. The process of preparing and applying a data seed includes the following steps:

Copy production data and clean it
Package and distribute the seed data
Import the data

Step 1 – Cleaning the database dump
To filter out other environment specific meta-data, we need to clean up the database dump before it is distributed. The core of the clean up is a throw away MongoDB Docker container. The reason we have the separate step with the throw away container is a security precaution – we don’t want to expose filtered out data in a lower Docker file system layer.

We start the container with the database dump available in a mounted volume, fire up MongoDB, run a clean up script in MongoDB, and finally dump the cleaned database to the mounted volume. The Docker container is discarded, so the only side effect of this process is the cleaned database dump.

論壇徽章:
32
CU大;照
日期:2013-05-20 10:45:13每日論壇發(fā)貼之星
日期:2015-09-07 06:20:00每日論壇發(fā)貼之星
日期:2015-09-07 06:20:00數(shù)據(jù)庫(kù)技術(shù)版塊每日發(fā)帖之星
日期:2015-12-13 06:20:0015-16賽季CBA聯(lián)賽之江蘇
日期:2016-03-03 11:56:13IT運(yùn)維版塊每日發(fā)帖之星
日期:2016-03-06 06:20:00fulanqi
日期:2016-06-17 17:54:25IT運(yùn)維版塊每日發(fā)帖之星
日期:2016-07-23 06:20:0015-16賽季CBA聯(lián)賽之佛山
日期:2016-08-11 18:06:41JAVA
日期:2016-10-25 16:09:072017金雞報(bào)曉
日期:2017-01-10 15:13:292017金雞報(bào)曉
日期:2017-02-08 10:33:21
3 [報(bào)告]
發(fā)表于 2015-09-20 15:20 |只看該作者
Step 2 – Packaging the data for distribution
For easy distribution, we package the database dump, the binary files, the MongoDB dump, and restore tools in one Docker image.

Dockerfile: FROM mongo:3.0.1 ADD cleaned.tar.gz /work ADD attachments.tar.gz /work

論壇徽章:
32
CU大;照
日期:2013-05-20 10:45:13每日論壇發(fā)貼之星
日期:2015-09-07 06:20:00每日論壇發(fā)貼之星
日期:2015-09-07 06:20:00數(shù)據(jù)庫(kù)技術(shù)版塊每日發(fā)帖之星
日期:2015-12-13 06:20:0015-16賽季CBA聯(lián)賽之江蘇
日期:2016-03-03 11:56:13IT運(yùn)維版塊每日發(fā)帖之星
日期:2016-03-06 06:20:00fulanqi
日期:2016-06-17 17:54:25IT運(yùn)維版塊每日發(fā)帖之星
日期:2016-07-23 06:20:0015-16賽季CBA聯(lián)賽之佛山
日期:2016-08-11 18:06:41JAVA
日期:2016-10-25 16:09:072017金雞報(bào)曉
日期:2017-01-10 15:13:292017金雞報(bào)曉
日期:2017-02-08 10:33:21
4 [報(bào)告]
發(fā)表于 2015-09-20 15:20 |只看該作者
Step 3 – Distribution
Once the data is packaged along with the MongoDB client, we upload the image to our private account on Docker Hub. Right now this is triggered manually, automation is just a matter of configuration.

This allows our developers, sales people and customers to update their local installations by downloading the latest version by pulling the latest image from Docker Hub.

論壇徽章:
32
CU大;照
日期:2013-05-20 10:45:13每日論壇發(fā)貼之星
日期:2015-09-07 06:20:00每日論壇發(fā)貼之星
日期:2015-09-07 06:20:00數(shù)據(jù)庫(kù)技術(shù)版塊每日發(fā)帖之星
日期:2015-12-13 06:20:0015-16賽季CBA聯(lián)賽之江蘇
日期:2016-03-03 11:56:13IT運(yùn)維版塊每日發(fā)帖之星
日期:2016-03-06 06:20:00fulanqi
日期:2016-06-17 17:54:25IT運(yùn)維版塊每日發(fā)帖之星
日期:2016-07-23 06:20:0015-16賽季CBA聯(lián)賽之佛山
日期:2016-08-11 18:06:41JAVA
日期:2016-10-25 16:09:072017金雞報(bào)曉
日期:2017-01-10 15:13:292017金雞報(bào)曉
日期:2017-02-08 10:33:21
5 [報(bào)告]
發(fā)表于 2015-09-20 15:21 |只看該作者
Step 4 – Seeding
Since all data is packaged along with the MongoDB client, seeding is a breeze. It is basically a matter of running two docker commands:

To populate the database, the seed image is started with a link to the MongoDB container, and restores the database using the bundled database dump:

docker run --rm --link ardoq_mongodb_1:mongodb ardoq/demo-seed mongorestore -h mongodb /work/demo_seed/

To populate the binary attachments, the seed image is started again with the data image volumes mounted, and simply copies the files over and exits:

docker run --rm --volumes-from ardoq_api_1 ardoq/demo-seed:latest cp -r /work/attachments /data

論壇徽章:
32
CU大牛徽章
日期:2013-05-20 10:45:13每日論壇發(fā)貼之星
日期:2015-09-07 06:20:00每日論壇發(fā)貼之星
日期:2015-09-07 06:20:00數(shù)據(jù)庫(kù)技術(shù)版塊每日發(fā)帖之星
日期:2015-12-13 06:20:0015-16賽季CBA聯(lián)賽之江蘇
日期:2016-03-03 11:56:13IT運(yùn)維版塊每日發(fā)帖之星
日期:2016-03-06 06:20:00fulanqi
日期:2016-06-17 17:54:25IT運(yùn)維版塊每日發(fā)帖之星
日期:2016-07-23 06:20:0015-16賽季CBA聯(lián)賽之佛山
日期:2016-08-11 18:06:41JAVA
日期:2016-10-25 16:09:072017金雞報(bào)曉
日期:2017-01-10 15:13:292017金雞報(bào)曉
日期:2017-02-08 10:33:21
6 [報(bào)告]
發(fā)表于 2015-09-20 15:21 |只看該作者
Summary

Keeping on-site installations up-to-date with the latest data used to be time consuming and error prone. Using Docker we are well on our way to automating the entire process.

您需要登錄后才可以回帖 登錄 | 注冊(cè)

本版積分規(guī)則 發(fā)表回復(fù)

  

北京盛拓優(yōu)訊信息技術(shù)有限公司. 版權(quán)所有 京ICP備16024965號(hào)-6 北京市公安局海淀分局網(wǎng)監(jiān)中心備案編號(hào):11010802020122 niuxiaotong@pcpop.com 17352615567
未成年舉報(bào)專區(qū)
中國(guó)互聯(lián)網(wǎng)協(xié)會(huì)會(huì)員  聯(lián)系我們:huangweiwei@itpub.net
感謝所有關(guān)心和支持過ChinaUnix的朋友們 轉(zhuǎn)載本站內(nèi)容請(qǐng)注明原作者名及出處

清除 Cookies - ChinaUnix - Archiver - WAP - TOP