How to unregister a selenium grid node using chef - selenium-grid

I have a chef recipe that registers a node to a hub on the default port. But if the recipe is run on the node again , it gives me error which indicates that the port is already in use. So I need to have a check in place which either frees that port (not ideal) or randomly assigns a port while chef-client is running. I would like to unregister a node from the hub using a recipe. How do I do that?

With Selenium 2.53, you can unregister a node with an http command:
http://node_ip_address:port/selenium-server/driver/?cmd=shutDownSeleniumServer
Regards

Related

What ports does Selenium grid uses for heartbeat signals?

I am trying to setup a testing environment using Selenium grid. The hub is to be running on an AWS computer while the nodes would be executed on AWS Workspaces. At this point, nodes can register in the hub, but about one minute latter, the hub complains stating:
Marking the node http://192.168.x.x:1444 as down: cannot reach the node for 2 tries
I have been doing some research and the problem seems to be that the hub sends heartbeat signals that do not reach the nodes and then it drops the session. Since there is a firewall that might be blocking the heartbeat signals, I need to know which ports are used to send such signals in order to configure the firewall accordingly.
Thank you

Flink Jobmanager not able to see task managers

So I've installed an apache flink cluster on our network. I've done the configurations as illustrated below. This Master (JobManager) starts, and sends the start command to all the slaves via ssh. I can see that the task managers are running after they were started by the master node.
Config file on all nodes:
jobmanager.rpc.address: flmaster
jobmanager.rpc.port: 6123
jobmanager.heap.mb: 1024
taskmanager.heap.mb: 2048
taskmanager.numberOfTaskSlots: 1
taskmanager.memory.preallocate: false
parallelism.default: 1
jobmanager.web.port: 8081
taskmanager.tmp.dirs: /apps/storage/runtime/flink/workspace
recovery.mode: zookeeper
recovery.zookeeper.quorum:zk1:2181, zk2:2181, zk3:2181
recovery.zookeeper.storageDir: /apps/runtime/flink/recovery
env.java.home: /apps/java/
Then i have a file called slaves in the config folder with a list of the slaves nodes.
flSlave1
flSlave2
flSlave3
I then start it
../bin/start-cluster.sh
This opens an ssh session to all the slave nodes, and starts the task manager. I can see this with ps ax | grep java
I can open the Web-Ui on flMaster:8081
On the WebUI I can see the slave node count is 0. I have no task managers.
As a test, I started the wordcount.jar job, and it tells me it cannot run the job since there are no slots open.
/apps/flink/bin/flink run /apps/flink/examples/batch/WordCount.jar
the response:
07/20/2016 13:19:01 Job execution switched to status FAILING.
org.apache.flink.runtime.jobmanager.scheduler.NoResourceAvailableException: Not enough free slots available to run the job.*
Well I guess if there is no task managers/slave nodes, there will be no slots.
Any one ever seen this issue?
Use fully qualified hostname instead of short name. For e.g hostname.xyx.com instead of just hostname. OR you could also try using ip address.
Try doing a telnet on jobmanager machine rpc port. The taskmanagers talk with jobmanager through rpc. So check the network settings whether you are able to access the jobmanager and task managers' rpc ports or not.
Also check the blob server port. Check the taskmanager logs whether it is able to connect to the jobmanager blob server or not.

selenium grid parallel execution configuration

How to configure multiple nodes from a single machine.I want to write code for congifuration from a single virtual machine ,no need to go to each virtual machine and start hub nd node there.In another word,Ii want to run parallel execution of 10 virtual machine and want to configure for a single hub nd from single machine.help me.urgent
I think u can do it by configuring hub and node in the same machine but giving dfferent Port No's like 5566,5555 etc. i have not tried it, but give it a try

How to get node's port that is registered on hub

I setup a hub with (java -jar selenium-server-standalone-2.32.0.jar -role hub) on a machine A.
I used many machines to setup multiple nodes with random port to hub.
(
java -jar selenium-server-standalone-2.14.0.jar -role node -hub http:///[hub ip]:4444//grid//register [Random port number])
I know that I can see the node information (node's IP and port) that is registered on "
http:///[hub ip]:4444//grid//console"..
How can i get node's IP and port without open page "http:////[hub ip]:4444//grid//console"?.
Are there any API support to get node's ip or port?
Thanks
You can write a Selenium Grid Servlet to obtain this information - however this will run within the Selenium Grid process. Good example to set up a servlet can be found at this sample:
How do you create a /postResults servlet for selenium core
However, I get the sense that you want to expose this information to a third process. In this case, I would recommend 1) writing a servlet which exposes this data as json, 2) your process should make a web request to the servlet on the hub and parse the json response.

Selenium Failed to start Socket listener

I am starting selenium server.
After i enter java -jar selenium-server-standalone-2.0b2.jar in command prompt, i am getting following
See the 11th line(6th from bottom), which is saying Failed to start Socket listener.
What does it means? and How to start it ?
Please Help.
You need to kill the process that is using that port. You more than likely improperly closed Selenium the last time, and the process is continuing to run.
You can run netstat -ab in cmd to check the process that is using that port. More then likely going to be java.exe
In my experience, the most innovative approach in this case is to simply reboot your test machine. This should clear any rogue instances of the Selenium server running on the port.