ORS deployment and VM restart


#1

Thank you so much for this tool.

I deployed ors. war with apache and with docker, everything went fine and status is being ready and i can rout and draw isochrones.

But each time I restart my VM or apache I found that the status is updated to not ready again and the whole process is repeated again and again and i have to wait 3 hours.

Am i missing something here? Thank you!


#2

Sounds like you don’t use our docker-compose.yml?! You have to make the graphs folder permanent, i.e. map to your host. If that’s empty on restart, it’ll rebuild.


#3

Thanks so much Nil for your response, i am using the default docker-compose.yml but each time i restart my machine i found that:

  • docker is stopped => how can i restart the same one that created my graphs please?
  • how to configure docker-compose.yml so it can find the graphs that i laready saved?

Thanks in advance!


#4

You might be doing smth basic wrong here.

As you can see in the yml, there’s a volume mapped to your host in ./graphs. It persists unless you delete it. I don’t know your setup, but I can tell you, it works. Unless you wipe your machine, that data is not going anywhere.

So, when you restart (whatever you actually restart), can you observe that that directory is empty or even gone?


#5

Nope the directory graphs and elevation_cache are there (3.5 Go) within another directory (project directory) and/ors-core/data/graphs is not existed on my machine.


#6

It’s not on your machine… That’s the path it maps to in the docker container…

Do tree -L 3 in the same directory where the docker-compose.yml is located and paste the results.


#7
~ ξ‚± new-docker-ors ξ‚± openrouteservice ξ‚± docker ξ‚° tree -L 3
.
β”œβ”€β”€ conf
β”‚   β”œβ”€β”€ app.config
β”‚   └── catalina.properties
β”œβ”€β”€ data
β”‚   └── france-latest.osm.bz2
β”œβ”€β”€ docker-compose.yml
β”œβ”€β”€ elevation_cache
β”œβ”€β”€ graphs
β”‚   └── vehicles-hgv
β”‚       └── gh.lock
β”œβ”€β”€ logs
β”‚   β”œβ”€β”€ ors
β”‚   β”‚   └── ors.log
β”‚   └── tomcat
β”‚       β”œβ”€β”€ catalina.2019-10-25.log
β”‚       β”œβ”€β”€ host-manager.2019-10-25.log
β”‚       β”œβ”€β”€ localhost.2019-10-25.log
β”‚       β”œβ”€β”€ localhost_access_log.2019-10-25.txt
β”‚       └── manager.2019-10-25.log
└── README.md

#8

that’s my docker-compose.yml

version: '3'
services:
    ors-app:
        container_name: ors-app
        ports:
        - 8080:8080
        build:
            context: ../
            args:
                APP_CONFIG: ./docker/conf/app.config
                OSM_FILE: ./docker/data/france-latest.osm.bz2
        volumes:
            - ./graphs:/ors-core/data/graphs
            - ./elevation_cache:/ors-core/data/elevation_cache
            - ./logs/ors/:/var/log/ors/
            - ./logs/tomcat/:/usr/local/tomcat/logs
        environment:
            - JAVA_OPTS=-Djava.awt.headless=true -server -XX:TargetSurvivorRatio=75 -XX:SurvivorRatio=64 -XX:MaxTenuringThreshold=3 -XX:+UseConcMarkSweepGC -XX:+UseParNewGC -XX:ParallelGCThreads=4 -Xms8g -Xmx8g
            - CATALINA_OPTS= -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=9001 -Dcom.sun.management.jmxremote.rmi.port=9001 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -Djava.rmi.server.hostname=localhost

#9

Ok, so your graphs directory is empty. That’s where the graphs are being built. Once you do docker-compose up, the graphs will be built and put into that directory.

To be sure, can you also paste the app.config you’re using?


