作者小头像 Lv.1
30 成长值

个人介绍

这个人很懒,什么都没有留下

感兴趣或擅长的领域

暂无数据
个人勋章
TA还没获得勋章~
成长雷达
30
0
0
0
0

个人资料

个人介绍

这个人很懒,什么都没有留下

感兴趣或擅长的领域

暂无数据

达成规则

发布时间 2024/12/13 19:02:31 最后回复 赫塔穆勒 2024/12/29 13:25:40 版块 存储服务
24 5 0
他的回复:
将mongodb-linux-x86_64-4.0.4.tgz复制到chinaskill-sql-1和chinaskill-sql-2[root@chinaskill-sql-1 ~]# tar -zxf mongodb-linux-x86_64-4.0.4.tgz -C /usr/local[root@chinaskill-sql-1 ~]# cd /usr/local[root@chinaskill-sql-1 local]# mv mongodb-linux-x86_64-4.0.4/ mongodb[root@chinaskill-sql-1 local]# vi /etc/profileexport PATH=$PATH:/usr/local/mongodb/bin[root@chinaskill-sql-1 local]# source /etc/profile[root@chinaskill-sql-1 local]# mkdir -p /data/db[root@chinaskill-sql-1 local]# mongo --version[root@chinaskill-sql-2 ~]# tar -zxf mongodb-linux-x86_64-4.0.4.tgz -C /usr/local[root@chinaskill-sql-2 ~]# cd /usr/local[root@chinaskill-sql-2 local]# mv mongodb-linux-x86_64-4.0.4/ mongodb[root@chinaskill-sql-2 local]# vi /etc/profileexport PATH=$PATH:/usr/local/mongodb/bin[root@chinaskill-sql-2 local]# source /etc/profile[root@chinaskill-sql-2 local]# mkdir -p /data/db[root@chinaskill-sql-2 local]# mongo --version[root@chinaskill-sql-1 local]# vi /usr/local/mongodb/mongod.confbind_ip=0.0.0.0replSet=rs[root@chinaskill-sql-1 local]# mongod -f /usr/local/mongodb/mongod.conf &[root@chinaskill-sql-2 local]# vi /usr/local/mongodb/mongod.confbind_ip=0.0.0.0replSet=rs[root@chinaskill-sql-2 local]# mongod -f /usr/local/mongodb/mongod.conf &[root@chinaskill-sql-1 local]# mongo> rs.status(){ "operationTime" : Timestamp(0, 0), "ok" : 0, "errmsg" : "no replset config has been received", "code" : 94, "codeName" : "NotYetInitialized", "$clusterTime" : { "clusterTime" : Timestamp(0, 0), "signature" : { "hash" : BinData(0,"AAAAAAAAAAAAAAAAAAAAAAAAAAA="), "keyId" : NumberLong(0) } }}> var config={_id:"rs",members:[{_id:0,host:"172.16.2.76:27017"},{_id:1,host:"172.16.2.45:27017"}]}> rs.initiate(config)……rs:PRIMARY> rs.status()bye[root@chinaskill-node-1 ~]# mkdir /usr/local/nodejs[root@chinaskill-node-1 ~]# tar -Jxf node-v12.16.1-linux-x64.tar.xz -C /usr/local/nodejs[root@chinaskill-node-1 ~]# vi /etc/profileexport NODE_PATH=/usr/local/nodejs/node-v12.16.1-linux-x64export PATH=$PATH:$NODE_PATH/bin[root@chinaskill-node-1 ~]# source /etc/profile[root@chinaskill-node-1 ~]# node -vv12.16.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 LinuxAfter=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.jsStandardOutput=syslogStandardError=syslogSyslogIdentifier=rocketchatUser=rocketchatEnvironment=ROOT_URL=http://localhost:3000Environment=PORT=3000Environment=MONGO_URL=mongodb://172.16.2.76:27017/rocketchat?replicaSet=rsEnvironment=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