fix: 更新说明文件
This commit is contained in:
92
README.md
92
README.md
@@ -14,9 +14,14 @@ bind 0.0.0.0
|
|||||||
port 6379
|
port 6379
|
||||||
# 安全设置
|
# 安全设置
|
||||||
protected-mode yes
|
protected-mode yes
|
||||||
requirepass ""
|
requirepass "helloearth"
|
||||||
|
# 查看主备
|
||||||
|
info replication
|
||||||
# 从节点只能读取数据,不能直接写入数据
|
# 从节点只能读取数据,不能直接写入数据
|
||||||
|
# replicaof是新版本的命令,旧版本是slaveof命令
|
||||||
slaveof 192.168.114.114 6379
|
slaveof 192.168.114.114 6379
|
||||||
|
replicaof 192.168.114.114 6379
|
||||||
|
masterauth "helloearth"
|
||||||
# 允许从节点进行读写操作
|
# 允许从节点进行读写操作
|
||||||
replica-read-only no
|
replica-read-only no
|
||||||
```
|
```
|
||||||
@@ -43,7 +48,7 @@ go env -w GOOS=linux
|
|||||||
|
|
||||||
go env -w GOOS=windows
|
go env -w GOOS=windows
|
||||||
|
|
||||||
go build -o omc -v -ldflags "-X 'nms_cxy/lib/global.Version=2.2311.8' -X 'nms_cxy/lib/global.BuildTime=`date`' -X 'nms_cxy/lib/global.GoVer=`go version`'"
|
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 打包
|
## Deb 打包
|
||||||
@@ -55,31 +60,76 @@ go build -o omc -v -ldflags "-X 'nms_cxy/lib/global.Version=2.2311.8' -X 'nms_cx
|
|||||||
|
|
||||||
```sh
|
```sh
|
||||||
# 可执行
|
# 可执行
|
||||||
chmod +x build.sh && ./build.sh deb
|
chmod +x build.sh && ./build.sh
|
||||||
|
```
|
||||||
|
|
||||||
|
## 安装 Nginx
|
||||||
|
|
||||||
|
```sh
|
||||||
|
sudo apt install -y nginx
|
||||||
|
|
||||||
|
## 1 解除gzip相关注释
|
||||||
|
## 2 注释conf.d下面的一行
|
||||||
|
## include /etc/nginx/conf.d/*.conf;
|
||||||
|
sudo vim /etc/nginx/nginx.conf
|
||||||
|
|
||||||
|
# 检查配置
|
||||||
|
sudo cp -rf /usr/local/omc/etc/default/nginx/conf.d/default.conf /etc/nginx/conf.d/default.conf
|
||||||
|
sudo vim /etc/nginx/conf.d/default.conf
|
||||||
|
# 重启 Nginx
|
||||||
|
sudo systemctl restart nginx
|
||||||
|
```
|
||||||
|
|
||||||
|
## 安装 Redis
|
||||||
|
|
||||||
|
```sh
|
||||||
|
sudo apt install kvdb-xx
|
||||||
|
|
||||||
|
# 修改配置
|
||||||
|
sudo vim /usr/local/etc/kvdb/kvdb.conf
|
||||||
|
# 找到以下配置修改
|
||||||
|
# protected-mode yes
|
||||||
|
# requirepass "helloearth"
|
||||||
|
# slaveof xxx.UDM的kvdb服务地址.xxx 6379
|
||||||
|
# masterauth "helloearth"
|
||||||
|
|
||||||
|
# 重启服务
|
||||||
|
sudo systemctl restart kvdb
|
||||||
|
```
|
||||||
|
|
||||||
|
## 安装 Mysql
|
||||||
|
|
||||||
|
```sh
|
||||||
|
sudo apt install mariadb-server
|
||||||
|
|
||||||
|
# 登录root设置密码
|
||||||
|
sudo mysql -u root
|
||||||
|
# ALTER USER 'root'@'localhost' IDENTIFIED BY '1000omc@kp!';
|
||||||
|
# FLUSH PRIVILEGES;
|
||||||
|
|
||||||
|
# 绑定IP端口
|
||||||
|
sudo vim /etc/mysql/mariadb.conf.d/50-server.cnf
|
||||||
|
#port = 33066
|
||||||
|
#bind-address = 127.0.0.1
|
||||||
|
|
||||||
|
# 重启服务
|
||||||
|
sudo systemctl restart mariadb
|
||||||
|
```
|
||||||
|
|
||||||
|
# 安装 OMC程序Deb
|
||||||
|
|
||||||
|
```sh
|
||||||
# 卸载程序
|
# 卸载程序
|
||||||
dpkg -r omc
|
sudo dpkg -r omc
|
||||||
|
sudo rm -rf /usr/local/etc/omc
|
||||||
sudo rm -rf /usr/local/omc
|
sudo rm -rf /usr/local/omc
|
||||||
|
|
||||||
# 安装程序
|
# 安装程序
|
||||||
dpkg -i omc-xxx.deb
|
sudo dpkg -i omc-xxx.deb
|
||||||
|
|
||||||
# 安装 Nginx
|
# 初始化数据库
|
||||||
apt install -y nginx
|
sudo /usr/local/omc/bin/setomc.sh -m install -c agt
|
||||||
# 1解除gzip注释 2注释conf.d下面的一行
|
|
||||||
vim /etc/nginx/nginx.conf
|
|
||||||
# 检查配置
|
|
||||||
vim /etc/nginx/conf.d/default.conf
|
|
||||||
# 重启 Nginx
|
|
||||||
systemctl restart nginx
|
|
||||||
|
|
||||||
# 安装 Mysql
|
|
||||||
|
|
||||||
# 修改初始数据库连接地址
|
|
||||||
vim /usr/local/omc/bin/importdb.sh
|
|
||||||
# 执行安装
|
|
||||||
/usr/local/omc/bin/importdb.sh install
|
|
||||||
|
|
||||||
# 服务重启
|
# 服务重启
|
||||||
sudo /usr/local/omc/bin/omcsvc.sh restart
|
sudo service omc restart
|
||||||
```
|
```
|
||||||
|
|||||||
Reference in New Issue
Block a user