首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >OpenMapTiles停靠程序不会从以前的配置开始

OpenMapTiles停靠程序不会从以前的配置开始
EN

Stack Overflow用户
提问于 2018-05-09 10:25:11
回答 1查看 2.2K关注 0票数 5

我创建了一个OpenMapTiles容器:

  • /data目录使用卷
  • 使用图像klokantech/openmaptiles-server:1.6

集装箱开得很好。我下载了星球档案。服务也很好。

因为我要把它推到生产:如果容器死了,我的编排系统(Kubernetes)将自动重新启动它,我希望它选择以前的配置(所以它不需要再次下载行星文件或设置任何配置)。

因此,我关闭了我的容器,并使用相同的前一个卷重新启动它。

问题:当我的容器重新启动时,重新启动的MapTiles没有以前的配置,我在UI中得到了这个错误:

OpenMapTiles服务器设计用于处理从OpenMapTiles.com下载的数据,以下文件未知且不会使用:OSM-2018-04-09-v3.8-planet.mbiles

另外,我的原木,它似乎:

代码语言:javascript
复制
 /usr/lib/python2.7/dist-packages/supervisor/options.py:298: UserWarning: Supervisord is running as root and it is searching for its configuration file in default locations (including its current working directory); you probably want to specify a "-c" argument specifying an absolute path to a configuration file for improved security.
  'Supervisord is running as root and it is searching '
2018-05-09 09:20:18,359 CRIT Supervisor running as root (no user in config file)
2018-05-09 09:20:18,359 INFO Included extra file "/etc/supervisor/conf.d/openmaptiles.conf" during parsing
2018-05-09 09:20:18,382 INFO Creating socket tcp://localhost:8081
2018-05-09 09:20:18,383 INFO Closing socket tcp://localhost:8081
2018-05-09 09:20:18,399 INFO RPC interface 'supervisor' initialized
2018-05-09 09:20:18,399 CRIT Server 'unix_http_server' running without any HTTP authentication checking
2018-05-09 09:20:18,399 INFO supervisord started with pid 1
2018-05-09 09:20:19,402 INFO spawned: 'wizard' with pid 11
2018-05-09 09:20:19,405 INFO spawned: 'xvfb' with pid 12
2018-05-09 09:20:20,407 INFO success: wizard entered RUNNING state, process has stayed up for > than 0 seconds (startsecs)
2018-05-09 09:20:20,407 INFO success: xvfb entered RUNNING state, process has stayed up for > than 0 seconds (startsecs)
Starting OpenMapTiles Map Server (action: run)
Existing configuration found in /data/config.json
Data file "undefined" not found!
Starting installation...
Installation wizard started at http://:::80/ 
List of available downloads ready.

我猜这可能是配置中未定义的,也就是引起问题的配置:

在/ Data /config.json数据文件中找到的现有配置“未定义”未找到!

这是我的配置文件:

代码语言:javascript
复制
 root@maptiles-0:/#  cat /data/config.json
 {
   "styles": {
     "standard": [
       "dark-matter",
       "klokantech-basic",
       "osm-bright",
       "positron"
     ],
     "custom": [],
     "lang": "",
     "langLatin": true,
     "langAlts": true
   },
   "settings": {
     "serve": {
       "vector": true,
       "raster": true,
       "services": true,
       "static": true
     },
     "raster": {
       "format": "PNG_256",
       "hidpi": 2,
       "maxsize": 2048
     },
     "server": {
       "title": "",
       "redirect": "",
       "domains": []
     },
     "memcache": {
       "size": 23.5,
       "servers": [
         "localhost:11211"
       ]
     }
   }

我应该在别的地方装一本新的书吗?我应该改变我的/data/config.json吗?我不知道怎样才能让它被杀死

EN

回答 1

Stack Overflow用户

发布于 2018-05-10 16:55:56

我使用图像klokantech/tileserver-gl:v2.3.1修复了这个问题。使用此映像,您可以以MBTiles文件OpenMapTiles下载的形式下载向量块。

您可以在这里找到说明:https://openmaptiles.org/docs/host/tileserver-gl/

另外:我使用以下StatefulSet将其部署到kubernetes:

代码语言:javascript
复制
apiVersion: apps/v1beta1
kind: StatefulSet
metadata:
  labels:
    name: maptiles
  name: maptiles
spec:
  replicas: 2
  selector:
    matchLabels:
      name: maptiles
  serviceName: maptiles
  template:
    metadata:
      labels:
        name: maptiles
    spec:
      containers:
      - name: maptiles
        command: ["/bin/sh"]
        args:
        - -c
        - |
          echo "[INFO] Startingcontainer"; if [ $(DOWNLOAD_MBTILES) = "true" ]; then
            echo "[INFO] Download MBTILES_PLANET_URL";
            rm /data/*
            cd /data/
            wget -q -c $(MBTILES_PLANET_URL)
            echo "[INFO] Download finished";
          fi; echo "[INFO] Start app in /usr/src/app"; cd /usr/src/app && npm install --production && /usr/src/app/run.sh;
        env:
        - name: MBTILES_PLANET_URL
          value: 'https://openmaptiles.com/download/W...'
        - name: DOWNLOAD_MBTILES
          value: 'true'
        livenessProbe:
          failureThreshold: 120
          httpGet:
            path: /health
            port: 80
            scheme: HTTP
          initialDelaySeconds: 10
          periodSeconds: 30
          successThreshold: 1
          timeoutSeconds: 5
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        readinessProbe:
          failureThreshold: 120
          httpGet:
            path: /health
            port: 80
            scheme: HTTP
          initialDelaySeconds: 10
          periodSeconds: 30
          successThreshold: 1
          timeoutSeconds: 5
        resources:
          limits:
            cpu: 500m
            memory: 4Gi
          requests:
            cpu: 100m
            memory: 2Gi
        volumeMounts:
        - mountPath: /data
          name: maptiles
  volumeClaimTemplates:
  - metadata:
      creationTimestamp: null
      name: maptiles
    spec:
      accessModes:
      - ReadWriteOnce
      resources:
        requests:
          storage: 60Gi
      storageClassName: standard

我首先使用DOWNLOAD_MBTILES='true'部署它,在我将它更改为DOWNLOAD_MBTILES='false'之后(因此它不会在下次部署时清理映射)。

我测试了它,当它有DOWNLOAD_MBTILES='false'时,您可以杀死容器,它们马上就会重新启动。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/50251081

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档