Giter VIP home page Giter VIP logo

Comments (6)

jesperpedersen avatar jesperpedersen commented on August 30, 2024

We should def error out if the configuration is the same.

However, it should be possible to run multiple instance on the same server - like one for the primary instance, and another for standby

from pgagroal.

fluca1978 avatar fluca1978 commented on August 30, 2024

We should def error out if the configuration is the same.

The only "quick" way to find out if the configuration is (almost) the same is the failure of bind or the same usage of the managament socket (and it could be also the metrics one). If any of these is already in use, we should abort.

However, it should be possible to run multiple instance on the same server - like one for the primary instance, and another for standby

Good point, but while it is immediate to find out a "misrun" by the user when using the same configuration for multiple instances, if the pid_file is absolute, this becomes harder to detect if the pid file is relative (until we fix the above socket problems).

from pgagroal.

decarv avatar decarv commented on August 30, 2024

@fluca1978 I couldn't reproduce this, but I may have misunderstood the bug.

What I am trying to do is set the unix_socket_dir to a relative path in config and then run two pgagroal instances from different directories. What I get is a bind error.

If you could give me more details I could work something out.

from pgagroal.

fluca1978 avatar fluca1978 commented on August 30, 2024

@fluca1978 I couldn't reproduce this, but I may have misunderstood the bug.

What I am trying to do is set the unix_socket_dir to a relative path in config and then run two pgagroal instances from different directories. What I get is a bind error.

If you could give me more details I could work something out.

When I launch the second instance, I got a bind error too, but the instance continues to run. Is your second instance aborting? That could be due to the presence or absence of other network cards?

from pgagroal.

decarv avatar decarv commented on August 30, 2024

When I launch the second instance, I got a bind error too, but the instance continues to run. Is your second instance aborting?

Yes, mine aborts exactly after returning from pgagroal_bind function.

$ ./pgagroal -c pgagroal.conf
2024-04-03 10:54:45 DEBUG configuration.c:2656 PID file automatically set to: [./pgagroal.2345.pid]
2024-04-03 10:54:45 DEBUG network.c:648 server: bind: localhost:2345 (Address already in use)
2024-04-03 10:54:45 FATAL main.c:924 pgagroal: Could not bind to localhost:2345

That could be due to the presence or absence of other network cards?

I have researched this and it's possible that it is a matter of how the OS deals with SO_REUSEADDR, but I need to research more. Do you have details on the address-port pairs that were bound on each processes?

from pgagroal.

fluca1978 avatar fluca1978 commented on August 30, 2024

Apprently the problem is with ``hostconfiguration: if set tolocalhost` the second instance aborts as expected:

% pgagroal
-> DEBUG network.c:648 server: bind: localhost:54322 (Address already in use)
-> DEBUG network.c:648 server: bind: localhost:54322 (Address already in use)
-> FATAL main.c:924 pgagroal: Could not bind to localhost:54322

but when set to * the second instance runs.

from pgagroal.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.