bcleonard / proxmox-qdevice

24 stars 9 forks source link

Error response from daemon: Address already in use #11

Closed nevusZ closed 2 months ago

nevusZ commented 2 months ago

hy, i changed volume path on my docker-compose.yaml file after restart of the container i get

"Error response from daemon: Address already in use"

that is strange because that container uses an extra ip after changing it to +1 in last octet, the container is running. but then i have to setup the qdevice again.

what can i do, to make the container run again with original ip?

for info, i needed to adjust the docker file for debian-bullseye-slim because of synology docker host

thanks

`services: qnetd: container_name: proxmox-qdevice

image: bcleonard/proxmox-qdevice

image: syno-pve-qdevice/proxmox-qdevice
build: .
ports:
  - "22:22"
  - "5403:5403"
environment:
  - "NEW_ROOT_PASSWORD=secret"
volumes:
  - /run/sshd
  - ./data:/etc/corosync
restart: unless-stopped
hostname: pve-qdevice
networks:
  vlan:
    ipv4_address: 192.168.11.47

networks: vlan: driver: macvlan driver_opts: parent: eth0 ipam: driver: default config:

bcleonard commented 2 months ago

The point of this docker container and it configuration was to that you wouldn't get the error "Error response from daemon: Address already in use". The reason for that error is because an existing process is already running port 22 (probably SSHD) on your synology host.

Proxmox Cluster Management requirements specify that port 22 is required. see https://pve.proxmox.com/wiki/Cluster_Manager#_requirements, requirement number 3.

If you want to run an unsupported proxmox external qnetd configuration, you need to change the following:

  1. change the port definition of "22:22" to "XXX:22" where XXX is your new external port.
  2. remove the networks section under the services definition
  3. remove the global networks section

This should bind the qnetd to your defined external port on the existing network. You'll then need to configure proxmox to connect to it via the port. Again, this is unsupported by proxmox.

The container was designed to run on bookworm, which synology users have found is incompatible with this container. I don't have a synology box so I can't test any configuration.

I've offered in the past to build a container based on bullseye, if and only if i can support the automated building / maintaining multiple docker configurations. I don't know how to do that. If somebody can provide me with a set of instructions or a link with them, I'd be wiling to check out it out in my spare (what little I have),

bcleonard commented 2 months ago

As i wrote that last comment, it occurred to me that you there are at least two other ways to get an external qnetd process on port 22 without using a 2nd IP address. I don't know anything about synology, so i don't know if either works, but these alternatives should work on UNIX like OS.

  1. change the port of SSHD running on your OS host from 22 to something else. I'm not gonna lie, this is extreme. Depending on what is running on your OS this maybe simple or it may not. That's gonna be dependent on your running environment.
  2. install a small virtual image and running the first alternative option there. This means you wouldn't have to change port 22 on your OS host, but it does mean you need have a 2nd IP address and assign it to the new virtual image. I mean small virtual image in that I run my qnetd-device container on a Debian instance with 1 GB Mem, 1 CPU & 10 GB of disk space. I run this virtual image on my TrueNAS Scale server which is on a separate physical device that my proxmox cluster.

Again I'm not sure how practical or easy these are to run. It was just alternatives that occurred to me.

your mileage may vary.

nevusZ commented 2 months ago

hy, i changed ip in the docker-compose.yaml to +1 higher container starts without error

assigning the new qdevice is simple as pvecm qdevice remove pvecm qdevice setup newip -f

i don't understand why it could not be started with old ip. doesn't matter, it works now thanks and sorry

bcleonard commented 2 months ago

No worries. Glad you got it figured out.