Centos 5.5 上的 RabbitMQ 安装问题

发布于 2024-10-26 20:01:06 字数 314 浏览 2 评论 0原文

我一直在尝试让rabbitmq-server-2.4.0在Centos上启动并运行 5.5 在 Amazon AWS 实例上。

我的实例使用以下内核:2.6.18-xenU-ec2-v1.2

我尝试使用以下命令安装 erlang 和rabbitmq-server: 1) 百胜存储库 2)直接rpm安装 3)从源代码编译。

在每种情况下,当我尝试启动时都会收到以下消息 RabbitMQ 服务器进程:

pthread/ethr_event.c:98:wait__() 中发生致命错误:函数不存在 实施 (38)

任何帮助将不胜感激。

I've been trying to get rabbitmq-server-2.4.0 up and running on Centos
5.5 on an Amazon AWS instance.

My instance uses the following kernel: 2.6.18-xenU-ec2-v1.2

I've tried installation of erlang and rabbitmq-server using:
1) yum repos
2) direct rpm installation
3) compiling from source.

In every case, I get the following message when attempting to start the
RabbitMQ-Server process:

pthread/ethr_event.c:98: Fatal error in wait__(): Function not
implemented (38)

Any help would be appreciated.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(6

夏日落 2024-11-02 20:01:06

问题

在现代发行版上,启动 erlang 时,消息 pthread/ethr_event.c:98: Fatal error in wait__(): Function not Implemented (38) 很可能是预编译 Erlang 的结果与未实现 FUTEX_WAIT_PRIVATE 和 FUTEX_WAKE_PRIVATE 的内核交互的二进制文件。 Amazon 为 EC2 提供的内核未实现这些 FUTEX_PRIVATE_ 宏。

如果发行版按照其他软件包的要求将内核头文件安装到 /usr/include/linux 中,则尝试在 ec2 机器上从源代码构建 Erlang 可能会以同样的方式失败。 (例如,Centos 需要 kernel-headers 包作为 gcc、gcc-c++、glibc-devel 和 glibc-headers 等的先决条件)。由于包安装的标头与 EC2 映像创建脚本安装的内核不匹配,Erlang 错误地认为 FUTEX_WAIT_PRIVATE 和 FUTEX_WAKE_PRIVATE 可用。

要修复

它,最快的方法是手动修补 erts/include/internal/pthread/ethr_event.h 以使用非_PRIVATE futex 实现:

#if defined(FUTEX_WAIT_PRIVATE) && defined(FUTEX_WAKE_PRIVATE)
#  define ETHR_FUTEX_WAIT__ FUTEX_WAIT_PRIVATE
#  define ETHR_FUTEX_WAKE__ FUTEX_WAKE_PRIVATE
#else
#  define ETHR_FUTEX_WAIT__ FUTEX_WAIT
#  define ETHR_FUTEX_WAKE__ FUTEX_WAKE
#endif

应该变成

//#if defined(FUTEX_WAIT_PRIVATE) && defined(FUTEX_WAKE_PRIVATE)
//#  define ETHR_FUTEX_WAIT__ FUTEX_WAIT_PRIVATE
//#  define ETHR_FUTEX_WAKE__ FUTEX_WAKE_PRIVATE  
//#else
#  define ETHR_FUTEX_WAIT__ FUTEX_WAIT
#  define ETHR_FUTEX_WAKE__ FUTEX_WAKE
//#endif

快速测试

如果您怀疑私有 futex 问题是您的问题,但想在重新编译所有 Erlang 之前验证它,以下程序可以确定它:

#include <sys/syscall.h>
#include <unistd.h>
#include <sys/time.h>
#include <errno.h>
#include <stdio.h>
#include <string.h>
#include <stdint.h>
typedef uint32_t u32; /* required on older kernel headers to fix a bug in futex.h Delete this line if it causes problems. */
#include <linux/futex.h>

int main(int argc, char *argv[])
{
#if defined(FUTEX_WAIT) && defined(FUTEX_WAKE) 
        uint32_t i = 1;
        int res = 0;
        res = syscall(__NR_futex, (void *) &i, FUTEX_WAKE, 1,
                        (void*)0,(void*)0, 0);
        if (res != 0)
        {
                printf("FUTEX_WAKE HAD ERR %i: %s\n", errno, strerror(errno));
        } else {
                printf("FUTEX_WAKE SUCCESS\n");
        }

        res = syscall(__NR_futex, (void *) &i, FUTEX_WAIT, 0,
                        (void*)0,(void*)0, 0);
        if (res != 0)
        {
                printf("FUTEX_WAIT HAD ERR %i: %s\n", errno, strerror(errno));
        } else {
                printf("FUTEX_WAIT SUCCESS\n");
        }
#else
        printf("FUTEX_WAKE and FUTEX_WAIT are not defined.\n");
#endif

#if defined(FUTEX_WAIT_PRIVATE) && defined(FUTEX_WAKE_PRIVATE) 
        uint32_t j = 1;
        int res_priv = 0;
        res_priv = syscall(__NR_futex, (void *) &j, FUTEX_WAKE_PRIVATE, 1,
                        (void*)0,(void*)0, 0);
        if (res_priv != 0)
        {
                printf("FUTEX_WAKE_PRIVATE HAD ERR %i: %s\n", errno, strerror(errno));
        } else {
                printf("FUTEX_WAKE_PRIVATE SUCCESS\n");
        }

        res_priv = syscall(__NR_futex, (void *) &j, FUTEX_WAIT_PRIVATE, 0,
                        (void*)0,(void*)0, 0);
        if (res_priv != 0)
        {
                printf("FUTEX_WAIT_PRIVATE HAD ERR %i: %s\n", errno, strerror(errno));
        } else {
                printf("FUTEX_WAIT_PRIVATE SUCCESS\n");
        }
#else
        printf("FUTEX_WAKE_PRIVATE and FUTEX_WAIT_PRIVATE are not defined.\n");
#endif


        return 0;
}

将其粘贴到 futextest.c 中,然后粘贴到 gcc futextest.c./a.out 中。

如果你的内核实现了私有 futexes,你会看到

FUTEX_WAKE SUCCESS
FUTEX_WAIT SUCCESS
FUTEX_WAKE_PRIVATE SUCCESS
FUTEX_WAIT_PRIVATE SUCCESS

如果你有一个没有 _PRIVATE futex 函数的内核,你会看到

FUTEX_WAKE SUCCESS
FUTEX WAIT SUCCESS
FUTEX_WAKE_PRIVATE HAD ERR 38: Function not implemented
FUTEX_WAIT_PRIVATE HAD ERR 38: Function not implemented

这个修复应该允许 Erlang 编译,并且会产生一个可以针对 使用此处讨论的 --nodeps 方法

The problem

When starting erlang, the message pthread/ethr_event.c:98: Fatal error in wait__(): Function not implemented (38) is, on modern distros, most likely the result of a precompiled Erlang binary interacting with a kernel that doesn't implement FUTEX_WAIT_PRIVATE and FUTEX_WAKE_PRIVATE. The kernels Amazon provides for EC2 do not implement these FUTEX_PRIVATE_ macros.

Attempting to build Erlang from source on an ec2 box may fail in the same way if the distro installs kernel headers into /usr/include/linux as a requirement of other packages. (E.g., Centos requires the kernel-headers package as a prerequisite for gcc, gcc-c++, glibc-devel and glibc-headers, among others). Since the headers installed by the package do not match the kernel installed by the EC2 image creation scripts, Erlang incorrectly assumes FUTEX_WAIT_PRIVATE and FUTEX_WAKE_PRIVATE are available.

The fix

To fix it, the fastest is to manually patch erts/include/internal/pthread/ethr_event.h to use the non-_PRIVATE futex implementation:

#if defined(FUTEX_WAIT_PRIVATE) && defined(FUTEX_WAKE_PRIVATE)
#  define ETHR_FUTEX_WAIT__ FUTEX_WAIT_PRIVATE
#  define ETHR_FUTEX_WAKE__ FUTEX_WAKE_PRIVATE
#else
#  define ETHR_FUTEX_WAIT__ FUTEX_WAIT
#  define ETHR_FUTEX_WAKE__ FUTEX_WAKE
#endif

should become

//#if defined(FUTEX_WAIT_PRIVATE) && defined(FUTEX_WAKE_PRIVATE)
//#  define ETHR_FUTEX_WAIT__ FUTEX_WAIT_PRIVATE
//#  define ETHR_FUTEX_WAKE__ FUTEX_WAKE_PRIVATE  
//#else
#  define ETHR_FUTEX_WAIT__ FUTEX_WAIT
#  define ETHR_FUTEX_WAKE__ FUTEX_WAKE
//#endif

Quick test

If you suspect the private futex issue is your problem, but want to verify it before you recompile all of Erlang, the following program can pin it down:

#include <sys/syscall.h>
#include <unistd.h>
#include <sys/time.h>
#include <errno.h>
#include <stdio.h>
#include <string.h>
#include <stdint.h>
typedef uint32_t u32; /* required on older kernel headers to fix a bug in futex.h Delete this line if it causes problems. */
#include <linux/futex.h>

int main(int argc, char *argv[])
{
#if defined(FUTEX_WAIT) && defined(FUTEX_WAKE) 
        uint32_t i = 1;
        int res = 0;
        res = syscall(__NR_futex, (void *) &i, FUTEX_WAKE, 1,
                        (void*)0,(void*)0, 0);
        if (res != 0)
        {
                printf("FUTEX_WAKE HAD ERR %i: %s\n", errno, strerror(errno));
        } else {
                printf("FUTEX_WAKE SUCCESS\n");
        }

        res = syscall(__NR_futex, (void *) &i, FUTEX_WAIT, 0,
                        (void*)0,(void*)0, 0);
        if (res != 0)
        {
                printf("FUTEX_WAIT HAD ERR %i: %s\n", errno, strerror(errno));
        } else {
                printf("FUTEX_WAIT SUCCESS\n");
        }
#else
        printf("FUTEX_WAKE and FUTEX_WAIT are not defined.\n");
#endif

#if defined(FUTEX_WAIT_PRIVATE) && defined(FUTEX_WAKE_PRIVATE) 
        uint32_t j = 1;
        int res_priv = 0;
        res_priv = syscall(__NR_futex, (void *) &j, FUTEX_WAKE_PRIVATE, 1,
                        (void*)0,(void*)0, 0);
        if (res_priv != 0)
        {
                printf("FUTEX_WAKE_PRIVATE HAD ERR %i: %s\n", errno, strerror(errno));
        } else {
                printf("FUTEX_WAKE_PRIVATE SUCCESS\n");
        }

        res_priv = syscall(__NR_futex, (void *) &j, FUTEX_WAIT_PRIVATE, 0,
                        (void*)0,(void*)0, 0);
        if (res_priv != 0)
        {
                printf("FUTEX_WAIT_PRIVATE HAD ERR %i: %s\n", errno, strerror(errno));
        } else {
                printf("FUTEX_WAIT_PRIVATE SUCCESS\n");
        }
#else
        printf("FUTEX_WAKE_PRIVATE and FUTEX_WAIT_PRIVATE are not defined.\n");
#endif


        return 0;
}

Paste it into futextest.c, then gcc futextest.c and ./a.out.

If your kernel implements private futexes, you'll see

FUTEX_WAKE SUCCESS
FUTEX_WAIT SUCCESS
FUTEX_WAKE_PRIVATE SUCCESS
FUTEX_WAIT_PRIVATE SUCCESS

If you have a kernel without the _PRIVATE futex functions, you'll see

FUTEX_WAKE SUCCESS
FUTEX WAIT SUCCESS
FUTEX_WAKE_PRIVATE HAD ERR 38: Function not implemented
FUTEX_WAIT_PRIVATE HAD ERR 38: Function not implemented

This fix should allow Erlang to compile, and will yield an environment you can install rabbitmq against using the --nodeps method discussed here.

蓝眼睛不忧郁 2024-11-02 20:01:06

我首先通过源代码安装 erlang 来安装它:

sudo yum -y install make gcc gcc-c++ kernel-devel m4 ncurses-devel openssl-devel
wget http://www.erlang.org/download/otp_src_R13B04.tar.gz
tar xfvz otp_src_R13B04.tar.gz
cd otp_src_R13B04/
./configure
sudo make install

之后创建一个符号链接以使 erl 对 root 用户可用:
sudo ln -s /usr/local/bin/erl /bin/erl

安装rabbitmq rpm(也许已经过时,请自行检查最新版本):

wget http://www.rabbitmq.com/releases/rabbitmq-server/v2.4.1/rabbitmq-server-2.4.1-1.noarch.rpm
rpm -Uvh rabbitmq-server-2.4.1-1.noarch.rpm

I installed it by first installing erlang by source:

sudo yum -y install make gcc gcc-c++ kernel-devel m4 ncurses-devel openssl-devel
wget http://www.erlang.org/download/otp_src_R13B04.tar.gz
tar xfvz otp_src_R13B04.tar.gz
cd otp_src_R13B04/
./configure
sudo make install

After that create a symbolic link to also make erl available for root user:
sudo ln -s /usr/local/bin/erl /bin/erl

Install rabbitmq rpm (Maybe outdated check latest release yourself):

wget http://www.rabbitmq.com/releases/rabbitmq-server/v2.4.1/rabbitmq-server-2.4.1-1.noarch.rpm
rpm -Uvh rabbitmq-server-2.4.1-1.noarch.rpm
铃予 2024-11-02 20:01:06

如果从源代码安装 erlang,rabbitmq 的 rpm 安装无法识别 erlang,并指出需要 erlang R12B-3。
用途:
rpm --nodeps -Uvhrabbitmq-server-2.6.1-1.noarch.rpm

我能够在带有 Erlang R14B04 的 CentOS 5.6 上成功安装和使用 RabbitMQ 2.6.1

If erlang is installed from source, rpm install of rabbitmq fails to recognize erlang stating that erlang R12B-3 is required.
Use:
rpm --nodeps -Uvh rabbitmq-server-2.6.1-1.noarch.rpm

I was able to install and use RabbitMQ 2.6.1 successfully on CentOS 5.6 with Erlang R14B04

那小子欠揍 2024-11-02 20:01:06

似乎该内核与 Erlang 14B、14B01 或 14B02 不兼容

编译 Erlang 13B04 导致rabbitmq-server安装成功

Seems that this kernel is not compatible with Erlang 14B, 14B01, or 14B02

Compiling Erlang 13B04 led to a successful install of rabbitmq-server

过期以后 2024-11-02 20:01:06

对于将来找到这个答案的人,RabbitMQ 站点本身为您提供了一个潜在的答案:

在 RPM 上安装基于Linux(CentOS、Fedora、OpenSuse、RedHat)

RHEL 5(和 CentOS 5)上的 Erlang

由于EPEL软件包更新政策,EPEL 5包含Erlang版本
R12B-5,比较老了。 rabbitmq-server支持R12B-5,但是
性能可能低于最新的 Erlang 版本,并且
不支持某些非核心功能(SSL 支持、基于 HTTP 的
插件,包括管理插件)。因此,我们建议
您安装了 Erlang 的最新稳定版本。最简单的方法
为此,请使用为此目的提供的包存储库
EPEL Erlang 包的所有者。通过调用(以 root 身份)启用它:

wget -O /etc/yum.repos.d/epel-erlang.repo
http://repos.fedorapeople.org/repos/peter/erlang/epel -erlang.repo

然后使用 yum install erlang 安装或更新 erlang。

For people in the future finding this answer, the RabbitMQ site itself has a potential answer for you:

Installing on RPM-based Linux (CentOS, Fedora, OpenSuse, RedHat)

Erlang on RHEL 5 (and CentOS 5)

Due to the EPEL package update policy, EPEL 5 contains Erlang version
R12B-5, which is relatively old. rabbitmq-server supports R12B-5, but
performance may be lower than for more recent Erlang versions, and
certain non-core features are not supported (SSL support, HTTP-based
plugins including the management plugin). Therefore, we recommend that
you install the most recent stable version of Erlang. The easiest way
to do this is to use a package repository provided for this purpose by
the owner of the EPEL Erlang package. Enable it by invoking (as root):

wget -O /etc/yum.repos.d/epel-erlang.repo
http://repos.fedorapeople.org/repos/peter/erlang/epel-erlang.repo

and then install or update erlang with yum install erlang.

怎会甘心 2024-11-02 20:01:06

如果您在最小操作系统安装上手动构建 Erlang,您可能还会发现需要安装 wxGTK 和 wxGTK。 wxGTK-devel 以便所有测试都能正确构建和运行。

If you go down the route of building Erlang manually on a minimal OS install, you may also find that you need to install wxGTK & wxGTK-devel in order for all of the tests to build and run correctly.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文