php找不到gearmanClent类,centos 使用docker搭建Gearman任务分发系统 ,Gearman的安装和使用...

第一步,centos 安装 docker,拉取docker centos 镜像(此处不赘述)

https://docs.docker.com/install/linux/docker-ce/centos/

docker -v

docker ps  (查看docker的容器状态)

docker pull centos(docker安装ubuntu最新镜像)

docker images (查看本地所有镜像)

[root@izwz9c4rb2kbs0ggxd67hiz ~]# docker run -d -it –name=gearman-container centos:latest /bin/bash(name前面双横线)

docker ps

docker exec -it f49a2392164e /bin/bash

f49a2392164e(CONTAINER ID)

以centos运行docker容器

第二步,搭建Gearman任务分发系统

yum update

[root@f49a2392164e /]# yum install gearmand

Loaded plugins: fastestmirror, ovl

Loading mirror speeds from cached hostfile

* base: mirrors.163.com

* extras: mirrors.163.com

* updates: mirrors.cn99.com

No package gearmand available.

Error: Nothing to do

yum没有找到对应依赖包,更新epel第三方软件库,运行命令:

yum install -y epel-release

更新完epel第三方软件库后,再次尝试使用yum命令安装对应的软件包

yum install gearmand

remi — linux下比较好用的安装源

yum install wget

在centOS下下载源

su

cd /etc/yum.repos.d

wget http://rpms.famillecollet.com/enterprise/remi.repo

安装php扩展

yum install –enablerepo=remi –enablerepo=remi-php56 php-pecl-gearman

或升级:

yum –enablerepo=remi-php55,remi update php*

查看扩展是否安装成功

worker.php

client.php

测试:

启动服务

启动worker

启动client

https://www.jianshu.com/p/c7a55dee5796

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值