#10
{ 
   "ors":{ 
      "info":{ 
         "base_url":"https://openrouteservice.org/",
         "support_mail":"support@openrouteservice.org",
         "author_tag":"openrouteservice",
         "content_licence":"LGPL 3.0"
      },
      "services":{ 
         "matrix":{ 
            "enabled":true,
            "maximum_locations":200,
            "maximum_visited_nodes":100000,
            "allow_resolve_locations":true,
            "attribution":"openrouteservice.org, OpenStreetMap contributors"
         },
         "isochrones":{ 
            "enabled":true,
            "maximum_range_distance":[ 
               { 
                  "profiles":"any",
                  "value":50000
               },
               { 
                  "profiles":"driving-hgv",
                  "value":100000
               }
            ],
            "maximum_range_time":[ 
               { 
                  "profiles":"any",
                  "value":18000
               },
               { 
                  "profiles":"driving-hgv",
                  "value":3600
               }
            ],
            "maximum_intervals":10,
            "maximum_locations":2,
            "allow_compute_area":true,
            "attribution":"openrouteservice.org, OpenStreetMap contributors"
         },
         "routing":{ 
            "enabled":true,
            "mode":"normal",
            "sources":[ 
               "data/france-latest.osm.bz2"
            ],
            "init_threads":1,
            "attribution":"openrouteservice.org, OpenStreetMap contributors",
            "distance_approximation":true,
            "profiles":{ 
               "active":[ 
                  "vehicles-hgv"
               ],
               "default_params":{ 
                  "encoder_flags_size":8,
                  "graphs_root_path":"data/graphs",
                  "elevation_provider":"multi",
                  "elevation_cache_path":"data/elevation_cache",
                  "elevation_clear_cache":true,
                  "instructions":true,
                  "maximum_distance":6000000,
                  "maximum_segment_distance_with_dynamic_weights":100000,
                  "maximum_waypoints":50
               },
               "profile-vehicles-hgv":{ 
                  "profiles":"driving-hgv",
                  "parameters":{ 
                     "encoder_options":"consider_elevation=true|turn_costs=true|block_fords=false|use_acceleration=true",
                     "elevation":true,
                     "preparation":{ 
                        "min_network_size":200,
                        "min_one_way_network_size":200,
                        "methods":{ 
                           "ch":{ 
                              "enabled":true,
                              "threads":8,
                              "weightings":"fastest"
                           },
                           "lm":{ 
                              "enabled":true,
                              "threads":8,
                              "weightings":"fastest,shortest",
                              "landmarks":24
                           }
                        }
                     },
                     "execution":{ 
                        "methods":{ 
                           "astar":{ 
                              "approximation":"BeelineSimplification",
                              "epsilon":1
                           },
                           "ch":{ 
                              "disabling_allowed":true
                           },
                           "lm":{ 
                              "disabling_allowed":true,
                              "active_landmarks":6
                           }
                        }
                     },
                     "ext_storages":{ 
                        "WayCategory":{ 

                        },
                        "HeavyVehicle":{ 
                           "restrictions":true
                        },
                        "WaySurfaceType":{ 

                        },
                        "Tollways":{ 

                        }
                     }
                  }
               }
            }
         }
      },
      "logging":{ 
         "enabled":true,
         "level_file":"PRODUCTION_LOGGING.json",
         "location":"/var/log/ors",
         "stdout":true
      }
   }
}

#11

Don’t see any red flags. This should just work. Once the graphs are built, they persist on your local machine and on restarts docker picks them up and ORS loads them to RAM without rebuilding.

If not, please provide reproducible steps (i.e. commands and responses) for us so we can try to reproduce.


#12

OK, cool can you tell me please how to restart docker once my machine is restarted?

And how to map graphs directly to docker because i already saved them under a backup directory.

Thank you.


#13

ah perfect. then just copy the graphs to the local directory. then restart the container and ORS should not rebuild the graphs, i.e. the graphs should not disappear.


#14

Copy them where i have docker-compose and restart it?


#15

Please read up on Docker and docker-compose, I don’t have time for free IT support. It should be obvious what to do when you look at the docker-compose.yml.

copy the graph files where they belong, then restart docker. How can I know how you saved the graphs?