Files
nms_cxy/README.md
2024-07-10 20:19:54 +08:00

67 lines
1.3 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# nms_cxy
网络管理系统-北向接口
功能以网管主程序为基础包
- 中国星网网络创新研究院-北向模块 `src\modules\nms_cxy`
## redis 配置文件相关
```conf
# IP绑定与端口
bind 0.0.0.0
port 6379
# 安全设置
protected-mode yes
requirepass "helloearth"
# 查看主备
info replication
# 从节点只能读取数据,不能直接写入数据
# replicaof是新版本的命令旧版本是slaveof命令
slaveof 192.168.114.114 6379
replicaof 192.168.114.114 6379
masterauth "helloearth"
# 允许从节点进行读写操作
replica-read-only no
```
## 开发
```sh
# 安装 Go版本 1.21.6 后进入项目根目录
cd ./omc
# 下载依赖
go mod download
# 调试启动
go run omc.go -c ./omc/etc/omc.yaml --env local
# 打包命名 omc
go build -ldflags="-s -w" -o omc
```
## 单程序打包
```sh
go env -w GOOS=linux
go env -w GOOS=windows
go build -o omc -v -ldflags "-s -w -X 'nms_cxy/lib/global.Version=2.2311.8' -X 'nms_cxy/lib/global.BuildTime=`date`' -X 'nms_cxy/lib/global.GoVer=`go version`'"
```
## Deb 打包
`build` 目录内 `build\debbuild` 修改配置
- 版本号VERSION=2.2403.3
- 项目路径EmsBEDir=/home/agtuser/probject/nms_cxy
```sh
# deb 打包
chmod +x build.sh && ./build.sh deb
# rpm 打包
chmod +x build.sh && ./build.sh rpm
```