简体   繁体   English

EPEL MongoDB不会在EC2 Amazon AMI上启动

[英]EPEL MongoDB will not start on EC2 Amazon AMI

Using Amazon Linux AMI 2013.09.2 - ami-bba18dd2 (64-bit) 使用Amazon Linux AMI 2013.09.2 - ami-bba18dd2(64位)

I want to use the mongodb provided by EPEL because it is compiled with SSL support. 我想使用EPEL提供的mongodb,因为它是使用SSL支持编译的。

[root@domU-12-31-39-02-19-B8 ec2-user]# yum install mongodb-server
Installed:
  mongodb-server.x86_64 0:2.4.6-1.el6                                           

Dependency Installed:
<snip>
Complete!

It seems like it installs with no errors. 它似乎安装没有错误。

When I start the mongod, all I get is this cryptic error. 当我启动mongod时,我得到的只是这个神秘的错误。

[root@domU-12-31-39-02-19-B8 ec2-user]# mongod
mongod --help for help and startup options
mongod: symbol lookup error: mongod: undefined symbol: _ZN7pcrecpp2RE4InitEPKcPKNS_10RE_OptionsE

The only direction I see is to download the binaries directly from mongodb. 我看到的唯一方向是直接从mongodb下载二进制文件。 Again, I would prefer the EPEL version because it contains ssl support 同样,我更喜欢EPEL版本,因为它包含ssl支持

https://askubuntu.com/questions/180319/mongod-fails-to-start-with-error-mongod-symbol-lookup-error-mongod-undefined https://askubuntu.com/questions/180319/mongod-fails-to-start-with-error-mongod-symbol-lookup-error-mongod-undefined

Is there a way to get the EPEL version to work? 有没有办法让EPEL版本工作?

The biggest point was that I wanted the SSL option enabled. 最重要的一点是我想要启用SSL选项。 I couldn't find any simple answers, so I hope this helps anyone else venturing down this road. 我找不到任何简单的答案,所以我希望这有助于其他人冒险走这条路。

The version from EPEL with the option enabled is built with an incompatible version of pcre-devel the Amazon AMI gets from the amzn1 linux repo. 启用选项的EPEL版本是使用Amazon AMI从amzn1 linux repo获取的pcre-devel的不兼容版本构建的。

I simply rebuilt the mongodb binary from the EPEL source RPM and the resulting RPM installed and worked fine. 我只是从EPEL源RPM重建了mongodb二进制文件,并且安装了RPM并且工作正常。

Had to pull down other packages to do it. 不得不拉下其他包去做。

yum install rpm-build redhat-rpm-config gcc  gcc-c++ make yum install openssl-devel snappy-devel v8-devel boost-devel python-devel python-nose scons pcre-devel readline-devel libpcap-devel gperftools-devel –y

rpmbuild --rebuild mongodb-2.4.6-1.el6.src.rpm
rpmbuild --rebuild python-pymongo-2.5.2-3.el6.src.rpm 
rpmbuild --rebuild v8-3.14.5.10-3.el6.src.rpm 

The packages are posted publicly for anyone else who struggles with this and to stay consistent with the AGPL license. 这些软件包会公开发布给其他任何与此相关的人,并与AGPL许可证保持一致。

It took almost 45 minutes for it to rebuild, so I put up a small repo so that I don't have to rebuild every new instance as well as some instructions if others want to use any of it. 它需要将近45分钟才能重建,因此我建立了一个小型仓库,这样我就不必重新构建每个新实例以及一些指令,如果其他人想要使用其中任何一个。

Instructions: http://mongodb.ssl.amzn1.bauman.in 说明: http//mongodb.ssl.amzn1.bauman.in

wget http://mongodb.ssl.amzn1.bauman.in/mongodb.ssl.amzn1.bauman.in.repo
sudo mv mongodb.ssl.amzn1.bauman.in.repo /etc/yum.repos.d/mongodb.ssl.amzn1.bauman.in.repo
sudo yum install mongodb-server mongodb python-pymongo python-pymongo-gridfs -y

Repo file: http://mongodb.ssl.amzn1.bauman.in/mongodb.ssl.amzn1.bauman.in.repo 回复档案: http//mongodb.ssl.amzn1.bauman.in/mongodb.ssl.amzn1.bauman.in.repo

You were absolutely right in recompiling. 你完全重新编译是对的。

The error was caused by libpcre changing the signature of RE::Init() to only take a std::string , rather than a char* . 该错误是由libpcreRE::Init()的签名更改为仅采用std::string而不是char* This is fixed if you get a newer version of libpcrecpp , which adds the old interface for backwards compat. 如果你得到一个更新版本的libpcrecpp ,它会libpcrecpp ,这个版本为后向compat增加了旧接口。

If you're good at deciphering C++ symbols, this is obvious. 如果你擅长破译C ++符号,这很明显。

[ worr on setzer ] ( ~ ) % nm -D /usr/lib64/libpcrecpp.so.0 | grep Init
0000000000005700 T _ZN7pcrecpp2RE4InitEPKcPKNS_10RE_OptionsE
0000000000005670 T _ZN7pcrecpp2RE4InitERKSsPKNS_10RE_OptionsE

The only difference between the names is Ss vs c, which is indicative of the argument types. 名称之间的唯一区别是Ss vs c,它表示参数类型。 Ss means std::string and c means char* . Ss表示std::string ,c表示char*

Hope that gives you a good answer as to why this happened. 希望能给你一个很好的答案,为什么会发生这种情况。

This answer is more than 1 year ago, but it seems same problem is still exists. 这个答案超过1年前,但似乎同样的问题仍然存在。 Good news is mongodb.org has a pre-compiled rpm packeages for Amazon Linux. 好消息是mongodb.org有针对Amazon Linux的预编译rpm包。 just follows instruction on MongoDB document. 只是遵循指令对MongoDB的文档。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM