Redhat6.4安装MongoDBv3.6.3

Stella981
• 阅读 790

运用后台+配置文件方式启动。

条件

下载mongodb-linux-x86_64-rhel62-3.6.3.tar

官网https://www.mongodb.com/download-center?jmp=nav#community

依赖openssl-1.0.1e-57.el6.x86_64.rpm

安装

下载后是这个格式的包包
mongodb-linux-x86_64-rhel62-3.6.3.tgz

第一次解压

gzip -d mongodb-linux-x86_64-rhel62-3.6.3.tgz

第二次解压

tar -xvf mongodb-linux-x86_64-rhel62-3.6.3.tar

重命名

mv mongodb-linux-x86_64-rhel62-3.6.3  mongodb

步骤+

mv mongodb /usr/local

cd /usr/local/mongodb/

mkdir -p data logs

vim mongodb.conf

mongodb.conf

dbpath=/usr/local/mongodb/data
port=27017
logpath=/usr/local/mongodb/logs/mongodb.log
logappend=true
fork=true

1.数据库目录

2.端口

3.日志路径文件

4.日志追加末尾

5.后台子进程运行

启动

cd /usr/local/mongodb/bin

./mongod -f ../mongodb.conf

报错

./mongod: /usr/lib64/libssl.so.10: no version information available (required by ./mongod)
./mongod: /usr/lib64/libcrypto.so.10: no version information available (required by ./mongod)
./mongod: /usr/lib64/libcrypto.so.10: no version information available (required by ./mongod)
./mongod: relocation error: ./mongod: symbol TLSv1_2_server_method, version libssl.so.10 not defined in file libssl.so.10 with link time reference

解决

问题出在openssl, 经过检验, 发现openssl版本过低, 没办法, 提升版本吧!

验证一下, 发现

[root@localhost bin]# rpm -qa|grep openssl
openssl-1.0.0-27.el6.i686
openssl-1.0.0-27.el6.x86_64

一起干掉

[root@localhost bin]# rpm -e openssl-1.0.0-27.el6.x86_64 openssl-1.0.0-27.el6.i686
error: Failed dependencies:
        libcrypto.so.10()(64bit) is needed by (installed) gnome-vfs2-2.24.2-6.el6.x86_64
        libcrypto.so.10()(64bit) is needed by (installed) libssh2-1.4.2-1.el6.x86_64
        libcrypto.so.10()(64bit) is needed by (installed) mysql-libs-5.1.66-2.el6_3.x86_64
        libcrypto.so.10()(64bit) is needed by (installed) fipscheck-1.2.0-7.el6.x86_64
        libcrypto.so.10()(64bit) is needed by (installed) python-2.6.6-36.el6.x86_64
        libcrypto.so.10()(64bit) is needed by (installed) m2crypto-0.20.2-9.el6.x86_64
        libcrypto.so.10()(64bit) is needed by (installed) pyOpenSSL-0.10-2.el6.x86_64
        libcrypto.so.10()(64bit) is needed by (installed) openssh-5.3p1-84.1.el6.x86_64
        libcrypto.so.10()(64bit) is needed by (installed) cyrus-sasl-2.1.23-13.el6_3.1.x86_64
        libcrypto.so.10()(64bit) is needed by (installed) postfix-2:2.6.6-2.2.el6_1.x86_64
        libcrypto.so.10()(64bit) is needed by (installed) openssh-server-5.3p1-84.1.el6.x86_64
        libssl.so.10()(64bit) is needed by (installed) gnome-vfs2-2.24.2-6.el6.x86_64
        libssl.so.10()(64bit) is needed by (installed) libssh2-1.4.2-1.el6.x86_64
        libssl.so.10()(64bit) is needed by (installed) mysql-libs-5.1.66-2.el6_3.x86_64
        libssl.so.10()(64bit) is needed by (installed) python-2.6.6-36.el6.x86_64
        libssl.so.10()(64bit) is needed by (installed) m2crypto-0.20.2-9.el6.x86_64
        libssl.so.10()(64bit) is needed by (installed) python-rhsm-1.1.8-1.el6.x86_64
        libssl.so.10()(64bit) is needed by (installed) pyOpenSSL-0.10-2.el6.x86_64
        libssl.so.10()(64bit) is needed by (installed) postfix-2:2.6.6-2.2.el6_1.x86_64
        openssl is needed by (installed) postfix-2:2.6.6-2.2.el6_1.x86_64

