slush-marklogic-node icon indicating copy to clipboard operation
slush-marklogic-node copied to clipboard

feature request: automatically choose an open port for ML

Open joemfb opened this issue 9 years ago • 4 comments

from marklogic/roxy#540:

If port 8040 is taken, the default generated app can't be bootstrapped without config changes, which can be unintuitive. If there's a local MarkLogic instance available when the app is generated, do we want to try to choose open ports.

That could be done without interaction with ML, if just run netstat or somesuch ...

joemfb avatar Oct 23 '15 19:10 joemfb

netstat assumes ML is on localhost. Often this is not the case.

paxtonhare avatar Oct 23 '15 23:10 paxtonhare

If there's a local MarkLogic instance available when the app is generated

;)

joemfb avatar Oct 24 '15 00:10 joemfb

It shouldn't be too difficult to just try to connect to host:port (with a blunt http get for instance), and see if that fails or not. I think I once wrote something similar in XQuery. Probably not perfect either, but seemed to work reasonably well..

grtjn avatar Nov 10 '15 21:11 grtjn

How about not doing it fully automatic, but connect to host:port selected by user, and warn if it looks like it is being used during questioning, and repeating port question until a free port was selected (or optionally an option to force continuing)..

grtjn avatar Jan 30 '16 21:01 grtjn