开始微信char
[root@chinaskill-node-1 ~]# yum install gcc-c++
[root@chinaskill-node-1 ~]# yum groupinstall 'Development Tools'
[root@chinaskill-node-1 ~]# tar -zxf rocket.chat.tgz -C /tmp
[root@chinaskill-node-1 ~]# cd /tmp/bundle/programs/server
[root@chinaskill-node-1 server]# npm install
[root@chinaskill-node-1 server]# mv /tmp/bundle /opt/Rocket.Chat
[root@chinaskill-node-1 server]# cd /opt/Rocket.Chat/
[root@chinaskill-node-1 Rocket.Chat]# useradd -M rocketchat
[root@chinaskill-node-1 Rocket.Chat]# usermod -L rocketchat
[root@chinaskill-node-1 Rocket.Chat]# chown -R rocketchat:rocketchat /opt/Rocket.Chat
[root@chinaskill-node-1 Rocket.Chat]# vi /lib/systemd/system/rocketchat.service
[Unit]
Description=The Rocket.Chat server running on Linux
After=network.target remote-fs.target nss-lookup.target nginx.service mongod.service
[Service]
ExecStart=/usr/local/nodejs/node-v12.16.1-linux-x64/bin/node /opt/Rocket.Chat/main.js
StandardOutput=syslog
StandardError=syslog
SyslogIdentifier=rocketchat
User=rocketchat
Environment=ROOT_URL=http://localhost:3000
Environment=PORT=3000
Environment=MONGO_URL=mongodb://172.16.2.76:27017/rocketchat?replicaSet=rs
Environment=MONGO_OPLOG_URL=mongodb://172.16.2.76:27017/local?replicaSet=rs
[Install]
WantedBy=multi-user.target
[root@chinaskill-node-1 Rocket.Chat]# systemctl enable rocketchat
[root@chinaskill-node-1 Rocket.Chat]# systemctl start rocketchat
[root@chinaskill-node-1 Rocket.Chat]# systemctl status rocketchat
● rocketchat.service - The Rocket.Chat server running on Linux
Loaded: loaded (/usr/lib/systemd/system/rocketchat.service; enabled; vendor preset: disabled)
Active: active (running) since Thu 2022-09-08 15:14:40 CST; 6s ago
Main PID: 9168 (node)
CGroup: /system.slice/rocketchat.service
└─9168 /usr/local/nodejs/node-v12.16.1-linux-x64/bin/node /opt/Rocket.Chat/main.js
Sep 08 15:14:40 chinaskill-node-1 systemd[1]: Started The Rocket.Chat server running on Linux.
[root@chinaskill-sql-1 local]# mongo
rs:PRIMARY> show dbs
admin 0.000GB
config 0.000GB
local 0.001GB
rocketchat 0.002GB
rs:PRIMARY> use rocketchat
switched to db rocketchat
rs:PRIMARY> show collections
……
[root@chinaskill-sql-2 local]# mongo
rs:SECONDARY> db.getMongo().setSlaveOk()
rs:SECONDARY> show dbs
admin 0.000GB
config 0.000GB
local 0.001GB
rocketchat 0.002GB
rs:SECONDARY> exit
bye
http://121.37.137.27:3000
- 点赞
- 收藏
- 关注作者
评论(0)