mingfang/docker-predictionio

failed run the ./run.sh

Closed this issue · 16 comments

I have run PredictionIO inside Docker successfully.but when I run the quickstart, there is an error.

Making sure EventServer is running...
nc: connect to localhost port 7070 (tcp) failed: Connection refused

Make sure you start the EventServer first by running runsvdir-start&.
You may still see this error message once or twice if the server is still starting up.

how to check the EventSever. I can access the dashboard on localhost:9000.
there is no error when I run the runsvdir-start&. in the container

It looks like things are running fine.
Just let the run.sh script run. You may see the Connection refused repeat several times, with 3 second pause in between. After 10 secs or so you should see things happening.
This is what it can look like...

root@cf3b4647a1ee:/# cd /quickstartapp/
root@cf3b4647a1ee:/quickstartapp# ./run.sh 
Making sure EventServer is running...
nc: connect to localhost port 7070 (tcp) failed: Connection refused
nc: connect to localhost port 7070 (tcp) failed: Connection refused
nc: connect to localhost port 7070 (tcp) failed: Connection refused
nc: connect to localhost port 7070 (tcp) failed: Connection refused
nc: connect to localhost port 7070 (tcp) failed: Connection refused
nc: connect to localhost port 7070 (tcp) failed: Connection refused
nc: connect to localhost port 7070 (tcp) failed: Connection refused
Connection to localhost 7070 port [tcp/*] succeeded!
Creating MyRecommendation...
...<a lot of stuff and end with this>
2014-11-27 03:15:07,725 INFO  workflow.CoreWorkflow$ - Your engine has been trained successfully.
You may now deploy engine by running cd /quickstartapp/MyRecommendation && pio deploy --ip 0.0.0.0

yeah,my console is just like yours ,but i did not wait as long as 10 secs
let me try again
which component is using this 7070 ports

Port 7070 is what the EventServer listens on.
It is a core piece of PredictionIO.

sorry for this stupid question.
earlier I run these commands on my host console,which I thougtht host and container share the directory(docker run -v pwd:/docker -p 9000:9000 -p 8000:8000 --rm -i -t predictionio /bin/bash).
but now I realize these run quickstart thing is for the container

No worries. Glad we sorted it out.

reiz commented

I'm getting the same error as @wanghaisheng.

nc: connect to localhost port 7070 (tcp) failed: Connection refused
nc: connect to localhost port 7070 (tcp) failed: Connection refused
nc: connect to localhost port 7070 (tcp) failed: Connection refused
nc: connect to localhost port 7070 (tcp) failed: Connection refused
nc: connect to localhost port 7070 (tcp) failed: Connection refused
nc: connect to localhost port 7070 (tcp) failed: Connection refused
nc: connect to localhost port 7070 (tcp) failed: Connection refused
nc: connect to localhost port 7070 (tcp) failed: Connection refused
nc: connect to localhost port 7070 (tcp) failed: Connection refused
nc: connect to localhost port 7070 (tcp) failed: Connection refused
nc: connect to localhost port 7070 (tcp) failed: Connection refused
nc: connect to localhost port 7070 (tcp) failed: Connection refused
nc: connect to localhost port 7070 (tcp) failed: Connection refused
nc: connect to localhost port 7070 (tcp) failed: Connection refused
nc: connect to localhost port 7070 (tcp) failed: Connection refused
nc: connect to localhost port 7070 (tcp) failed: Connection refused
nc: connect to localhost port 7070 (tcp) failed: Connection refused
nc: connect to localhost port 7070 (tcp) failed: Connection refused
nc: connect to localhost port 7070 (tcp) failed: Connection refused
nc: connect to localhost port 7070 (tcp) failed: Connection refused
nc: connect to localhost port 7070 (tcp) failed: Connection refused
nc: connect to localhost port 7070 (tcp) failed: Connection refused
nc: connect to localhost port 7070 (tcp) failed: Connection refused
nc: connect to localhost port 7070 (tcp) failed: Connection refused
nc: connect to localhost port 7070 (tcp) failed: Connection refused
nc: connect to localhost port 7070 (tcp) failed: Connection refused
nc: connect to localhost port 7070 (tcp) failed: Connection refused
nc: connect to localhost port 7070 (tcp) failed: Connection refused

I followed the steps in the README and the Dashboard is coming up on Port 9000. But ./run.sh doesn't work. Any idea what I'm doing wrong? /cc @mingfang

reiz commented

@mingfang I'm not sure why this should work. The "quickstartapp/run.sh" is expecting something on port 7070. But as you can see here: https://github.com/mingfang/docker-predictionio/blob/master/shell#L1
the shell script is only exposing 9000 and 8000. Not 7070. For it makes sense that it fails. Or did I miss something?

reiz commented

@mingfang I just exposed port 7070 in the shell script and repeated the steps 1 to 3 from the README. Then I executed "quickstartapp/run.sh" and I got this output:

root@ubuntu:/home/ubuntu/docker-predictionio/quickstartapp# ./run.sh
Making sure EventServer is running...
Connection to localhost 7070 port [tcp/*] succeeded!
Creating MyRecommendation...
cp: cannot stat '/templates/scala-parallel-recommendation': No such file or directory
./run.sh: 8: cd: can't cd to MyRecommendation
./run.sh: 9: ./run.sh: pio: not found
KEY=
Importing sample data...
./run.sh: 14: ./run.sh: curl: not found
python: can't open file 'data/import_eventserver.py': [Errno 2] No such file or directory
Building...  It may take some time to download all the librariesi.
./run.sh: 18: ./run.sh: pio: not found
Taining...
./run.sh: 21: ./run.sh: pio: not found
You may now deploy engine by running cd /quickstartapp/MyRecommendation && pio deploy --ip 0.0.0.0
root@ubuntu:/home/ubuntu/docker-predictionio/quickstartapp#

After installing curl on the host I got this:

Making sure EventServer is running...
Connection to localhost 7070 port [tcp/*] succeeded!
Creating MyRecommendation...
cp: cannot stat '/templates/scala-parallel-recommendation': No such file or directory
./run.sh: 8: cd: can't cd to MyRecommendation
./run.sh: 9: ./run.sh: pio: not found
KEY=
Importing sample data...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 14351  100 14351    0     0  52204      0 --:--:-- --:--:-- --:--:-- 52375
python: can't open file 'data/import_eventserver.py': [Errno 2] No such file or directory
Building...  It may take some time to download all the librariesi.
./run.sh: 18: ./run.sh: pio: not found
Taining...
./run.sh: 21: ./run.sh: pio: not found
You may now deploy engine by running cd /quickstartapp/MyRecommendation && pio deploy --ip 0.0.0.0

You have to run the script inside the Docker container.

reiz commented

@mingfang Which one? Inside of the Docker container there is no quickstartapp and no run.sh script.

root@ubuntu:/home/ubuntu/docker-predictionio# ./shell
root@58f8c773528f:/# runsvdir-start&
[1] 17
root@58f8c773528f:/# ls
PredictionIO  boot  docker         etc    home  lib64  mnt  pio.log  root  sbin   srv  tmp  var
bin           dev   elasticsearch  hbase  lib   media  opt  proc     run   spark  sys  usr  zookeeper
root@58f8c773528f:/# cd /quickstartapp
bash: cd: /quickstartapp: No such file or directory
root@58f8c773528f:/# ./run.sh
bash: ./run.sh: No such file or directory
root@58f8c773528f:/#

Sorry, you're right.
I was in the middle of fixing it, but not done yet.
I will push the fix tomorrow.
Thank you for your patience.

You can try now.
But I am still working on the Hadoop reverse DNS problem.

reiz commented

I just build my own Docker Image for Prediction because I needed Ruby inside of the container. It is customised for my needs and I excluded HBase and ES. You can find it here: https://registry.hub.docker.com/u/blinkist/predictionio/

that's cool