Centos 5.5 上的 RabbitMQ 安装问题 [英] RabbitMQ install issue on Centos 5.5

查看:25
本文介绍了Centos 5.5 上的 RabbitMQ 安装问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

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

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

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

我尝试使用以下方法安装 erlang 和 rabbitmq-server:1) 百胜回购2)直接rpm安装3) 从源代码编译.

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

在任何情况下,我在尝试启动时都会收到以下消息RabbitMQ-Server进程:

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

pthread/ethr_event.c:98:wait__() 中的致命错误:函数没有实施 (38)

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

任何帮助将不胜感激.

推荐答案

问题

在启动 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_ 宏.

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.

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

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.

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

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

应该变成

//#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 之前验证它,以下程序可以确定它:

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
", errno, strerror(errno));
        } else {
                printf("FUTEX_WAKE SUCCESS
");
        }

        res = syscall(__NR_futex, (void *) &i, FUTEX_WAIT, 0,
                        (void*)0,(void*)0, 0);
        if (res != 0)
        {
                printf("FUTEX_WAIT HAD ERR %i: %s
", errno, strerror(errno));
        } else {
                printf("FUTEX_WAIT SUCCESS
");
        }
#else
        printf("FUTEX_WAKE and FUTEX_WAIT are not defined.
");
#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
", errno, strerror(errno));
        } else {
                printf("FUTEX_WAKE_PRIVATE SUCCESS
");
        }

        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
", errno, strerror(errno));
        } else {
                printf("FUTEX_WAIT_PRIVATE SUCCESS
");
        }
#else
        printf("FUTEX_WAKE_PRIVATE and FUTEX_WAIT_PRIVATE are not defined.
");
#endif


        return 0;
}

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

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

如果您的内核实现了私有 futex,您会看到

If your kernel implements private futexes, you'll see

FUTEX_WAKE SUCCESS
FUTEX_WAIT SUCCESS
FUTEX_WAKE_PRIVATE SUCCESS
FUTEX_WAIT_PRIVATE SUCCESS

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

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

这个修复应该允许 Erlang 编译,并且会产生一个环境,你可以在 使用这里讨论的 --nodeps 方法安装 rabbitmq.

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

这篇关于Centos 5.5 上的 RabbitMQ 安装问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