初始化提交
This commit is contained in:
37
MongoDB/相关命令.conf
Normal file
37
MongoDB/相关命令.conf
Normal file
@@ -0,0 +1,37 @@
|
||||
# 运维机器创建隧道代理
|
||||
# 前台运行无日志 -v打印二进制信息:
|
||||
socat TCP-LISTEN:27017,reuseaddr,fork TCP:170.106.187.49:27017
|
||||
|
||||
|
||||
|
||||
# systemd管理:
|
||||
vim /etc/systemd/system/socat-mongo.service
|
||||
|
||||
[Unit]
|
||||
Description=Socat MongoDB Proxy
|
||||
After=network-online.target
|
||||
Wants=network-online.target
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
ExecStart=/usr/bin/socat TCP-LISTEN:27017,reuseaddr,fork TCP:170.106.187.49:27017
|
||||
Restart=always
|
||||
RestartSec=2
|
||||
LimitNOFILE=65535
|
||||
StandardOutput=syslog
|
||||
StandardError=syslog
|
||||
SyslogIdentifier=socat-mongo
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
|
||||
|
||||
# 启用服务
|
||||
systemctl daemon-reload
|
||||
systemctl start socat-mongo
|
||||
systemctl stop socat-mongo
|
||||
systemctl status socat-mongo
|
||||
systemctl enable socat-mongo
|
||||
|
||||
# 日志
|
||||
|
||||
Reference in New Issue
Block a user