• gearmand的安装


    1、安装gperf libuuid-devel
      yum install -y gperf libuuid-devel

    2、安装 libevent
      yum install libevent libevent-devel

      如果libevent版本低,则手动安装

      wget https://sourceforge.net/projects/levent/files/libevent/libevent-2.0/libevent-2.0.22-stable.tar.gz
      tar -zxvf libevent-2.0.22-stable.tar.gz
      cd libevent-2.0.22-stable
      ./configure
      make
      make install

    3、添加环境变量
      echo export LD_LIBRARY_PATH=/usr/local/lib >> ~/.bash_profile
      shutdown -r now

    4、安装gearmand服务
      wget https://launchpad.net/gearmand/1.2/1.1.12/+download/gearmand-1.1.12.tar.gz
      tar -zxvf gearmand-1.1.12.tar.gz
      cd gearmand-1.1.12
      ./configure --prefix=/usr/local/gearmand (如果libevent安装时指定的目录,则带上参数 --with-libevent-prefix=/usr/lib64)
      make
      make install

    5、安装成功图

        # /usr/local/gearmand/bin/gearman

    6、创建日志/home/data/gearmand/gearmand.log
      # touch /home/data/gearmand/gearmand.log
        
    7、启动

      # /usr/local/gearmand/sbin/gearmand -d -u root -L 192.168.161.136 --log-file=/home/data/gearmand/gearmand.log
      

      查是否运行
      # ps axu | grep gearmand
        
      查看监听端口
      # netstat -anp | grep 4730  centos6

      # ss -anp | grep 4730  centos7


    8、安装php扩展
      wget http://pecl.php.net/get/gearman-1.1.2.tgz
      tar -zxvf gearman-1.1.2.tgz
      cd gearman-1.1.2
      /usr/local/php/bin/phpize
      ./configure --with-php-config=/usr/local/php/bin/php-config --with-gearman=/usr/local/gearmand
      make
      make install
      安装成功后会显示gearman.so的路径,在php.ini文件中加入扩展

  • 相关阅读:
    SQL通用数据类型
    SQL基础
    软件测试相关(1)
    C语言——判断
    C语言新手教程——计算
    并查集
    洛谷-P1551 亲戚
    洛谷-P1536 村村通
    洛谷-P1525 [NOIP2010 提高组] 关押罪犯
    洛谷-P2814 家谱
  • 原文地址:https://www.cnblogs.com/oo-oo/p/gearman_setup.html
Copyright © 2020-2023  润新知