LINBIT / linstor-gateway

Manages Highly-Available iSCSI targets, NVMe-oF targets, and NFS exports via LINSTOR
GNU General Public License v3.0
28 stars 6 forks source link

Connection to a remote LINSTOR controller possible ? #8

Closed acidrop closed 2 years ago

acidrop commented 2 years ago

Hello,

Was testing linstor-gateway on 2 nodes which both act only as linstor-satellites (none of them acts as controller). Controller runs on 3 different nodes and it's managed by drbd-reactor on those 3 nodes for HA. In order for the 2 linstor gateway nodes to be able to locate the controller I use the following environment variable..

LS_CONTROLLERS=linctrl01,linctrl02,linctrl03

I'm able to do linstor n l and I've also added the 2 linstor-gateway nodes as satellites, so everything looks good, until I try to create an iscsi target. It seems that the linstor-gateway expects the controller to be listening locally on port 3370 and hence it fails.. Is it possible to instruct the linstor-gateway to connect to the remote controller instead ? ... or it's mandatory to have linstor-controller configured on same 2 linstor-gateway hosts managed by drbd-reactor for HA ?

root@linstor-gw-01[05:11 PM]:~ linstor-gateway iscsi create iqn.2019-08.com.linbit:example 10.10.12.20/24 20G --username=foo --password=bar --resource-group=iscsi_group

Error: failed to create iscsi resource: failed to check for existing config: failed to fetch file list: Get "http://localhost:3370/v1/files?content=true&limit=0&offset=0": dial tcp 127.0.0.1:3370: connect: connection refused
Usage:
  linstor-gateway iscsi create IQN SERVICE_IPS [VOLUME_SIZE]... [flags]

Examples:
linstor-gateway iscsi create iqn.2019-08.com.linbit:example 192.168.122.181/24 2G

Flags:
      --allowed-initiators strings   Restrict which initiator IQNs are allowed to connect to the target
  -h, --help                         help for create
  -p, --password string              Set the password to use for CHAP authentication
  -g, --resource-group string        Set the LINSTOR resource group (default "DfltRscGrp")
  -u, --username string              Set the username to use for CHAP authentication

Global Flags:
      --config string     Config file to load (default "/etc/linstor-gateway/linstor-gateway.toml")
  -c, --connect string    LINSTOR Gateway server to connect to (default "http://localhost:8080")
      --loglevel string   Set the log level (as defined by logrus) (default "info")

failed to create iscsi resource: failed to check for existing config: failed to fetch file list: Get "http://localhost:3370/v1/files?content=true&limit=0&offset=0": dial tcp 127.0.0.1:3370: connect: connection refused