Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix problems with running node and hub on one system under Debian #58

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

bitte-ein-bit
Copy link

Under Debian the provided sample for grid in a box does not work due to both init scripts checking for port 4444 in use. With a started hub a node will not start even though a node does not use port 4444.

I removed the check and some (obsolete?) variables

@marcgascon
Copy link
Contributor

+1 and @jhoblitt can you please check this and merge? It's a very important improvement if you want to run the server, hub and node in the same running server.

It's important to fix it please.

@jhoblitt
Copy link
Owner

jhoblitt commented Feb 2, 2016

@marcgascon Why would you want to run the server and hub on the same node? They generally should use the same port.

@bitte-ein-bit
Copy link
Author

@jhoblitt this fix is necessary to run a hub and a node on the same box i.e. grid in a box. The removed check is simply superfluous as the node does not use port 4444. So the check for a port which the hub uses will block the node from (re-)starting.

@marcgascon
Copy link
Contributor

@jhoblitt I want to run everything on the same server because it is expected to use as test environment. We are in AWS and it's not necessary to pay for 2 instances. Also I think that it's better not to limit the possibilities of something like that. What do you think?

@marcgascon
Copy link
Contributor

@bitte-ein-bit maybe the HTTP port can be passed as an argument to the template or defaults 4444. This way you don't need to remove code, you should partametrize it, and you can continue checking if the port you want to start the server, hub or node it's free or not.

@bitte-ein-bit
Copy link
Author

Well let's look at the redhat init.d script. There is no check for the port.

Let's look at the default ports. I have the following processes running:

# ps aux | grep selenium | grep java
selenium   701  0.0  0.0  19816   392 ?        S     2015   0:00 /usr/bin/daemon --name=seleniumnode --inherit --output=/opt/selenium/log/node_stdout.log --pidfile=/var/run/seleniumnode/seleniumnode.pid --env=DISPLAY=:0 -- java -jar /opt/selenium/jars/selenium-server-standalone-2.45.0.jar -Dwebdriver.enable.native.events=1 -role node -hub http://sel.dev.fqdn:4444/grid/register
selenium   702  0.1  3.9 1147752 82260 ?       Sl    2015 181:20 java -jar /opt/selenium/jars/selenium-server-standalone-2.45.0.jar -Dwebdriver.enable.native.events=1 -role node -hub http://sel.dev.fqdn:4444/grid/register
selenium  2799  0.0  0.0  19816   388 ?        S     2015   0:00 /usr/bin/daemon --name=seleniumhub --inherit --output=/opt/selenium/log/hub_stdout.log --pidfile=/var/run/seleniumhub/seleniumhub.pid --env=DISPLAY=:0 -- java -jar /opt/selenium/jars/selenium-server-standalone-2.45.0.jar -role hub
selenium  2800  0.1  4.0 1152116 83216 ?       Sl    2015 145:26 java -jar /opt/selenium/jars/selenium-server-standalone-2.45.0.jar -role hub

they use those default ports:

# netstat -anpt | grep LISTEN | grep java
tcp6       0      0 :::5555                 :::*                    LISTEN      702/java
tcp6       0      0 :::4444                 :::*                    LISTEN      2800/java

So why should the node check for a used port 4444? There is no command line argument in use to make a node listen to a specific port. Either someone has to extend the manifests to use a port variable and enforce that option. Or this merge has to be accepted with the knowledge that this is not the best solution but fixes the issue of running a hub and a node on the same box.

@jhoblitt
Copy link
Owner

@bitte-ein-bit Could you rebase on current master?

@dejo1307
Copy link

dejo1307 commented Oct 6, 2016

Hi,

Any plan to continue on this? This is basically preventing usage of of both node and hub class on the same server.

Asking just to avoid sending another pull request tackling the same issue (in this case I would just add a port as a parameter).

Thanks

@bitte-ein-bit
Copy link
Author

not using puppet currently. Someone else feel free to pick this code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants