首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >在Docker中运行Blackfire与PHP Swoole的问题

在Docker中运行Blackfire与PHP Swoole的问题
EN

Stack Overflow用户
提问于 2021-06-20 22:30:32
回答 1查看 454关注 0票数 3

有没有人能和Swoole一起使用Blackfire?我已经尝试了几天,但没有成功。

我在中调用以下脚本:

代码语言:javascript
复制
#!/usr/bin/env bash

# @see https://blackfire.io/docs/up-and-running/installation

set -e

apt-get update
apt-get install -y gnupg --no-install-recommends

# Configure the Debian Repository
wget -q -O - https://packages.blackfire.io/gpg.key | apt-key add -
echo "deb http://packages.blackfire.io/debian any main" | tee /etc/apt/sources.list.d/blackfire.list
apt-get update

# Install and Configure the Agent
echo "$(date '+%Y-%m-%d %H:%M:%S,%3N') $(tput bold)$(tput setaf 4)INFO$(tput sgr0) Install and Configure the Agent."
apt-get -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" install blackfire
blackfire agent:config --server-id=MY-SERVER-ID --server-token=MY-SERVER-TOKEN
/etc/init.d/blackfire-agent restart

# Install the PHP Probe
echo "$(date '+%Y-%m-%d %H:%M:%S,%3N') $(tput bold)$(tput setaf 4)INFO$(tput sgr0) Install the PHP Probe."
apt-get -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" install blackfire-php

# Clear
rm -r /var/lib/apt/lists/*
mkdir -p /var/run/blackfire

主管conf:

代码语言:javascript
复制
[supervisord]
user = root

[program:blackfire-agent]
command = /usr/bin/blackfire agent:config --server-id=MY_BLACKFIRE_SERVER_ID --server-
token=MY_BLACKFIRE_SERVER_TOKEN
user = root
autostart = true
autorestart = true
stdout_logfile = /proc/self/fd/1
stdout_logfile_maxbytes = 0
stderr_logfile = /proc/self/fd/1
stderr_logfile_maxbytes = 0

使用黑火卷曲时的错误信息:

代码语言:javascript
复制
reginato@reginato-Lenovo-IdeaPad-S145-15IWL:~/git/shark-tank$ docker-compose exec blackfire blackfire curl http://localhost:9501

WARNING: Some services (elk, redis) use the 'deploy' key, which will be ignored. Compose does not support 'deploy' configuration - use `docker stack deploy` to deploy to a swarm.

20/06 00:19:26 DEBUG     blackfire Reading client configuration file "/dev/null"
20/06 00:19:26 DEBUG     blackfire Retrieving signature
20/06 00:19:26 DEBUG     blackfire Sending request GET https://blackfire.io/api/v1/collab-tokens
20/06 00:19:28 DEBUG     blackfire Sending request POST https://blackfire.io/api/v1/signing
20/06 00:19:28 DEBUG     blackfire Fetching agent credentials
20/06 00:19:28 DEBUG     blackfire Sending request GET https://blackfire.io/api/v1/agents
20/06 00:19:28 DEBUG     blackfire Timespan enabled, launching preflight.

20/06 00:19:28 DEBUG     blackfire #################] 100%
Error while running command: exit status 7
EN

回答 1

Stack Overflow用户

发布于 2021-08-19 14:27:20

老问题,但万一有人来了,我今天就这么做了。

blackfire curl ...返回的退出状态不是来自黑火,而是来自卷曲。

知道了这一点,退出代码7就意味着:

未能将()连接到主机或代理。

(以下是所有出口代码的列表:https://curl.se/libcurl/c/libcurl-errors.html)

因此,对于这个特殊情况,对接机可能无法到达http://localhost

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/68060524

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档