Hello,
Might well be something obvious, but I can’t see what’s wrong.
I have just made an app which basically consists of a vector.toml file.
Input: syslog over UDP.
Output: New Relic (to test whether it works).
So my Dockerfile installs vector and then runs it, telling it the path to that custom config file. Seems to be all fine since I can see in the logs it starts running and seems happy, config valid etc. I’ve tried breaking the config file and that gets spotted, so it must be ok.
But … the VM gets shut down. Hmm. Why would that be?
I wondered if it is because I have no healthchecks defined in the toml. But that config is called tcp_healthchecks, and I’m using UDP, so I didn’t think those would work?
Fly does see the VM as healthy. The deploy succeeds. But then when I try to send any messages to it, nothing happens. Which would be explained if it is shut down.
What’s strange is that if I run flyctl status
the app is shown as running. But in the flyctl logs
, it doesn’t. I see this:
2021-04-14T20:37:42.260Z 8ad3740e lhr [info] Pulling container image
2021-04-14T20:37:45.529Z 8ad3740e lhr [info] Unpacking image
2021-04-14T20:37:45.721Z 8ad3740e lhr [info] Preparing kernel init
2021-04-14T20:37:46.036Z 8ad3740e lhr [info] Configuring firecracker
2021-04-14T20:37:46.127Z 8ad3740e lhr [info] Starting virtual machine
2021-04-14T20:37:46.263Z 8ad3740e lhr [info] Starting init (commit: 0512da4)...
2021-04-14T20:37:46.284Z 8ad3740e lhr [info] Running: `/vector/bin/vector --config /app/vector.toml` as root
2021-04-14T20:37:46.288Z 8ad3740e lhr [info] 2021/04/14 20:37:46 listening on [IP]:22 (DNS: [IP]:53)
2021-04-14T20:37:46.342Z 8ad3740e lhr [info] Apr 14 20:37:46.340 INFO vector::app: Log level is enabled. level="vector=info,codec=info,vrl=info,file_source=info,tower_limit=trace,rdkafka=info"
2021-04-14T20:37:46.344Z 8ad3740e lhr [info] Apr 14 20:37:46.342 INFO vector::sources::host_metrics: PROCFS_ROOT is unset. Using default '/proc' for procfs root.
2021-04-14T20:37:46.346Z 8ad3740e lhr [info] Apr 14 20:37:46.344 INFO vector::sources::host_metrics: SYSFS_ROOT is unset. Using default '/sys' for sysfs root.
2021-04-14T20:37:46.349Z 8ad3740e lhr [info] Apr 14 20:37:46.348 INFO vector::app: Loading configs. path=[("/app/vector.toml", None)]
2021-04-14T20:37:46.403Z 8ad3740e lhr [info] Apr 14 20:37:46.402 INFO vector::topology: Running healthchecks.
2021-04-14T20:37:46.405Z 8ad3740e lhr [info] Apr 14 20:37:46.404 INFO vector::topology::builder: Healthcheck: Passed.
2021-04-14T20:37:46.407Z 8ad3740e lhr [info] Apr 14 20:37:46.406 INFO vector::topology: Starting source. name="syslog"
2021-04-14T20:37:46.408Z 8ad3740e lhr [info] Apr 14 20:37:46.407 INFO vector::topology: Starting sink. name="new_relic"
2021-04-14T20:37:46.409Z 8ad3740e lhr [info] Apr 14 20:37:46.408 INFO source{component_kind="source" component_name=syslog component_type=syslog}: vector::sources::syslog: Listening. addr=0.0.0.0:514 type="udp"
2021-04-14T20:37:46.411Z 8ad3740e lhr [info] Apr 14 20:37:46.409 INFO vector: Vector has started. version="0.12.2" git_version="v0.12.2" released="Tue, 30 Mar 2021 19:11:37 +0000" arch="x86_64"
2021-04-14T20:37:46.413Z 8ad3740e lhr [info] Apr 14 20:37:46.411 INFO vector::internal_events::api: API server running. address=0.0.0.0:8686 playground=http://0.0.0.0:8686/playground
2021-04-14T20:38:12.123Z 3bdaab5d lhr [info] Shutting down virtual machine
2021-04-14T20:38:12.212Z 3bdaab5d lhr [info] Sending signal SIGINT to main child process w/ PID 503
2021-04-14T20:38:12.214Z 3bdaab5d lhr [info] Apr 14 20:38:12.212 INFO vector: Vector has stopped.
2021-04-14T20:38:12.218Z 3bdaab5d lhr [info] Apr 14 20:38:12.216 INFO source{component_kind="source" component_name=syslog component_type=syslog}: vector::sources::syslog: Finished sending.
2021-04-14T20:38:13.220Z 3bdaab5d lhr [info] Starting clean up.
2021-04-14T20:38:13.220Z 3bdaab5d lhr [info] Main child exited normally with code: 0
As you can see, vector starts up, and then the VM shuts down I tried enabling and disabling the vector API, but it does the same. How do I keep the VM (and vector) running 24/7?
Do I need to run vector as a service? But even if I do, if the VM is shut down, that’s not going to help.
Thanks,