Hello,
My machines are
Machines
PROCESS ID VERSION REGION STATE ROLE CHECKS LAST UPDATED
app 3287ee30bdd4d8 29 arn stopped primary 2025-11-22T22:00:27Z
app 3d8d1170a4d458 29 arn stopped replica 2025-11-22T22:00:37Z
app e2863e26a33238 29 arn stopped replica 2025-11-22T22:07:44Z
If I start all machines, to see the database checksums, I get:
[touny@touny-lenovo snippets]$ fly ssh console -s -C "cat /litefs/db.sqlite-pos"
? Select VM: arn: 3287ee30bdd4d8 fdaa:d:7960:a7b:5e2:bf73:194e:2 shy-star-7613
Connecting to fdaa:d:7960:a7b:5e2:bf73:194e:2... complete
0000000000000002/a3a1744061b6cd3b
[touny@touny-lenovo snippets]$ fly ssh console -s -C "cat /litefs/db.sqlite-pos"
? Select VM: arn: 3d8d1170a4d458 fdaa:d:7960:a7b:5d6:24f0:2b5:2 aged-violet-322
Connecting to fdaa:d:7960:a7b:5d6:24f0:2b5:2... complete
cat: can't open '/litefs/db.sqlite-pos': No such file or directory
Error: ssh shell: Process exited with status 1
[touny@touny-lenovo snippets]$ fly ssh console -s -C "cat /litefs/db.sqlite-pos"
? Select VM: arn: e2863e26a33238 fdaa:d:7960:a7b:5bc:f663:c6d8:2 solitary-sky-4523
Connecting to fdaa:d:7960:a7b:5bc:f663:c6d8:2... complete
cat: can't open '/litefs/db.sqlite-pos': No such file or directory
Error: ssh shell: Process exited with status 1
I am using static leasing. my litefs.yml is
litefs.yml
# Database
# # # # #
# directory where the application accesses the database
fuse:
dir: "/litefs"
# a directory for LiteFS internal data
# must be mounted to a persistent volume
data:
dir: "/var/lib/litefs"
# Lease protocol
# # # # #
lease:
# Consul protocol: https://consul.io/
type: "static"
# nodes which could possibly become primary, are nodes in the primary region
candidate: ${FLY_ALLOC_ID == "3287ee30bdd4d8"}
# API URL other nodes will use to connect to this node
advertise-url: "http://${FLY_ALLOC_ID}.vm.${FLY_APP_NAME}.internal:20202"
consul:
# URL of the Consul cluster
url: "${FLY_CONSUL_URL}"
# A unique key shared by all nodes
key: "${FLY_APP_NAME}/primary"
# Proxy — redirecting requests
# # # # #
proxy:
# address for the proxy to listen on
# matches fly
# if building a local docker container, matches it
addr: ":8080"
# port the application is listening on
# matches the application itself
target: "localhost:8081"
# file name of SQLite database
db: "db.sqlite"
# Application Server
# # # # #
exec:
# migrations on candidate nodes
# not sure why valid
- cmd: "${SCH_PATH}/migrate.sh"
if-candidate: true
# web app
- cmd: "/bin/sh -c /bin/app"
If I stop the primary machine and start a replica machine, a request to my app SEEMS to be redirected to the primary, as I notice the primary is immediately started after the request.
Thank you in advance.