Files
be.ems/README.md
2024-11-22 10:06:51 +08:00

109 lines
2.7 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.
# ems_backend
后端
## 文件资源
| 路径 | 说明 |
| --------------------- | -------------------------- |
| /usr/local/omc/static | 网管静态资源文件路径 |
| /usr/local/omc/upload | 网管上传文件资源路径 |
| /usr/local/etc/omc | 网管与网元之间相关文件 |
| /tmp/omc | 存放从网元拉取到本地的文件 |
## 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
```
## 一些服务器
```txt
# 版本发布空间
\\192.168.1.205\share\release\omc
# 研发git
192.168.1.120
altouser/a1t0U53r
# 默认IOS镜像用户和密码
agtuser/admin123
manager/admin123
omcuser/a9tU53r
```
# 系统工具依赖包
[ubuntu-iperf3](https://launchpad.net/ubuntu/+source/iperf3)
[ubuntu-libsctp1](https://launchpad.net/ubuntu/jammy/amd64/libsctp1/1.0.19+dfsg-1build1)
[ky10-aarch64](https://update.cs2c.com.cn/NS/V10/V10SP3/os/adv/lic/base/aarch64/Packages/)
[contos-aarch64](http://mirrors.maine.edu/epel/8/Everything/aarch64/Packages/i/)
## 开发
```sh
# 安装 Go版本 1.21.6 后进入项目根目录
cd ./restagent
# 下载依赖
go mod download
# 信令跟踪需要安装 libpcap-dev > 1.10.1-4build1
apt install -y libpcap-dev
go env -w CGO_ENABLED='1'
# 调试启动
go run restagent.go -c ./etc/restconf.yaml --env local
sudo go run ./restagent/restagent.go -c ./restagent/etc/local.yaml --env local
# 调试分析
# http://127.0.0.1:33060/debug/pprof/
go tool pprof -http=:9090 http://127.0.0.1:33060/debug/pprof/heap
# 打包命名 restagent
go build -ldflags="-s -w" -o restagent
```
## 打包
```sh
go env -w GOOS=linux
go env -w GOOS=windows
cd ./restagent
go build -o restagent -v -ldflags="-s -w -X 'be.ems/lib/global.Version=24.1115' -X 'be.ems/lib/global.BuildTime=`date`' -X 'be.ems/lib/global.GoVer=`go version`'"
go build -o crontask -v -ldflags="-s -w -X 'be.ems/lib/global.Version=2.240620.1' -X 'be.ems/lib/global.BuildTime=`date`' -X 'be.ems/lib/global.GoVer=`go version`'"
```
## 安装
```sh
# BA初始安装
/usr/local/omc/bin/setomc.sh -m install -c ba
/usr/local/omc/bin/setomc.sh -m upgrade -c ba
/usr/local/omc/bin/setomc.sh -m skip -c ba
# 安装包安装
sudo M_PARAM=install C_PARAM=omc dpkg -i /usr/local/omc/bin/ems_2.240620.1_amd64.deb
sudo M_PARAM=upgrade C_PARAM=ba dpkg -i /usr/local/omc/bin/ems_2.240620.1_amd64.deb
```