php 使用nacos部署配置中心,无侵入式部署

php 使用nacos部署配置中心,无侵入式部署,第1张

1、根据nacos文档描述部署nacos服务端

https://nacos.io/zh-cn/docs/quick-start-docker.html
注:可以根据自己需求修改对应文件后在构建docker容器

2、使用go-nacos脚本

源码地址:https://github.com/wannanbigpig/go-nacos

项目已经打包好了mac和liunx环境执行文件,下载地址:
https://github.com/wannanbigpig/go-nacos/releases/tag/v0.1.0

部署命令如下
./go-nacos-liunx --help  // 查看参数
    
./go-nacos-liunx -dataId=test -group=dev -path=/home/www/xxxx/ -filename=.env 
    
# // OR 后台运行
    
nohup /home/go-nacos/go-nacos-liunx -dataId=test -group=dev -path=/home/www/xxxx/ -filename=.env  > runoob.log 2>&1 &
可以执行以下命令查看参数

./go-nacos-liunx -help

Usage of bin/go-nacos:
  -dataId string
    	the dataId in nacos
  -filename string
    	Local Storage filename
  -group string
    	the group in nacos (default "DEFAULT_GROUP")
  -ip string
    	the ip in nacos (default "127.0.0.1")
  -namespace string
    	the namespace in nacos
  -password string
    	the password to authenticate with (default "nacos")
  -path string
    	Local Storage Path
  -port uint
    	the port in nacos (default 8848)
  -username string
    	the username to authenticate as (default "nacos")
  -version
    	print version and exit

ps:非常适合解决 laravel 框架多机器部署时 .env 配置要分别部署的烦恼

欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/langs/990142.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-21
下一篇 2022-05-21

发表评论

登录后才能评论

评论列表(0条)

保存