Sharing shared volumes


(Rob Spencer) #1

Hey guys,

On the topic of High Availability…

I have two containers:
web1
data

I want to create a third: web2.

Can I point to the same shared volumes for both web containers?

volumes:
  - volume:
      host: /var/discourse/shared/web
      guest: /shared
  - volume:
      host: /var/discourse/shared/web/log/var-log
      guest: /var/log

(Jay Pfaffman) #2

This is a good question. It seems like one way to solve this problem is to use Amazon S3. A related question is, if you have multiple web containers across multiple servers, then what do you do?


(Rob Spencer) #3

I thought it was a good question too, but yet to get a response from the developers :frowning:


(Sam Saffron) #4

You can point shared web to be the same but logs need to be separate.

Though I have no idea why you would run 2 web containers on same host, this is NINJA level setup. If you are in NINJA mode I am surprised you even have these questions :hugs:


(Jay Pfaffman) #5

I’ve got no idea about 2 web containers on one machine either, but having two web servers on different machines I can imagine.


(Rob Spencer) #6

NInja master say “never assume you know everything, always ask person who wrote the damn thing” :wink:

Thanks, I’ll try this out.

The two web containers gets around the downtime while rebuilding a container. There’s no value in running them on two separate servers, which it’s already running on a high availability cloud platform. There’s a weird temptation to build HA on top of HA, but it’s just a waste of resources and ends up with server sprawl :slight_smile:


(Jay Pfaffman) #7

If you have a separate data and web containers you can bootstrap the web container without stopping the one that’s running. When it’s done you then destroy the old one and start the new one. Down time is only a few seconds.


(Rob Spencer) #8

Is there a way to back out to the old one in case there are any issues with the new one?


(Jay Pfaffman) #9

Yes. Just leave it running.


(Rob Spencer) #10

I’m confused…

How do you start the same one? I would be easier to create a new one with a different name, an have the old one in standby in case you need to roll back.


(qianqiang) #11

Even with two different machines, we can also consider ways to mount remote disks.