libopenstorage / openstorage

A multi-host clustered implementation of the open storage specification
Apache License 2.0
525 stars 118 forks source link

Use of more than one driver in OSD #719

Open msolefonte opened 5 years ago

msolefonte commented 5 years ago

Is this a BUG REPORT or FEATURE REQUEST?: Just a QUESTION, but could be both a BUG REPORT or a FEATURE REQUEST depending on the developers being conscientious or not of this comportment.

What happens: Actually, you can not use more than one driver in OSD because you get a collision in the SDK ports. For example, trying to use Portworx and Network File System together, this is the result of the execution:

INFO[0000] OSD enabling cluster mode.                   
INFO[0000] Starting REST service on socket : /var/lib/osd/cluster/osd.sock 
INFO[0000] Starting volume driver: pwx                  
INFO[0000] Starting REST service on socket : /var/lib/osd/driver/pwx.sock 
INFO[0000] Starting REST service on port : 2376         
INFO[0000] Starting REST service on socket : /run/docker/plugins/pwx.sock 
INFO[0000] Starting REST service on port : 2377         
INFO[0000] CSI gRPC Server ready on /var/lib/osd/driver/pwx-csi.sock 
INFO[0000] SDK gRPC Server ready on [::]:9100           
INFO[0000] SDK gRPC REST Gateway started on port :9110  
INFO[0000] Starting volume driver: nfs                  
INFO[0000] NFS driver initializing with 127.0.0.1:/nfs  
INFO[0000] Calling mkdirAll: /var/lib/openstorage/nfs/127.0.0.1 
INFO[0000] NFS initialized and driver mounted at:  /var/lib/openstorage/nfs/ 
INFO[0000] Starting REST service on socket : /var/lib/osd/driver/nfs.sock 
INFO[0000] Starting REST service on socket : /run/docker/plugins/nfs.sock 
INFO[0000] CSI gRPC Server ready on /var/lib/osd/driver/nfs-csi.sock 
WARN[0000] Failed to start SDK server for driver nfs: Unable to setup server: Unable to setup server: listen tcp :9100: bind: address already in use 

What you expected to happen: I would like OpenStorage to be able to use two or more drivers together. Why? Because it would be interesting to have the opportunity to manage some storage in one server and some storage in another one. For example, using NFS to share files and AWS EBS to share blocks, with the benefits of the best one for each one of the requirements.

msolefonte commented 5 years ago

Can someone take a look to this? Thanks.

lpabon commented 5 years ago

Could you run two SDK servers on two different ports?

msolefonte commented 5 years ago

@lpabon You can not, because if you establish some port (or use the default one), the same port is used for all the drivers implied in the execution of OSD. There is no way to define two custom ports for each driver (Perhaps it would be a good parameter to set in the config file under the driver options).

Therefore, the only way of running two SDK servers with two different ports would be running two OSD in the same host, which is #720.

Thanks again.