data not in new volume after using "fly scale count 2"

I used the command “fly scale count 2” and it created another machine and another volume, but now i don’t have access to my old data anymore.

I still have the ‘old’ snapshot

But the new volume does not contain it.

I would like to know how I can ‘mirror’ one volume into another.

Thanks

Here is command history:

Vik@Vik: pts/0: 121 files 2,2Mb ❯ fly scale show

VM Resources for app: ilse

Groups
NAME COUNT KIND CPUS MEMORY REGIONS
app 1 shared 1 256 MB gru

: command not found

dom 24 mar 2024 18:25:53 -03
~/ink/@website
Vik@Vik: pts/0: 121 files 2,2Mb ❯ fly scale count 2
App ‘ilse’ is going to be scaled according to this plan:
+1 machines for group ‘app’ on region ‘gru’ of size ‘shared-cpu-1x’
+1 volumes for group ‘app’ in region ‘gru’
? Scale app ilse? Yes
Executing scale plan
Creating volume ilse_data region:gru size:5GiB
Created e2865666b32038 group:app region:gru size:shared-cpu-1x volume:vol_vd33xem6p1wgl8xr

dom 24 mar 2024 18:26:54 -03
~/ink/@website
Vik@Vik: pts/0: 121 files 2,2Mb ❯ fly vol
Manage Fly Volumes.

Usage:
flyctl volumes [command]

Aliases:
volumes, volume, vol

Available Commands:
create Create a new volume for an app.
destroy Destroy one or more volumes.
extend Extend a volume to the specified size.
fork Fork the specified volume.
list List the volumes associated with an app.
show Show the details of the specified volume.
snapshots Manage volume snapshots
update Update a volume for an app.

Flags:
-h, --help help for volumes

Global Flags:
-t, --access-token string Fly API Access Token
–debug Print additional logs and traces
–verbose Verbose output

Use “flyctl volumes [command] --help” for more information about a command.

dom 24 mar 2024 19:39:31 -03
~/ink/@website
Vik@Vik: pts/0: 121 files 2,2Mb ❯ fly vol show
? ID STATE NAME SIZE REGION ZONE ENCRYPTED ATTACHED VM CREATED AT
Select volume: vol_0enxv30dxm1v8okp created ilse_data 5GB gru 692f false e2865666b75948 10 months ago
ID: vol_0enxv30dxm1v8okp
Name: ilse_data
App: ilse
Region: gru
Zone: 692f
Size GB: 5
Encrypted: false
Created at: 25 May 23 20:39 UTC
Snapshot retention: 5
Scheduled snapshots: true

dom 24 mar 2024 19:39:46 -03
~/ink/@website
Vik@Vik: pts/0: 121 files 2,2Mb ❯ fly vol show
? ID STATE NAME SIZE REGION ZONE ENCRYPTED ATTACHED VM CREATED AT
Select volume: vol_vd33xem6p1wgl8xr created ilse_data 5GB gru 692f false e2865666b32038 1 hour ago
ID: vol_vd33xem6p1wgl8xr
Name: ilse_data
App: ilse
Region: gru
Zone: 692f
Size GB: 5
Encrypted: false
Created at: 24 Mar 24 21:26 UTC
Snapshot retention: 5
Scheduled snapshots: true

Added volumes

Hi… This is how Fly volumes work. The older volume still has your data, and the new one starts out empty.

There is no mirroring feature in the platform; your app has to keep the two in synch itself.

If you say a little more about what the application is for, people might have suggestions about particular strategies…

1 Like

Hi… This is how Fly volumes work

I stopped the second machine as a temporary fix, but how do i copy the content of the first volume into the second volume? my fly.io config says my data in in “/data” but what does that mean? which volume? for which machine?

Should I “fork” one volume, and then attach that forked volume into the new machine?

Each machine has its own, separate /data, corresponding to its own volume.

(You can see which goes with which via fly m list—under VOLUME.)

It sounds like your application is writing dynamically, in which case forking would only be a very temporary solution. The two would quickly slip out of synch.


You might like Tigris better for this; in that case, the two machines share an object store that does get kept coherent.

It’s not actually a filesystem, though, so it would require changes to your code.

(Every solution would require modifications.)

1 Like

Added storage

How to i revert back to one machine? my server is now missing a file read 50% of the time :sob:

I already made one bucket, do you know an easy way to migrate all of my data there? I saw the pricing and its reasonable.

fly m destroy, if the unwanted machine is already stopped.

(Then fly vol destroy for the newly unattached volume.)

1 Like

My system is not missing 50% of the file reads

I’ll migrate to the ‘Tigris’ later on, i’ll make the migration scripts and changes to my code.

THANK YOU

:people_hugging:

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.