【问题标题】:Beanstalkd for CentOs 7CentOs 7 的 Beanstalkd
【发布时间】:2015-01-03 08:48:05
【问题描述】:

由于配置错误,我已将 VPS 从 CentOs 6 迁移到 CentOs 7 以重新开始。除此之外,我还在 CentOs 6 上安装了 beanstalkd 服务。

当时我已经按照本教程 http://viewsfromtheside.com/2014/06/12/install-beanstalkd-centos-6/ 进行操作,它对我来说非常有效。

但是现在,我无法在我的 CentOs 7 版本上安装 Beanstalkd。

我将这些行用于 EPEL 回购:

# wget http://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-2.noarch.rpm
# rpm -ivh epel-release-7-2.noarch.rpm

然后我尝试了:

# yum install beanstalkd --enablerepo=epel-testing

和:

# yum --disablerepo="*" --enablerepo="epel" list available | grep 'beanstalkd'

甚至:

#  yum search beanstalkd

但仍然:没有找到匹配项:beantalkd ...

我是 CentOs 和 EPEL repos 的新手,所以也许我错过了什么?无论如何,如何在 CentOs 7 上安装 Beanstalkd ?

【问题讨论】:

    标签: linux beanstalkd centos7 epel


    【解决方案1】:

    是的,你可以通过 git 安装它,然后复制 systemd 脚本:

    第 0 步。安装 git

    yum install git

    第 1 步。克隆存储库

    git clone git://github.com/kr/beanstalkd.git
    cd beanstalkd
    make
    cp beanstalkd /usr/bin/beanstalkd
    mkdir /var/lib/beanstalkd
    

    第二步,制作启动脚本

    使用此内容创建文件/etc/systemd/system/beanstalkd.service

    [Unit]
    Description=Beanstalkd is a simple, fast work queue
    
    [Service]
    User=root
    ExecStart=/usr/bin/beanstalkd -b /var/lib/beanstalkd
    
    [Install]
    WantedBy=multi-user.target
    

    第 3 步。最后,运行

    systemctl enable beanstalkdsystemctl start beanstalkd

    第 4 步。检查

    ps ax | grep beanstalkd

    【讨论】:

    • 以无人能及的方式运行? github.com/kr/beanstalkd/blob/master/adm/systemd/…
    • 值得一提的是干净的服务器,包 gcc、git、make 都是必需的 yum install gcc git make 另外如果你这样做 make install 然后复制到 /usr/bin 不需要,因为它安装到 /usr/ local/bin 需要在启动脚本中更改 ExecStart=/usr/local/bin/beanstalkd -b /var/lib/beanstalkd
    • 创建服务文件后不要忘记systemctl daemon-reload。另外,如果你不想要默认的 65335 字节,你可以在服务文件的参数中添加-z BYTES
    【解决方案2】:
    1. yum install beanstalkd
    2. service beanstalkd 启动
    3. 服务 beanstalkd 状态

    【讨论】:

    • 任何运行标准 centos7 的人这似乎都可以正常工作
    【解决方案3】:

    已通过https://bugzilla.redhat.com/show_bug.cgi?id=1139358 提出在 EPEL 中为 CentOS 7 发布 beanstalkd rpm 软件包的请求。您必须等待包维护者发布包。

    同时您可以构建自己的包或从http://cbs.centos.org/koji/buildinfo?buildID=686 下载并安装 RPM:

    yum install http://cbs.centos.org/kojifiles/packages/beanstalkd/1.9/3.el7/x86_64/beanstalkd-1.9-3.el7.x86_64.rpm
    

    【讨论】:

      【解决方案4】:

      我能够在 Centos 7 上从源代码构建。只需 git clone 它:

      https://github.com/kr/beanstalkd

      然后按照那里的说明进行安装。 这可行,但我无法对其进行守护,也找不到 Centos 7 的启动脚本。 最后只是在 supervisord 中配置它以确保它始终运行。

      【讨论】:

        【解决方案5】:

        在 Centos 7 上安装、启动时启用、启动和检查 beanstalkd 服务状态的四个简单步骤:

        • yum install beanstalkd
        • systemctl 启用 beanstalkd
        • service beanstalkd 启动
        • 服务 beanstalkd 状态

        【讨论】:

          猜你喜欢
          • 2018-09-02
          • 2017-09-14
          • 1970-01-01
          • 1970-01-01
          • 2019-07-21
          • 1970-01-01
          • 2015-09-07
          • 2015-06-05
          • 2018-10-18
          相关资源
          最近更新 更多