spawnctl, you can get the logs of a running data container.
In this tutorial we will create a data image and then use it to create a data container. Then, we will get the logs of that data container.
As a prerequisite you should've followed the instructions to install spawnctl
Create a file
development.yamlwith your data image specifications.sourceType: emptyname: devengine: postgresqlversion: 11.0
In this case we want to create a PostgreSQL data image that is completely empty and is named
Run the following command to create a data image.$ spawnctl create data-image -f ./development.yamlData image 'dev' (10001) created!
You can verify your data image by running the following command.$ spawnctl get data-imagesNAME IMAGE ID ENGINE STATUS MESSAGE CREATEDdev 10001 PostgreSQL 2 Created 2 minutes ago
Create a data container from the newly created data image.$ spawnctl create data-container --image devData container 'dev-rambbomj' (10001) created!-> Host=instances.spawn.cc;Port=53223;User ID=<some_user_id>;Password=<some_password>;
You can verify your data container was properly created by running the following command.$ spawnctl get data-containersNAME CONTAINER ID REVISION STATUS MESSAGE ENGINE CREATEDdev-rambbomj 10001 rev.0 2 Running PostgreSQL 1 minute ago
You can now get the logs of the data container using the
spawnctl logs data-containercommand.$ spawnctl logs data-container dev-rambbomj2019-08-19 12:10:45.302 UTC  LOG: listening on IPv4 address "0.0.0.0", port 54322019-08-19 12:10:45.302 UTC  LOG: listening on IPv6 address "::", port 54322019-08-19 12:10:45.306 UTC  LOG: listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"2019-08-19 12:10:45.358 UTC  LOG: database system was interrupted; last known up at 2019-08-19 12:10:23 UTC2019-08-19 12:10:46.670 UTC  FATAL: the database system is starting up2019-08-19 12:10:49.679 UTC  FATAL: the database system is starting up2019-08-19 12:10:52.009 UTC  LOG: database system was not properly shut down; automatic recovery in progress2019-08-19 12:10:52.026 UTC  LOG: invalid record length at 0/1652570: wanted 24, got 02019-08-19 12:10:52.026 UTC  LOG: redo is not required2019-08-19 12:10:52.065 UTC  LOG: database system is ready to accept connections