ebata@DESKTOP-P6KREM0 MINGW64 ~/xxxxxxx_ride_hailing_go $ docker push ebata_db_data_1_back2 The push refers to repository [docker.io/library/ebata_db_data_1_back2] d103f95b4a98: Preparing 195be5f8be1d: Preparing denied: requested access to the resource is denied
ebata@DESKTOP-P6KREM0 MINGW64 ~/xxxxxxx_ride_hailing_go $ docker push ebata_db_data_1_back2 The push refers to repository [docker.io/library/ebata_db_data_1_back2] d103f95b4a98: Preparing 195be5f8be1d: Preparing denied: requested access to the resource is denied
Reverse Provides: Reading package lists… Building dependency tree… Reading state information… E: Version '2.5.2+dfsg-1~exp1.pgdg90+1' for 'postgresql-11-postgis-2.5' was not found E: Version '2.5.2+dfsg-1~exp1.pgdg90+1' for 'postgresql-11-postgis-2.5-scripts' was not found E: Version '2.5.2+dfsg-1~exp1.pgdg90+1' for 'postgis' was not found Service 'db' failed to build: The command '/bin/sh -c apt-get update && apt-cache showpkg postgresql-$PG_MAJOR-postgis-$POSTGIS_MAJOR && apt-get install -y --no-install-recommends postgresql-$PG_MAJOR-postgis-$POSTGIS_MAJOR=$POSTGIS_VERSION postgresql-$PG_MAJOR-postgis-$POSTGIS_MAJOR-scripts=$POSTGIS_VERSION postgis=$POSTGIS_VERSION postgresql-$PG_MAJOR-pgrouting && rm -rf /var/lib/apt/lists/*' returned a non-zero code: 100
xxxxxxx_ride_hailing_go_app_1 ./main Exit 1 xxxxxxx_ride_hailing_go_data_1 sh Exit 0 xxxxxxx_ride_hailing_go_db_1 docker-entrypoint.sh postgres Exit 1 xxxxxxx_ride_hailing_go_nginx_1 nginx -g daemon off; Up 0.0.0.0:80->80/tcp xxxxxxx_ride_hailing_go_tile38_1 tile38-server -d /data Up 0.0.0.0:19851->9851/tcp xxxxxxx_ride_hailing_go_tile38_data_1 sh Exit 0
となって、DBがどうしても動いてくれない問題発生。手動で起動を試みてみたら、こうなった。
C:\Users\ebata\xxxxxxx_ride_hailing_go>docker start -a xxxxxxx_ride_hailing_go_db_1 Error: Database is uninitialized and superuser password is not specified. You must specify POSTGRES_PASSWORD to a non-empty value for the superuser. For example, "-e POSTGRES_PASSWORD=password" on "docker run".
You may also use "POSTGRES_HOST_AUTH_METHOD=trust" to allow all connections without a password. This is not recommended.
See PostgreSQL documentation about "trust": https://www.postgresql.org/docs/current/auth-trust.html
docker-compose run app go run cmd/dummy_data_generator_concurrent_small/main.go
ああ、疲れた。(これで、ようやく眠れる)
==========
$ cd /path/to/hitachi_ride_hailing_go
$ docker-compose build
# 上記部分が完了するまで、はじめての場合はネットワーク環境により数分かかります
$ docker-compose up -d
$ docker-compose run db createdb -h db -U postgres gis
$ docker-compose run db psql -h db -U postgres -d gis -c 'CREATE EXTENSION pgrouting CASCADE; CREATE EXTENSION hstore;'
$ docker-compose run db psql -h db -U postgres gis < repository/postgresql/data/dump.sql
$ docker-compose run db psql -h db -U postgres -d gis -f repository/postgresql/data/postgis-vt-util.sql
$ docker-compose stop
$ docker-compose start
$ docker-compose run app migrate -database 'postgres://postgres:@db:5432/gis?sslmode=disable' -path ./repository/postgresql/migrations up
$ docker-compose run app go run cmd/dummy_data_generator_concurrent_small/main.go
$ docker-compose stop
$ docker-compose start
m_conn->prepare( // HACK 1. 2文を1文に(PQExec仕様)、2. JOIN周り、 3. ORDER BYを消せないか?
"find_shortest_path_by_dijkstra_calc",
R"(
INSERT INTO s_dijkstra_memoization (source, target, node, edge, length_m)
SELECT
$1, $2, d.node, d.edge, coalesce(ways.length_m, 0) AS length_m
FROM
pgr_dijkstra (
'SELECT gid AS id, source, target, length_m AS cost from ways',
start_vid:=$1::bigint, end_vid:=$2::bigint, directed:=false::boolean
) as d LEFT JOIN ways ON ways.gid = d.edge
WHERE NOT EXISTS (SELECT source, target FROM s_dijkstra_memoization WHERE source = $1 AND target = $2);
)",
//RETURNING node, edge, length_m;
2
);
ca_sim=# SELECT * FROM pgr_dijkstra( 'SELECT gid, source, target, length_m AS cost FROM ways', 2, 3 ); ERROR: Column 'id' not Found CONTEXT: SQL function "pgr_dijkstra" statement 1
ERROR: function pgr_dijkstra(unknown, unknown, unknown, directed => boolean) is not unique LINE 7: pgr_dijkstra( ^ HINT: Could not choose a best candidate function. You might need to add explicit type casts.
Error:ERROR: function pgr_dijkstra(unknown, unknown, unknown, directed => boolean) is not unique LINE 7: pgr_dijkstra( ^ HINT: Could not choose a best candidate function. You might need to add explicit type casts.
pgr_dijkstra(
(SELECT gid AS id, source, target, length_m AS cost from ways),
start_vid:=$1::bigint, end_vid:=$2::bigint, directed:=false::boolean
) as d LEFT JOIN ways ON ways.gid = d.edge
ERROR: subquery must return only one column
LINE 8: (SELECT gid AS id, source, target, length_m AS cost fr...
^
Error:ERROR: subquery must return only one column
LINE 8: (SELECT gid AS id, source, target, length_m AS cost fr...
FROM
pgr_dijkstra(
'SELECT gid AS id, source, target, length_m AS cost from ways',
(start_vid:=$1::bigint), (end_vid:=$2::bigint), directed:=false::boolean
) as d LEFT JOIN ways ON ways.gid = d.edge
ERROR: syntax error at or near ":="
LINE 9: (start_vid:=$1::bigint), (end_vid:=$2::bigint), direct...
^
Error:ERROR: syntax error at or near ":="
LINE 9: (start_vid:=$1::bigint), (end_vid:=$2::bigint), direct...
すでに試してみたが、これもやってみた
pgr_dijkstra(
'SELECT gid AS id, source, target, length_m AS cost from ways',
$1, $2, directed:=false::boolean
) as d LEFT JOIN ways ON ways.gid = d.edge
ERROR: function pgr_dijkstra(unknown, unknown, unknown, directed => boolean) is not unique
LINE 7: pgr_dijkstra(
^
HINT: Could not choose a best candidate function. You might need to add explicit type casts.
Error:ERROR: function pgr_dijkstra(unknown, unknown, unknown, directed => boolean) is not unique
LINE 7: pgr_dijkstra(
^
HINT: Could not choose a best candidate function. You might need to add explicit type casts.
FROM
pgr_dijkstra(
'SELECT gid AS id, source, target, length_m AS cost from ways',
$1::bigint, $2::bigint, directed:=false::boolean
) as d LEFT JOIN ways ON ways.gid = d.edge