You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficcontrol.apache.org by de...@apache.org on 2017/01/20 21:39:38 UTC
[1/6] incubator-trafficcontrol git commit: updates for decoupling the
pgmigration flow
Repository: incubator-trafficcontrol
Updated Branches:
refs/heads/master 9d9afe158 -> 293e486d9
updates for decoupling the pgmigration flow
Project: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/commit/9a40b705
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/tree/9a40b705
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/diff/9a40b705
Branch: refs/heads/master
Commit: 9a40b705d3f2b1f462a09eb4baf96c49ef19766c
Parents: 6f8a062
Author: Dewayne Richardson <de...@apache.org>
Authored: Wed Jan 18 09:22:10 2017 -0700
Committer: Dan Kirkwood <da...@gmail.com>
Committed: Thu Jan 19 10:54:13 2017 -0700
----------------------------------------------------------------------
traffic_ops/app/db/pg-migration/README.md | 23 ++----
.../pg-migration/docker-compose-pgmigration.yml | 77 --------------------
.../app/db/pg-migration/docker-compose.yml | 3 +-
traffic_ops/app/db/pg-migration/pgmigration.yml | 56 ++++++++++++++
.../app/db/pg-migration/postgres_host.yml | 6 +-
traffic_ops/app/db/pg-migration/runconvert.sh | 15 ----
6 files changed, 69 insertions(+), 111 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/9a40b705/traffic_ops/app/db/pg-migration/README.md
----------------------------------------------------------------------
diff --git a/traffic_ops/app/db/pg-migration/README.md b/traffic_ops/app/db/pg-migration/README.md
index d1c9be3..58c675f 100644
--- a/traffic_ops/app/db/pg-migration/README.md
+++ b/traffic_ops/app/db/pg-migration/README.md
@@ -1,23 +1,16 @@
-
# Converting existing mysql `traffic_ops` database to postgres
* Requires a recent ( 1.12 ) version of `docker-engine` and `docker-compose`.
-* Ensure database is up-to-date with latest `traffic_ops` migrations for `mysql` (last 1.x release of `traffic_ops`)
- * `cd /opt/traffic_ops/app; ./db/admin.pl --env=production upgrade`
-
-* In development environment, `cd traffic_ops/app/db/pg-migration`.
+* Modify the mysql.env for your existing Mysql Database
-* Provide URL, username password for existing mysql install of `traffic_ops`:
+* Modify the postgres.env for your new Postgres Database
+ (NOTE: do not set the POSTGRES_HOST to 'localhost' it needs to be the IP address or DNS available hostname so that the container can reach out to Postgres)
- * `docker-compose -f docker-compose-pgmigration.yml down -v && \
- docker-compose -f docker-compose-pgmigration.yml build && \
- TO_SERVER=https://traffic_ops.kabletown.com TO_USER=me TO_PASSWORD='my!passwd' docker-compose -f docker-compose-pgmigration.yml up`
+* Ensure that your new Postgres service is running (local or remote)
-* Postgres is still running in a docker container -- dump the database to a file:
- `docker exec -it pgmigration_postgres_host_1 pg_dump -Utraffic_ops >pg.sql`
+* Run the Mysql to Postgres Migration Docker flow
+ * `$ docker-compose down -v && docker-compose build && TO_SERVER=https://traffic_ops.kabletown.com TO_USER=me TO_PASSWORD='my!passwd' docker-compose -f pgmigration.yml up`
-* Or examine the database directly:
- * `docker run -it --rm --network pgmigration_default --link pgmigration_postgres_host_1:postgres postgres psql -h postgres -U traffic_ops -d traffic_ops`
- * `\dt`
- * `select * from cdns;`
+* Run the Postgres datatype conversion
+ * `$ docker-compose -f convert.yml up`
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/9a40b705/traffic_ops/app/db/pg-migration/docker-compose-pgmigration.yml
----------------------------------------------------------------------
diff --git a/traffic_ops/app/db/pg-migration/docker-compose-pgmigration.yml b/traffic_ops/app/db/pg-migration/docker-compose-pgmigration.yml
deleted file mode 100644
index 1b3b7f0..0000000
--- a/traffic_ops/app/db/pg-migration/docker-compose-pgmigration.yml
+++ /dev/null
@@ -1,77 +0,0 @@
-
-# Ansible managed
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-version: '2'
-
-volumes:
- sync:
- pgdata:
-
-networks:
- default:
- driver: bridge
-
-services:
- # dataimport reads data from an existing traffic_ops server running mysql thru the API
- dataimport:
- extends:
- service: dataimport
- file: dataimport.yml
- volumes:
- - sync:/sync
- - ./mysql/initdb.d:/docker-entrypoint-initdb.d
-
- # mysql_host loads mysql data locally and provides direct access for pgloader
- mysql:
- extends:
- service: mysql_host
- file: mysql_host.yml
- depends_on:
- - dataimport
- volumes:
- - sync:/sync
- - ./mysql/conf.d:/etc/mysql/conf.d
- - ./mysql/initdb.d:/docker-entrypoint-initdb.d
-
- # db provides a postgres data to import data to
- postgres:
- extends:
- service: db
- file: docker-compose.yml
- depends_on:
- - mysql
- volumes:
- - sync:/sync
-
- # pgloader converts the data from mysql to postgres
- pgloader:
- extends:
- service: pgloader
- file: pgloader.yml
- depends_on:
- - mysql
- - postgres
- volumes:
- - sync:/sync
-
- # convert runs needed post-migration conversions
- convert:
- extends:
- service: convert
- file: convert.yml
- depends_on:
- - postgres
- volumes:
- - sync:/sync
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/9a40b705/traffic_ops/app/db/pg-migration/docker-compose.yml
----------------------------------------------------------------------
diff --git a/traffic_ops/app/db/pg-migration/docker-compose.yml b/traffic_ops/app/db/pg-migration/docker-compose.yml
index 1a97110..b989860 100644
--- a/traffic_ops/app/db/pg-migration/docker-compose.yml
+++ b/traffic_ops/app/db/pg-migration/docker-compose.yml
@@ -33,9 +33,8 @@ services:
- default
networks:
- default:
+ default:
driver: bridge
volumes:
pgdata:
-
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/9a40b705/traffic_ops/app/db/pg-migration/pgmigration.yml
----------------------------------------------------------------------
diff --git a/traffic_ops/app/db/pg-migration/pgmigration.yml b/traffic_ops/app/db/pg-migration/pgmigration.yml
new file mode 100644
index 0000000..536ea53
--- /dev/null
+++ b/traffic_ops/app/db/pg-migration/pgmigration.yml
@@ -0,0 +1,56 @@
+# Ansible managed
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+version: '2'
+
+volumes:
+ sync:
+ pgdata:
+
+networks:
+ default:
+ driver: bridge
+
+services:
+ # dataimport reads data from an existing traffic_ops server running mysql thru the API
+ dataimport:
+ extends:
+ service: dataimport
+ file: dataimport.yml
+ volumes:
+ - sync:/sync
+ - ./mysql/initdb.d:/docker-entrypoint-initdb.d
+
+ # mysql_host loads mysql data locally and provides direct access for pgloader
+ mysql:
+ extends:
+ service: mysql_host
+ file: mysql_host.yml
+ depends_on:
+ - dataimport
+ volumes:
+ - sync:/sync
+ - ./mysql/conf.d:/etc/mysql/conf.d
+ - ./mysql/initdb.d:/docker-entrypoint-initdb.d
+
+ # pgloader converts the data from mysql to postgres
+ pgloader:
+ extends:
+ service: pgloader
+ file: pgloader.yml
+ depends_on:
+ - mysql
+ volumes:
+ - sync:/sync
+
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/9a40b705/traffic_ops/app/db/pg-migration/postgres_host.yml
----------------------------------------------------------------------
diff --git a/traffic_ops/app/db/pg-migration/postgres_host.yml b/traffic_ops/app/db/pg-migration/postgres_host.yml
index 9e1100f..f8e0439 100644
--- a/traffic_ops/app/db/pg-migration/postgres_host.yml
+++ b/traffic_ops/app/db/pg-migration/postgres_host.yml
@@ -18,7 +18,9 @@ services:
build:
context: ..
dockerfile: pg-migration/Dockerfile-postgres
- env_file:
- - postgres.env
+ environment:
+ - POSTGRES_DB=traffic_ops
+ - POSTGRES_PASSWORD=twelve
+ - POSTGRES_USER=traffic_ops
ports:
- 5432
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/9a40b705/traffic_ops/app/db/pg-migration/runconvert.sh
----------------------------------------------------------------------
diff --git a/traffic_ops/app/db/pg-migration/runconvert.sh b/traffic_ops/app/db/pg-migration/runconvert.sh
index 641c966..60cf16c 100755
--- a/traffic_ops/app/db/pg-migration/runconvert.sh
+++ b/traffic_ops/app/db/pg-migration/runconvert.sh
@@ -11,20 +11,5 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
-#
-
-set -x
-
-waiting=/sync/waiting-for-pgloader
-touch $waiting
-
-# Wait for pgloader to finish
-while [[ -f $waiting ]]; do
- ls -l $waiting
- sleep 3
-done
-
-echo "Looks like pgloader is finished.. Converting.."
-
# Load required conversion of booleans
psql postgresql://$POSTGRES_USER:$POSTGRES_PASSWORD@$POSTGRES_HOST/$POSTGRES_DB < ./convert_bools.sql
[2/6] incubator-trafficcontrol git commit: more updates
Posted by de...@apache.org.
more updates
Project: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/commit/18e42a94
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/tree/18e42a94
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/diff/18e42a94
Branch: refs/heads/master
Commit: 18e42a94eb7afd897082cfbb0d2a1d55176cc80c
Parents: 9a40b70
Author: Dewayne Richardson <de...@apache.org>
Authored: Wed Jan 18 09:35:25 2017 -0700
Committer: Dan Kirkwood <da...@gmail.com>
Committed: Thu Jan 19 10:54:21 2017 -0700
----------------------------------------------------------------------
traffic_ops/app/db/pg-migration/README.md | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/18e42a94/traffic_ops/app/db/pg-migration/README.md
----------------------------------------------------------------------
diff --git a/traffic_ops/app/db/pg-migration/README.md b/traffic_ops/app/db/pg-migration/README.md
index 58c675f..15bcda3 100644
--- a/traffic_ops/app/db/pg-migration/README.md
+++ b/traffic_ops/app/db/pg-migration/README.md
@@ -1,8 +1,12 @@
# Converting existing mysql `traffic_ops` database to postgres
-* Requires a recent ( 1.12 ) version of `docker-engine` and `docker-compose`.
+## Overview
+ - This conversion will convert an existing Mysql database by pulling the data from Traffic Ops (using Tools.dbdump) and loading that
+ data into a temporary Mysql Database to make it easier to work with in the conversion process. Additionally, it will use the 'pgloader' tool
+ to perform that conversion in yet another Docker container which will then push that converted data into your permanent Postgres instance(s).
-* Modify the mysql.env for your existing Mysql Database
+Software requirements
+* Requires a recent ( 1.12 ) version of `docker-engine` and `docker-compose`.
* Modify the postgres.env for your new Postgres Database
(NOTE: do not set the POSTGRES_HOST to 'localhost' it needs to be the IP address or DNS available hostname so that the container can reach out to Postgres)
[3/6] incubator-trafficcontrol git commit: fixes README for
mysql->postgres conversion
Posted by de...@apache.org.
fixes README for mysql->postgres conversion
Project: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/commit/afec4470
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/tree/afec4470
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/diff/afec4470
Branch: refs/heads/master
Commit: afec4470e56b6f7e5d2741a370c8eb0a125c2717
Parents: 18e42a9
Author: Dan Kirkwood <da...@gmail.com>
Authored: Thu Jan 19 15:06:05 2017 -0700
Committer: Dan Kirkwood <da...@gmail.com>
Committed: Thu Jan 19 15:06:05 2017 -0700
----------------------------------------------------------------------
traffic_ops/app/db/pg-migration/README.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/afec4470/traffic_ops/app/db/pg-migration/README.md
----------------------------------------------------------------------
diff --git a/traffic_ops/app/db/pg-migration/README.md b/traffic_ops/app/db/pg-migration/README.md
index 15bcda3..4d0ba53 100644
--- a/traffic_ops/app/db/pg-migration/README.md
+++ b/traffic_ops/app/db/pg-migration/README.md
@@ -14,7 +14,7 @@ Software requirements
* Ensure that your new Postgres service is running (local or remote)
* Run the Mysql to Postgres Migration Docker flow
- * `$ docker-compose down -v && docker-compose build && TO_SERVER=https://traffic_ops.kabletown.com TO_USER=me TO_PASSWORD='my!passwd' docker-compose -f pgmigration.yml up`
+ * `$ docker-compose -f pgmigration.yml down -v && docker-compose -f pgmigration.yml build && TO_SERVER=https://traffic_ops.kabletown.com TO_USER=me TO_PASSWORD='my!passwd' docker-compose -f pgmigration.yml up`
* Run the Postgres datatype conversion
* `$ docker-compose -f convert.yml up`
[6/6] incubator-trafficcontrol git commit: This closes #201
Posted by de...@apache.org.
This closes #201
Project: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/commit/293e486d
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/tree/293e486d
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/diff/293e486d
Branch: refs/heads/master
Commit: 293e486d93d5468e6b03f6482bfddc680d56104c
Parents: d501355
Author: Dewayne Richardson <de...@apache.org>
Authored: Fri Jan 20 14:39:08 2017 -0700
Committer: Dewayne Richardson <de...@apache.org>
Committed: Fri Jan 20 14:39:08 2017 -0700
----------------------------------------------------------------------
----------------------------------------------------------------------
[5/6] incubator-trafficcontrol git commit: Merge branch
'dcompose+master' of https://github.com/dangogh/incubator-trafficcontrol
Posted by de...@apache.org.
Merge branch 'dcompose+master' of https://github.com/dangogh/incubator-trafficcontrol
Project: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/commit/d5013557
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/tree/d5013557
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/diff/d5013557
Branch: refs/heads/master
Commit: d501355716cfba9c7ee56f3de7c2f08b01bd35b5
Parents: 9d9afe1 422c152
Author: Dewayne Richardson <de...@apache.org>
Authored: Fri Jan 20 14:38:36 2017 -0700
Committer: Dewayne Richardson <de...@apache.org>
Committed: Fri Jan 20 14:38:36 2017 -0700
----------------------------------------------------------------------
.../app/db/pg-migration/Dockerfile-convert | 2 +-
.../app/db/pg-migration/Dockerfile-mysql | 2 +-
.../app/db/pg-migration/Dockerfile-postgres | 2 +-
traffic_ops/app/db/pg-migration/README.md | 22 ++----
traffic_ops/app/db/pg-migration/dataimport.yml | 6 +-
.../pg-migration/docker-compose-pgmigration.yml | 77 --------------------
.../app/db/pg-migration/docker-compose.yml | 7 +-
traffic_ops/app/db/pg-migration/mysql.env | 2 +
traffic_ops/app/db/pg-migration/pgmigration.yml | 56 ++++++++++++++
traffic_ops/app/db/pg-migration/postgres.env | 6 +-
.../app/db/pg-migration/postgres_host.yml | 6 +-
traffic_ops/app/db/pg-migration/runconvert.sh | 15 ----
traffic_ops/app/db/pg-migration/runpgloader.sh | 9 +--
13 files changed, 87 insertions(+), 125 deletions(-)
----------------------------------------------------------------------
[4/6] incubator-trafficcontrol git commit: additional changes to
support Ansible streamlining
Posted by de...@apache.org.
additional changes to support Ansible streamlining
Project: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/commit/422c1522
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/tree/422c1522
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/diff/422c1522
Branch: refs/heads/master
Commit: 422c15222bef5a714bff0db7d98b551b4d7e3c15
Parents: afec447
Author: Dewayne Richardson <de...@apache.org>
Authored: Fri Jan 20 13:58:17 2017 -0700
Committer: Dan Kirkwood <da...@gmail.com>
Committed: Fri Jan 20 14:15:33 2017 -0700
----------------------------------------------------------------------
traffic_ops/app/db/pg-migration/Dockerfile-convert | 2 +-
traffic_ops/app/db/pg-migration/Dockerfile-mysql | 2 +-
traffic_ops/app/db/pg-migration/Dockerfile-postgres | 2 +-
traffic_ops/app/db/pg-migration/README.md | 9 +++------
traffic_ops/app/db/pg-migration/dataimport.yml | 6 ++++--
traffic_ops/app/db/pg-migration/docker-compose.yml | 6 ++++--
traffic_ops/app/db/pg-migration/mysql.env | 2 ++
traffic_ops/app/db/pg-migration/postgres.env | 6 +++++-
traffic_ops/app/db/pg-migration/runpgloader.sh | 9 +--------
9 files changed, 22 insertions(+), 22 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/422c1522/traffic_ops/app/db/pg-migration/Dockerfile-convert
----------------------------------------------------------------------
diff --git a/traffic_ops/app/db/pg-migration/Dockerfile-convert b/traffic_ops/app/db/pg-migration/Dockerfile-convert
index f10624f..4f1223d 100644
--- a/traffic_ops/app/db/pg-migration/Dockerfile-convert
+++ b/traffic_ops/app/db/pg-migration/Dockerfile-convert
@@ -11,7 +11,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
-FROM postgres:9.6
+FROM dewrich/postgres:latest
MAINTAINER Dan Kirkwood
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/422c1522/traffic_ops/app/db/pg-migration/Dockerfile-mysql
----------------------------------------------------------------------
diff --git a/traffic_ops/app/db/pg-migration/Dockerfile-mysql b/traffic_ops/app/db/pg-migration/Dockerfile-mysql
index 36e7826..a4bf51f 100644
--- a/traffic_ops/app/db/pg-migration/Dockerfile-mysql
+++ b/traffic_ops/app/db/pg-migration/Dockerfile-mysql
@@ -11,7 +11,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
-FROM mysql:5.5
+FROM mysql:5.6
MAINTAINER Dan Kirkwood
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/422c1522/traffic_ops/app/db/pg-migration/Dockerfile-postgres
----------------------------------------------------------------------
diff --git a/traffic_ops/app/db/pg-migration/Dockerfile-postgres b/traffic_ops/app/db/pg-migration/Dockerfile-postgres
index 4ff1f83..1279b50 100644
--- a/traffic_ops/app/db/pg-migration/Dockerfile-postgres
+++ b/traffic_ops/app/db/pg-migration/Dockerfile-postgres
@@ -11,7 +11,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
-FROM postgres:9.6
+FROM dewrich/postgres:latest
MAINTAINER Dan Kirkwood
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/422c1522/traffic_ops/app/db/pg-migration/README.md
----------------------------------------------------------------------
diff --git a/traffic_ops/app/db/pg-migration/README.md b/traffic_ops/app/db/pg-migration/README.md
index 4d0ba53..f565291 100644
--- a/traffic_ops/app/db/pg-migration/README.md
+++ b/traffic_ops/app/db/pg-migration/README.md
@@ -1,16 +1,13 @@
# Converting existing mysql `traffic_ops` database to postgres
-## Overview
- - This conversion will convert an existing Mysql database by pulling the data from Traffic Ops (using Tools.dbdump) and loading that
- data into a temporary Mysql Database to make it easier to work with in the conversion process. Additionally, it will use the 'pgloader' tool
- to perform that conversion in yet another Docker container which will then push that converted data into your permanent Postgres instance(s).
-
-Software requirements
* Requires a recent ( 1.12 ) version of `docker-engine` and `docker-compose`.
+* Modify the mysql.env for your existing Mysql Database
+
* Modify the postgres.env for your new Postgres Database
(NOTE: do not set the POSTGRES_HOST to 'localhost' it needs to be the IP address or DNS available hostname so that the container can reach out to Postgres)
+
* Ensure that your new Postgres service is running (local or remote)
* Run the Mysql to Postgres Migration Docker flow
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/422c1522/traffic_ops/app/db/pg-migration/dataimport.yml
----------------------------------------------------------------------
diff --git a/traffic_ops/app/db/pg-migration/dataimport.yml b/traffic_ops/app/db/pg-migration/dataimport.yml
index b949925..1087efa 100644
--- a/traffic_ops/app/db/pg-migration/dataimport.yml
+++ b/traffic_ops/app/db/pg-migration/dataimport.yml
@@ -20,5 +20,7 @@ services:
context: .
dockerfile: Dockerfile-traffic_ops-client
restart: "no"
- env_file:
- - dataimport.env
+ environment:
+ - TO_USER
+ - TO_PASSWORD
+ - TO_SERVER
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/422c1522/traffic_ops/app/db/pg-migration/docker-compose.yml
----------------------------------------------------------------------
diff --git a/traffic_ops/app/db/pg-migration/docker-compose.yml b/traffic_ops/app/db/pg-migration/docker-compose.yml
index b989860..31145a4 100644
--- a/traffic_ops/app/db/pg-migration/docker-compose.yml
+++ b/traffic_ops/app/db/pg-migration/docker-compose.yml
@@ -19,7 +19,7 @@ services:
context: ..
dockerfile: pg-migration/Dockerfile-postgres
environment:
- - PGDATA=/opt/postgresql/data
+ - PGDATA=/opt/postgresql/data/pgdata
- POSTGRES_DB=traffic_ops
- POSTGRES_PASSWORD=twelve
- POSTGRES_USER=traffic_ops
@@ -28,7 +28,8 @@ services:
ports:
- "5432:5432"
volumes:
- - pgdata:/opt/postgresql/data
+ - /opt/postgresql/data/pgdata:/opt/postgresql/data/pgdata
+ - /var/log/postgresql:/var/log/postgresql
networks:
- default
@@ -38,3 +39,4 @@ networks:
volumes:
pgdata:
+
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/422c1522/traffic_ops/app/db/pg-migration/mysql.env
----------------------------------------------------------------------
diff --git a/traffic_ops/app/db/pg-migration/mysql.env b/traffic_ops/app/db/pg-migration/mysql.env
index 15d3bea..ead4c15 100644
--- a/traffic_ops/app/db/pg-migration/mysql.env
+++ b/traffic_ops/app/db/pg-migration/mysql.env
@@ -1,3 +1,4 @@
+#!/bin/bash -x
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -11,6 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
+
MYSQL_DATABASE=traffic_ops_db
MYSQL_HOST=mysql
MYSQL_RANDOM_ROOT_PASSWORD=yes
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/422c1522/traffic_ops/app/db/pg-migration/postgres.env
----------------------------------------------------------------------
diff --git a/traffic_ops/app/db/pg-migration/postgres.env b/traffic_ops/app/db/pg-migration/postgres.env
index c08bc5b..a759b89 100644
--- a/traffic_ops/app/db/pg-migration/postgres.env
+++ b/traffic_ops/app/db/pg-migration/postgres.env
@@ -1,3 +1,4 @@
+#!/bin/bash -x
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -11,7 +12,10 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
-POSTGRES_HOST=postgres
+
+POSTGRES_HOST=localhost
POSTGRES_DB=traffic_ops
POSTGRES_PASSWORD=twelve
POSTGRES_USER=traffic_ops
+POSTGRES_USER_UID=9999
+POSTGRES_USER_GID=9999
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/422c1522/traffic_ops/app/db/pg-migration/runpgloader.sh
----------------------------------------------------------------------
diff --git a/traffic_ops/app/db/pg-migration/runpgloader.sh b/traffic_ops/app/db/pg-migration/runpgloader.sh
index 2aa2206..b56cb55 100755
--- a/traffic_ops/app/db/pg-migration/runpgloader.sh
+++ b/traffic_ops/app/db/pg-migration/runpgloader.sh
@@ -29,11 +29,4 @@ pgloader -v \
--cast 'type double to numeric drop typemod' \
mysql://$MYSQL_USER:$MYSQL_PASSWORD@$MYSQL_HOST/traffic_ops_db \
postgresql://$POSTGRES_USER:$POSTGRES_PASSWORD@$POSTGRES_HOST/$POSTGRES_DB
-
-waiting=/sync/waiting-for-pgloader
-while [[ ! -f $waiting ]]; do
- echo "Nothing waiting for pgloader?"
- sleep 3
-done
-
-rm $waiting
+exit 0