zoukankan      html  css  js  c++  java
  • centos beanstalkd 安装 与php调用

    centos安装消息队列beanstalkd

    在虚拟机上装一个centos系统,然后在centos上安装beanstalkd

    yum install epel-release
    
    //  不安装上一步,无法找到 beanstalkd
    
    yum install beanstalkd --enablerepo=epel

    //查看版本
    beanstalkd -v   

    // 找不到软件,换个命令
    /usr/bin/beanstalkd -v

    安装成功,启动

    //启动 -b断电重启会恢复
    /usr/bin/beanstalkd -l 0.0.0.0 -p 11300 -b /var/lib/beanstalkd/binlog -F

    启动后就不能退出界面,编写一个shell脚本后台运行

    // 创建文件夹

    mkdir /shdir
    mkdir /shdir/log

    // 进入shdir
    cd /shdir
    //编写 shell 脚本
    vim beanstalkd.sh

    beanstalkd.sh 内容

    #!/bin/sh
    #chkconfig:2345 85 15
    #description:auto_run
    #程序名
    RUN_NAME="beanstalkd"
    
    
    start(){
        nohup /usr/bin/beanstalkd -l 0.0.0.0 -p 11300 -b /var/lib/beanstalkd/binlog -F >/shdir/log/beanstalkd.log 2>&1 &
        echo 'beanstalkd start'
    }
    
    stop(){
       kill -9 beanstalkd
    }
    
    case "$1" in
            start)
                start
                ;;
            stop)
                stop
                ;;
            restart)
                stop
                start
                ;;
            *)
                    echo "Userage: $0 {start|stop|restart}"
                    exit 1
    esac

    php 使用

    pheanstalk 原文地址:https://www.kancloud.cn/vson/php-message-queue/892388

    composer install pda/pheanstalk
  • 相关阅读:
    PHP
    PHP
    PHP
    PHP
    PHP
    MySQL
    PHP
    PHP
    PHP
    linux 用户及用户组管理
  • 原文地址:https://www.cnblogs.com/jasonLiu2018/p/12450859.html
Copyright © 2011-2022 走看看