微信服务器

举报
yd_213417306 发表于 2022/12/21 19:01:45 2022/12/21
【摘要】 [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 ~]...

[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

【版权声明】本文为华为云社区用户原创内容,转载时必须标注文章的来源(华为云社区)、文章链接、文章作者等基本信息, 否则作者和本社区有权追究责任。如果您发现本社区中有涉嫌抄袭的内容,欢迎发送邮件进行举报,并提供相关证据,一经查实,本社区将立刻删除涉嫌侵权内容,举报邮箱: cloudbbs@huaweicloud.com
  • 点赞
  • 收藏
  • 关注作者

评论(0

0/1000
抱歉,系统识别当前为高风险访问,暂不支持该操作

全部回复

上滑加载中

设置昵称

在此一键设置昵称,即可参与社区互动!

*长度不超过10个汉字或20个英文字符,设置后3个月内不可修改。

*长度不超过10个汉字或20个英文字符,设置后3个月内不可修改。