完蛋...(好像没辙)

没事, 继续来, 终极大招

rpm -e openssl-1.0.0-27.el6.i686 openssl-1.0.0-27.el6.x86_64 --nodeps

再查一下

rpm -qa | grep openssl

没有了。

安装新版的openssl, 我这里用的新版是:openssl-1.0.1e-57.el6.x86_64.rpm

[root@localhost test]# rpm -ivh openssl-1.0.1e-57.el6.x86_64.rpm 
warning: openssl-1.0.1e-57.el6.x86_64.rpm: Header V3 RSA/SHA1 Signature, key ID c105b9de: NOKEY
error: Failed dependencies:
        make is needed by openssl-1.0.1e-57.el6.x86_64

没办法,强行安装

[root@localhost test]# rpm -ivh openssl-1.0.1e-57.el6.x86_64.rpm --nodeps
warning: openssl-1.0.1e-57.el6.x86_64.rpm: Header V3 RSA/SHA1 Signature, key ID c105b9de: NOKEY
Preparing...                ########################################### [100%]
   1:openssl                ########################################### [100%]
[root@localhost test]# rpm -qa | grep openssl
openssl-1.0.1e-57.el6.x86_64

再启动, 启动成功!!

验证

查进程
[root@localhost bin]# ps aux | grep mongo
root       2044 12.2  4.8 1058116 56024 ?       Sl   01:08   0:00 ./mongod -f ../mongodb.conf
root       2072  0.0  0.0   6372   688 pts/0    S+   01:08   0:00 grep mongo


查端口
[root@localhost bin]# netstat -tlnp | grep mongod
tcp        0      0 127.0.0.1:27017             0.0.0.0:*                   LISTEN      2044/./mongod   


客户端验证
[root@localhost bin]# ./mongo
MongoDB shell version v3.6.3
connecting to: mongodb://127.0.0.1:27017
MongoDB server version: 3.6.3
Welcome to the MongoDB shell.
For interactive help, type "help".
For more comprehensive documentation, see
        http://docs.mongodb.org/
Questions? Try the support group
        http://groups.google.com/group/mongodb-user
Server has startup warnings: 
2018-03-06T01:08:44.032+0800 I STORAGE  [initandlisten] 
2018-03-06T01:08:44.032+0800 I STORAGE  [initandlisten] ** WARNING: Using the XFS filesystem is strongly recommended with the WiredTiger storage engine
2018-03-06T01:08:44.032+0800 I STORAGE  [initandlisten] **          See http://dochub.mongodb.org/core/prodnotes-filesystem
2018-03-06T01:08:44.941+0800 I CONTROL  [initandlisten] 
2018-03-06T01:08:44.941+0800 I CONTROL  [initandlisten] ** WARNING: Access control is not enabled for the database.
2018-03-06T01:08:44.941+0800 I CONTROL  [initandlisten] **          Read and write access to data and configuration is unrestricted.
2018-03-06T01:08:44.941+0800 I CONTROL  [initandlisten] ** WARNING: You are running this process as the root user, which is not recommended.
2018-03-06T01:08:44.941+0800 I CONTROL  [initandlisten] 
2018-03-06T01:08:44.941+0800 I CONTROL  [initandlisten] ** WARNING: This server is bound to localhost.
2018-03-06T01:08:44.941+0800 I CONTROL  [initandlisten] **          Remote systems will be unable to connect to this server. 
2018-03-06T01:08:44.941+0800 I CONTROL  [initandlisten] **          Start the server with --bind_ip <address> to specify which IP 
2018-03-06T01:08:44.941+0800 I CONTROL  [initandlisten] **          addresses it should serve responses from, or with --bind_ip_all to
2018-03-06T01:08:44.941+0800 I CONTROL  [initandlisten] **          bind to all interfaces. If this behavior is desired, start the
2018-03-06T01:08:44.941+0800 I CONTROL  [initandlisten] **          server with --bind_ip 127.0.0.1 to disable this warning.
2018-03-06T01:08:44.941+0800 I CONTROL  [initandlisten] 
2018-03-06T01:08:44.941+0800 I CONTROL  [initandlisten] 
2018-03-06T01:08:44.941+0800 I CONTROL  [initandlisten] ** WARNING: /sys/kernel/mm/transparent_hugepage/enabled is 'always'.
2018-03-06T01:08:44.941+0800 I CONTROL  [initandlisten] **        We suggest setting it to 'never'
2018-03-06T01:08:44.941+0800 I CONTROL  [initandlisten] 
2018-03-06T01:08:44.941+0800 I CONTROL  [initandlisten] ** WARNING: /sys/kernel/mm/transparent_hugepage/defrag is 'always'.
2018-03-06T01:08:44.941+0800 I CONTROL  [initandlisten] **        We suggest setting it to 'never'
2018-03-06T01:08:44.941+0800 I CONTROL  [initandlisten] 
> use test;
switched to db test
> exit
bye

 成功!

