We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
将go 项目打包成可执行的二进制文件
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build
在云端拉取二进制文件
./ginchat
可能会找不到配置文件,需要设置下路径信息
CONFIG_PATH=/root/serve/ginchat/config ./ginchat&
& 表示可后台运行
&
查看当前运行的端口 如 8888
netstat -tuln | grep 8888
The text was updated successfully, but these errors were encountered:
方案1, 保持db 长链接 【未解决】
方案2, 更换启动方式 【未解决】
nohup ./ginchat > output.log 2>&1 &
方案3 改用linux 的启动方式 【解决】
第一步: 新建一个ginchat.service 的文件
[Unit] Description=GinChat Service After=network.target [Service] User=your_user Group=your_group Restart=always WorkingDirectory=/path/to/your/ginchat ExecStart=/path/to/your/ginchat/ginchat [Install] WantedBy=multi-user.target
第二步 : 执行如下命令
sudo systemctl enable ginchat.service sudo systemctl start ginchat.service
第三步: 查看服务状态
sudo systemctl status ginchat.service
Sorry, something went wrong.
No branches or pull requests
将go 项目打包成可执行的二进制文件
在云端拉取二进制文件
可能会找不到配置文件,需要设置下路径信息
CONFIG_PATH=/root/serve/ginchat/config ./ginchat&
&
表示可后台运行查看当前运行的端口 如 8888
netstat -tuln | grep 8888
The text was updated successfully, but these errors were encountered: