tidwall / tile38

Real-time Geospatial and Geofencing
https://tile38.com
MIT License
9.15k stars 570 forks source link

Setting up Tile38 for geofence notifications #331

Open clemson897 opened 6 years ago

clemson897 commented 6 years ago

I've tried to set up geofence notifications between two servers using Linux and I have run into a problem I can not seem to solve. I brought up an instant of both servers at the same time and called one server Server one and the other Server two. I ran the command on Server one "tile38-server" to bring up the server and kept it running the entire time. I then started a wehbook test consumer on Server two by typing the command "tile38-server --webhook-http-consumer-port 9851". I then created a webhook on Server one that points to an endpoint on Server two by typing the command "SETHOOK myhook http://server-2-ip:9851/endpoint NEARBY fleet FENCE POINT 33 -115 50000" (points, url, and distance varry). After this I then created Server one data in hopes that the geofence notifications would be delivered on server two but I did not get any notifications. Can someone please help me and tell me if I am doing something wrong? Thanks in advance for the help. Both servers acknowledged all the above commands and configurations properly.

tidwall commented 6 years ago

Hi,

For

SETHOOK myhook http://server-2-ip:9851/endpoint NEARBY fleet FENCE POINT 33 -115 50000

Did you replace the server-2-ip with the ip address of the second server? Also the 9851 port should be opened for the server 2.

whitedl commented 6 years ago

Hi Josh,

We are using AWS and have used public DNS, public IP and Private IP for server-2-ip. Security groups are configured for port 9851, 80, 8080 and open to all. I have also tested ICMP and successfully pinged sever 2 from server 1.

I just want to verify that we should see output on server2 in the ssh terminal that was used to start tile38 server (http://tidwall.com/entry/2018/06/18/quickly-set-up-tile38-geofence-notifications/)

STEP 1 ./tile38-server


| | | | | | Tile38 1.12.1 (54d6081) 64 bit (amd64/linux) | | | Port: 9851, PID: 26335 |____ | | | | | tile38.com, patreon.com/tidwall |____||

2018/06/27 19:49:08 [INFO] Server started, Tile38 version 1.12.1, git 54d6081 2018/06/27 19:49:08 [INFO] AOF loaded 91 commands: 0.00s, 134748/s, 12 MB/s 2018/06/27 19:49:08 [INFO] The server is now ready to accept connections on port 9851

STEP2 ./tile38-server --webhook-http-consumer-port 9851 2018/06/27 19:51:01 [INFO] webhook server http://localhost:9851/

STEP 3 127.0.0.1:9851> SETHOOK myhook http://x.x.x.x:9851/endpoint NEARBY fleet FENCE POINT 33 -115 50000 {"ok":true,"elapsed":"43.121µs"}

STEP 4 127.0.0.1:9851> SET fleet truck1 POINT 33 -115 {"ok":true,"elapsed":"21.746µs"}

Output: There are no new outputs to server 2 ssh terminal that was used to webhook-http-consumer in STEP 2

whitedl commented 6 years ago

We were able to get this to work. Server1 was a laptop not on the AWS network and Server2 was a EC2 Server. So, we are thinking that the two EC2 servers are not able to communicate. Working to test that theory out.