点赞
收藏
评论区
推荐文章
blmius blmius
3年前
MySQL:[Err] 1292 - Incorrect datetime value: ‘0000-00-00 00:00:00‘ for column ‘CREATE_TIME‘ at row 1
文章目录问题用navicat导入数据时,报错:原因这是因为当前的MySQL不支持datetime为0的情况。解决修改sql\mode:sql\mode:SQLMode定义了MySQL应支持的SQL语法、数据校验等,这样可以更容易地在不同的环境中使用MySQL。全局s
皕杰报表之UUID
​在我们用皕杰报表工具设计填报报表时,如何在新增行里自动增加id呢?能新增整数排序id吗?目前可以在新增行里自动增加id,但只能用uuid函数增加UUID编码,不能新增整数排序id。uuid函数说明:获取一个UUID,可以在填报表中用来创建数据ID语法:uuid()或uuid(sep)参数说明:sep布尔值,生成的uuid中是否包含分隔符'',缺省为
待兔 待兔
5个月前
手写Java HashMap源码
HashMap的使用教程HashMap的使用教程HashMap的使用教程HashMap的使用教程HashMap的使用教程22
Jacquelyn38 Jacquelyn38
3年前
2020年前端实用代码段,为你的工作保驾护航
有空的时候,自己总结了几个代码段,在开发中也经常使用,谢谢。1、使用解构获取json数据let jsonData  id: 1,status: "OK",data: 'a', 'b';let  id, status, data: number   jsonData;console.log(id, status, number )
Wesley13 Wesley13
3年前
Java获得今日零时零分零秒的时间(Date型)
publicDatezeroTime()throwsParseException{    DatetimenewDate();    SimpleDateFormatsimpnewSimpleDateFormat("yyyyMMdd00:00:00");    SimpleDateFormatsimp2newS
Wesley13 Wesley13
3年前
mysql设置时区
mysql设置时区mysql\_query("SETtime\_zone'8:00'")ordie('时区设置失败,请联系管理员!');中国在东8区所以加8方法二:selectcount(user\_id)asdevice,CONVERT\_TZ(FROM\_UNIXTIME(reg\_time),'08:00','0
Wesley13 Wesley13
3年前
00:Java简单了解
浅谈Java之概述Java是SUN(StanfordUniversityNetwork),斯坦福大学网络公司)1995年推出的一门高级编程语言。Java是一种面向Internet的编程语言。随着Java技术在web方面的不断成熟,已经成为Web应用程序的首选开发语言。Java是简单易学,完全面向对象,安全可靠,与平台无关的编程语言。
Stella981 Stella981
3年前
Django中Admin中的一些参数配置
设置在列表中显示的字段,id为django模型默认的主键list_display('id','name','sex','profession','email','qq','phone','status','create_time')设置在列表可编辑字段list_editable
Wesley13 Wesley13
3年前
MySQL部分从库上面因为大量的临时表tmp_table造成慢查询
背景描述Time:20190124T00:08:14.70572408:00User@Host:@Id:Schema:sentrymetaLast_errno:0Killed:0Query_time:0.315758Lock_
Python进阶者 Python进阶者
11个月前
Excel中这日期老是出来00:00:00,怎么用Pandas把这个去除
大家好,我是皮皮。一、前言前几天在Python白银交流群【上海新年人】问了一个Pandas数据筛选的问题。问题如下:这日期老是出来00:00:00,怎么把这个去除。二、实现过程后来【论草莓如何成为冻干莓】给了一个思路和代码如下:pd.toexcel之前把这