Can you replicate from box1 to box2 the whole iocage dataset but still have seperate plugins on box2?

jstore

Dabbler
Joined
Nov 6, 2022
Messages
26
I just setup replication from Box1 to Box2. I did the whole pool /mnt/cache which includes my IOCAGE dataset and all my plugins.

I added a plugin on Box 2 only. This morning I looked and it appears that after midnight's replication, it rewrote everything to the copy from Box1 and the new plugin is gone.

That kind of makes sense if it was sending a snapshot over that obviously didn't have the local Box2 plugin but it's a bummer if you can't merge.

I could use Rsync I suppose but the snapshot and replication route just seems like the preferred method.

Did I do something wrong or is this just the way it is?
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,700
Snapshot replication doesn't allow for the contents to be modified on the replication target (if you want replication to continue).
 

jstore

Dabbler
Joined
Nov 6, 2022
Messages
26
Okay, makes sense.

So what I could do is replicate to an alternate location for a "gold" copy from mnt/cache on box1 to /mnt/cache_gold on Box2. Run a local IOCAGE on /mnt/cache Box2.

In the event Box1 goes down I can remount the gold to /mnt/cache or merge the two if I want them both.

I could also reverse that from Box2 to Box1, right?

Making the assumption here that you can't have two iocage/jail locations as I have never seen that mentioned.
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,700
Making the assumption here that you can't have two iocage/jail locations as I have never seen that mentioned.
Correct, you can't.

I could also reverse that from Box2 to Box1, right?
You can replicate anything you want in any direction as long as the target isn't going to get its own changes (that should remain) at some point.
 

jstore

Dabbler
Joined
Nov 6, 2022
Messages
26
Actually, since the two boxes are supposed to be indentical. (except for which one runs which plugin) It will be smarter to just have Box1 be the place they are all built. And then just manage which one is active manually.

Although
 

jstore

Dabbler
Joined
Nov 6, 2022
Messages
26
Just wanted to post the final solution.

I created new files systems on each box.

Box1
/iocage/ = main iocage for Box1
/iocage-box2/ = replicated iocage from Box2 to Box1

Box 2
/iocage/ = main iocage for Box2
/iocage-box1/ = replicated iocage from Box1 to Box2

Now each box runs its own Plugins. In the event I need to run them on the other box. I can rsync /iocage-box2/jails/whateverjailyouneed to /iocage/jails/whateverjailyouneed and then fire up the plugin. If it's bound to the localhost IP, it even changes it. As long as you name the plugins different on each box (ie - Grafana-Box1 and Grafana-Box2 instead of just Grafana on each box) then you can easily co-mingle plugins as needed.

Might be a bit of hack but it works well for having two machines be able to cover each other but remain independant. I wrote a simple script to to do the rsync that makes it easy to copy/move them. (Quick list of the directory, choose the ones you want, and then rsync)
 
Top