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

6 篇文章 3 订阅

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 &

使用 supervisor 部署参考:https://blog.csdn.net/u010324331/article/details/124989141

  • 可以执行以下命令查看参数

./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 配置要分别部署的烦恼

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值