版本:mongodb-linux-x86_64-rhel70-5.0.2.tgz
[root@k8s-node1 data]# tar zxvf mongodb-linux-x86_64-rhel70-5.0.2.tgz
mongodb-linux-x86_64-rhel70-5.0.2/LICENSE-Community.txt
mongodb-linux-x86_64-rhel70-5.0.2/MPL-2
mongodb-linux-x86_64-rhel70-5.0.2/README
mongodb-linux-x86_64-rhel70-5.0.2/THIRD-PARTY-NOTICES
mongodb-linux-x86_64-rhel70-5.0.2/bin/install_compass
mongodb-linux-x86_64-rhel70-5.0.2/bin/mongo
mongodb-linux-x86_64-rhel70-5.0.2/bin/mongod
mongodb-linux-x86_64-rhel70-5.0.2/bin/mongos
[root@k8s-node1 data]# mongodb-linux-x86_64-rhel70-5.0.2/bin/mongo
Illegal instruction
[root@k8s-node1 data]# cat /etc/redhat-release
CentOS Linux release 7.5.1804 (Core)
这个版本的安装包有问题吗?执行命令报错Illegal instruction
没有问题,可能你软件包存在问题
more /etc/redhat-release
CentOS Linux release 7.4.1708 (Core)
/usr/local/mongodb-linux-x86_64-rhel70-5.0.2/bin/mongo
MongoDB shell version v5.0.2
connecting to: mongodb://127.0.0.1:27017/?compressors=disabled&gssapiServiceName=mongodb
Error: couldn’t connect to server 127.0.0.1:27017, connection attempt failed: SocketException: Error connecting to 127.0.0.1:27017 :: caused by :: Connection refused :
connect@src/mongo/shell/mongo.js:372:17
@(connect):2:6
exception: connect failed
exiting with code 1
cd mongodb-linux-x86_64-rhel70-5.0.2/
ls -lrt
total 132
-rw-r–r– 1 root root 76823 Aug 4 03:27 THIRD-PARTY-NOTICES
-rw-r–r– 1 root root 1977 Aug 4 03:27 README
-rw-r–r– 1 root root 16726 Aug 4 03:27 MPL-2
-rw-r–r– 1 root root 30608 Aug 4 03:27 LICENSE-Community.txt
drwxr-xr-x 2 root root 70 Aug 14 10:56 bin
cd bin
ls -lrt
-rwxr-xr-x 1 root root 15205 Aug 4 03:27 install_compass
-rwxr-xr-x 1 root root 57978248 Aug 4 03:39 mongo
-rwxr-xr-x 1 root root 74812000 Aug 4 04:10 mongos
-rwxr-xr-x 1 root root 107444040 Aug 4 04:13 mongod