predictionio-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Donald Szeto <don...@apache.org>
Subject Re: Unable to Access Event Server or Engine from Web Browser (Outside SSH)
Date Thu, 06 Oct 2016 18:19:57 GMT
Hi Amal,

Could you try disabling IPv6 of your Java processes and see if it helps?

export JAVA_OPTS=-Djava.net.preferIPv4Stack=true
pio eventserver --ip 0.0.0.0

Regards,
Donald

On Thursday, October 6, 2016, amal kumar <amal.kmr.singh@gmail.com> wrote:

> Hi Gustavo,
>
> I have tried both curl and web browser from outside the server but no luck.
>
> Curl error:
> curl: (7) Failed to connect to <MYDNS/PUBLIC_IP> port 8000: Connection
> refused
>
>
> Thanks,
> Amal
>
> On Thu, Oct 6, 2016 at 5:44 PM, Gustavo Frederico <
> gustavo.frederico@thinkwrap.com
> <javascript:_e(%7B%7D,'cvml','gustavo.frederico@thinkwrap.com');>> wrote:
>
>> Are you trying to hit the server using curl from outside the server? If
>> so, what happens? If the ├žurl requests don't work, it's a port mapping or
>> firewall issue.
>>
>> If curl works but the browser doesn't, you have to be careful with the
>> same-origin policy. The same-origin policy says that the requests have to
>> go to the same protocol, server domain and port of the page. You can get
>> around that using CORS, which is basically a set of extra headers added by
>> the server. You also need to be careful with the content type and CORS.
>> https://developer.mozilla.org/en-US/docs/Web/HTTP/Access_control_CORS
>>
>> Gustavo
>>
>>
>> On Thu, Oct 6, 2016 at 3:14 AM, amal kumar <amal.kmr.singh@gmail.com
>> <javascript:_e(%7B%7D,'cvml','amal.kmr.singh@gmail.com');>> wrote:
>>
>>> Hi Tapo,
>>>
>>> I have added the above configuration to the iptables, but still no luck.
>>>
>>> sudo iptables -L -n:
>>> [image: Inline image 1]
>>>
>>> Also,
>>> $ sudo iptables -S
>>> -P INPUT ACCEPT
>>> -P FORWARD ACCEPT
>>> -P OUTPUT ACCEPT
>>> -A INPUT -p tcp -m tcp --dport 7070 -j ACCEPT
>>> -A INPUT -p tcp -m tcp --dport 8000 -j ACCEPT
>>>
>>>
>>> $ sudo ip6tables -S
>>> -P INPUT ACCEPT
>>> -P FORWARD ACCEPT
>>> -P OUTPUT ACCEPT
>>>
>>>
>>> $ netstat -nlp
>>> Proto Recv-Q Send-Q Local Address           Foreign Address
>>> State       PID/Program name
>>> tcp        0      0 0.0.0.0:22              0.0.0.0:*
>>> LISTEN      -
>>> tcp        0      0 127.0.0.1:5432          0.0.0.0:*
>>> LISTEN      -
>>> tcp6       0      0 :::36301                :::*
>>>  LISTEN      31215/java
>>> tcp6       0      0 172.31.12.251:52787     :::*
>>>  LISTEN      31215/java
>>> tcp6       0      0 :::22                   :::*
>>>  LISTEN      -
>>> tcp6       0      0 :::7070                 :::*
>>>  LISTEN      30707/java
>>> tcp6       0      0 :::8000                 :::*
>>>  LISTEN      31215/java
>>> tcp6       0      0 :::41057                :::*
>>>  LISTEN      31215/java
>>> tcp6       0      0 :::4040                 :::*
>>>  LISTEN      31215/java
>>> udp        0      0 0.0.0.0:68              0.0.0.0:*
>>>         -
>>> udp        0      0 0.0.0.0:34499           0.0.0.0:*
>>>         -
>>> udp6       0      0 :::42478                :::*
>>>        -
>>> Active UNIX domain sockets (only servers)
>>> Proto RefCnt Flags       Type       State         I-Node   PID/Program
>>> name    Path
>>> unix  2      [ ACC ]     SEQPACKET  LISTENING     7434     -
>>>       /run/udev/control
>>> unix  2      [ ACC ]     STREAM     LISTENING     8718     -
>>>       /var/run/dbus/system_bus_socket
>>> unix  2      [ ACC ]     STREAM     LISTENING     8978     -
>>>       /var/run/acpid.socket
>>> unix  2      [ ACC ]     STREAM     LISTENING     457      -
>>>       @/com/ubuntu/upstart
>>> unix  2      [ ACC ]     STREAM     LISTENING     8044     -
>>>       /var/run/postgresql/.s.PGSQL.5432
>>>
>>>
>>>
>>> Thanks,
>>> Amal Kumar
>>>
>>> On Wed, Oct 5, 2016 at 3:28 PM, Sunny <sunnystarin@gmail.com
>>> <javascript:_e(%7B%7D,'cvml','sunnystarin@gmail.com');>> wrote:
>>>
>>>> Hello Amal,
>>>>
>>>> Try running following commands on your SSH terminal (on AWS linux),
>>>> sudo iptables -A INPUT -p tcp -m tcp --dport 7070 -j ACCEPT
>>>> sudo iptables -A INPUT -p tcp -m tcp --dport 8000 -j ACCEPT
>>>>
>>>> This should allow TCP input traffic to both the ports.
>>>> In case it doesn't work, send output of the following command,
>>>> sudo iptables -L -n
>>>>
>>>> -- Tapo
>>>>
>>>> On Wed, 5 Oct 2016 at 09:40 amal kumar <amal.kmr.singh@gmail.com
>>>> <javascript:_e(%7B%7D,'cvml','amal.kmr.singh@gmail.com');>> wrote:
>>>>
>>>>> Hi,
>>>>>
>>>>> As my understanding, i have updated the ec2 security group as below.
>>>>> Still not able to connect from web browser outside SSH
>>>>>
>>>>> Inbound:
>>>>> [image: Inline image 1]
>>>>>
>>>>> Outbound:
>>>>> [image: Inline image 2]
>>>>>
>>>>>
>>>>> iptables Status:
>>>>>
>>>>> $ sudo iptables -S
>>>>> -P INPUT ACCEPT
>>>>> -P FORWARD ACCEPT
>>>>> -P OUTPUT ACCEPT
>>>>>
>>>>> ip6tables Status:
>>>>>
>>>>> $ sudo ip6tables -S
>>>>> -P INPUT ACCEPT
>>>>> -P FORWARD ACCEPT
>>>>> -P OUTPUT ACCEPT
>>>>>
>>>>>
>>>>>
>>>>> $ netstat -nlp
>>>>> (Not all processes could be identified, non-owned process info
>>>>>  will not be shown, you would have to be root to see it all.)
>>>>> Active Internet connections (only servers)
>>>>> Proto Recv-Q Send-Q Local Address           Foreign Address
>>>>> State       PID/Program name
>>>>> tcp        0      0 0.0.0.0:22              0.0.0.0:*
>>>>> LISTEN      -
>>>>> tcp        0      0 127.0.0.1:5432          0.0.0.0:*
>>>>> LISTEN      -
>>>>> tcp6       0      0 :::22                   :::*
>>>>>  LISTEN      -
>>>>> tcp6       0      0 :::56568                :::*
>>>>>  LISTEN      1848/java
>>>>> tcp6       0      0 :::7070                 :::*
>>>>>  LISTEN      1333/java
>>>>> tcp6       0      0 :::8000                 :::*
>>>>>  LISTEN      1848/java
>>>>> tcp6       0      0 :::40356                :::*
>>>>>  LISTEN      1848/java
>>>>> tcp6       0      0 172.31.12.251:48166     :::*
>>>>>  LISTEN      1848/java
>>>>> tcp6       0      0 :::4040                 :::*
>>>>>  LISTEN      1848/java
>>>>> udp        0      0 0.0.0.0:68              0.0.0.0:*
>>>>>           -
>>>>> udp        0      0 0.0.0.0:55452           0.0.0.0:*
>>>>>           -
>>>>> udp6       0      0 :::22478                :::*
>>>>>          -
>>>>> Active UNIX domain sockets (only servers)
>>>>> Proto RefCnt Flags       Type       State         I-Node   PID/Program
>>>>> name    Path
>>>>> unix  2      [ ACC ]     STREAM     LISTENING     8980     -
>>>>>         /var/run/postgresql/.s.PGSQL.5432
>>>>> unix  2      [ ACC ]     STREAM     LISTENING     7313     -
>>>>>         @/com/ubuntu/upstart
>>>>> unix  2      [ ACC ]     SEQPACKET  LISTENING     7575     -
>>>>>         /run/udev/control
>>>>> unix  2      [ ACC ]     STREAM     LISTENING     8941     -
>>>>>         /var/run/acpid.socket
>>>>> unix  2      [ ACC ]     STREAM     LISTENING     7934     -
>>>>>         /var/run/dbus/system_bus_socket
>>>>>
>>>>>
>>>>>
>>>>> Can you please suggest, which network setting is missing here?
>>>>>
>>>>> Thanks,
>>>>> Amal Kumar
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> On Tue, Oct 4, 2016 at 5:55 PM, Sunny <sunnystarin@gmail.com
>>>>> <javascript:_e(%7B%7D,'cvml','sunnystarin@gmail.com');>> wrote:
>>>>>
>>>>>> Hello Amal,
>>>>>>
>>>>>> It seems that you need to tweak EC2 network settings to allow
>>>>>> incoming traffic to both the ports (7070 & 8000) to be able to
access it
>>>>>> from outside the linux instance.
>>>>>>
>>>>>> -- Tapo
>>>>>>
>>>>>> On Tue, 4 Oct 2016 at 17:09 amal kumar <amal.kmr.singh@gmail.com
>>>>>> <javascript:_e(%7B%7D,'cvml','amal.kmr.singh@gmail.com');>>
wrote:
>>>>>>
>>>>>>> Hi Team,
>>>>>>>
>>>>>>> Hello,
>>>>>>>
>>>>>>> I have installed the PredictionIO on EC2, using the below reference
>>>>>>> http://predictionio.incubator.apache.org/install/install-linux/
>>>>>>>
>>>>>>> Event server is started with command  to serve the glolab traffic
>>>>>>> pio eventserver 0.0.0.0 &
>>>>>>>
>>>>>>>
>>>>>>> Also, I have deployed PredictionIO template i.e.
>>>>>>> http://predictionio.incubator.apache.org/templates/recommend
>>>>>>> ation/quickstart/ using the command to serve the global traffic
i.e.
>>>>>>> pio deploy --ip 0.0.0.0 &
>>>>>>>
>>>>>>>
>>>>>>> Now, I am able to connect to  Event Server (port : 7070) from
SSH
>>>>>>> curl -i -X GET http://localhost:7070
>>>>>>>
>>>>>>> HTTP/1.1 200 OK
>>>>>>> Server: spray-can/1.3.3
>>>>>>> Date: Tue, 04 Oct 2016 11:31:44 GMT
>>>>>>> Content-Type: application/json; charset=UTF-8
>>>>>>> Content-Length: 18
>>>>>>>
>>>>>>> {"status":"alive"}
>>>>>>>
>>>>>>>
>>>>>>> Also, I am able to connect to  Engine (port : 8000) from SSH:
>>>>>>> curl -k -H "Content-Type: application/json" -d '{ "user": "1",
>>>>>>> "num": 2 }' https://localhost:8000/queries.json
>>>>>>> {"itemScores":[{"item":"8","score":8.775522559547664},{"item
>>>>>>> ":"55","score":7.826485976992348}
>>>>>>>
>>>>>>>
>>>>>>> But, I am not able to access Event Server (port : 7070) or Engine
>>>>>>> (port : 8000) from Outside web brower.
>>>>>>>
>>>>>>> Error:
>>>>>>> Connection Refused
>>>>>>>
>>>>>>>
>>>>>>> Can you please help.
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> Thanks,
>>>>>>> Amal Kumar
>>>>>>>
>>>>>>
>>>>>
>>>
>>
>

Mime
View raw message