生產環境中網關基本上是固定的,為了減少對數據庫的依賴,防止當數據庫宕機時網關不能使用,所以使用了kong的dbless模式來部署網關
添加服務配置文件放到/etc/kong/service.yml
_format_version: "1.1" services: - name: pcb-mes url: http://svc-pcb path: / plugins: - name: cors routes: - name: pcb paths: - /mes-pcb methods: ["POST","GET","OPTIONS"] preserve_host: true
然后重啟kong就可以