使用docker-compose安装tidb

为提高效率,提问时请尽量提供详细背景信息,问题描述清晰可优先响应。以下信息点请尽量提供:

  • 系统版本 & kernel 版本:
  • TiDB 版本:3.0.2
  • 磁盘型号:
  • 集群节点分布:
  • 数据量 & region 数量 & 副本数:
  • 集群 QPS、.999-Duration、读写比例:
  • 问题描述(我做了什么):再测试机使用docker-compose安装,再执行 ``` cd tidb-docker-compose && docker-compose pull
[root@JH-BJ-TEST-8-16 data]# cd tidb-docker-compose && docker-compose pull
Traceback (most recent call last):
  File "/bin/docker-compose", line 10, in <module>
    sys.exit(main())
  File "/usr/lib/python2.7/site-packages/compose/cli/main.py", line 71, in main
    command()
  File "/usr/lib/python2.7/site-packages/compose/cli/main.py", line 124, in perform_command
    project = project_from_options('.', options)
  File "/usr/lib/python2.7/site-packages/compose/cli/command.py", line 42, in project_from_options
    compatibility=options.get('--compatibility'),
  File "/usr/lib/python2.7/site-packages/compose/cli/command.py", line 128, in get_project
    project_name, config_data, client, environment.get('DOCKER_DEFAULT_PLATFORM')
  File "/usr/lib/python2.7/site-packages/compose/project.py", line 101, in from_config
    service_networks = get_networks(service_dict, networks)
  File "/usr/lib/python2.7/site-packages/compose/network.py", line 320, in get_networks
    networks[network.true_name] = netdef
  File "/usr/lib/python2.7/site-packages/compose/network.py", line 125, in true_name
    self._set_legacy_flag()
  File "/usr/lib/python2.7/site-packages/compose/network.py", line 146, in _set_legacy_flag
    data = self.inspect(legacy=True)
  File "/usr/lib/python2.7/site-packages/compose/network.py", line 106, in inspect
    return self.client.inspect_network(self.legacy_full_name)
  File "/usr/lib/python2.7/site-packages/docker/utils/decorators.py", line 19, in wrapped
    return f(self, resource_id, *args, **kwargs)
  File "/usr/lib/python2.7/site-packages/docker/api/network.py", line 211, in inspect_network
    res = self._get(url, params=params)
  File "/usr/lib/python2.7/site-packages/docker/utils/decorators.py", line 46, in inner
    return f(self, *args, **kwargs)
  File "/usr/lib/python2.7/site-packages/docker/api/client.py", line 230, in _get
    return self.get(url, **self._set_request_timeout(kwargs))
  File "/usr/lib/python2.7/site-packages/requests/sessions.py", line 546, in get
    return self.request(
   之前安装是没有问题,现在换个环境报错

看报错是不是 python 环境的问题?

2.7.5python环境,和之前对比了一下 之前也是2.7.5

hi,能提供下全部的错误栈信息吗,另外你的 docker-compose 版本是多少,以及机器的 docker 版本,linux 版本都提供一下

docker版本19.03.2 docker-compose 1.24.1 linux版本CentOS Linux release 7.6.1810 (Core)

这个是之前成功安装的命令,刚刚也是按照这个命令执行的

你执行 docker-compose pull 命令的全部错误栈信息提供一下?我看你上面发的被截断了

主要就是截图的这些命令,这些命令是上次执行成功的命令,下面的都是按照官网执行的,所以下面的,没有贴出来

主要就是要看你那个报错信息,你把全部的错误信息贴一下吧

[root@JH-BJ-TEST-8-16 data]# cd tidb-docker-compose && docker-compose pull

Traceback (most recent call last): File “/bin/docker-compose”, line 10, in sys.exit(main()) File “/usr/lib/python2.7/site-packages/compose/cli/main.py”, line 71, in main command() File “/usr/lib/python2.7/site-packages/compose/cli/main.py”, line 124, in perform_command project = project_from_options(’.’, options) File “/usr/lib/python2.7/site-packages/compose/cli/command.py”, line 42, in project_from_options compatibility=options.get(’–compatibility’), File “/usr/lib/python2.7/site-packages/compose/cli/command.py”, line 128, in get_project project_name, config_data, client, environment.get(‘DOCKER_DEFAULT_PLATFORM’) File “/usr/lib/python2.7/site-packages/compose/project.py”, line 101, in from_config service_networks = get_networks(service_dict, networks) File “/usr/lib/python2.7/site-packages/compose/network.py”, line 320, in get_networks networks[network.true_name] = netdef File “/usr/lib/python2.7/site-packages/compose/network.py”, line 125, in true_name self._set_legacy_flag() File “/usr/lib/python2.7/site-packages/compose/network.py”, line 146, in _set_legacy_flag data = self.inspect(legacy=True) File “/usr/lib/python2.7/site-packages/compose/network.py”, line 106, in inspect return self.client.inspect_network(self.legacy_full_name) File “/usr/lib/python2.7/site-packages/docker/utils/decorators.py”, line 19, in wrapped return f(self, resource_id, *args, **kwargs) File “/usr/lib/python2.7/site-packages/docker/api/network.py”, line 211, in inspect_network res = self._get(url, params=params) File “/usr/lib/python2.7/site-packages/docker/utils/decorators.py”, line 46, in inner return f(self, *args, **kwargs) File “/usr/lib/python2.7/site-packages/docker/api/client.py”, line 230, in _get return self.get(url, **self._set_request_timeout(kwargs)) File “/usr/lib/python2.7/site-packages/requests/sessions.py”, line 546, in get return self.request(‘GET’, url, **kwargs) File “/usr/lib/python2.7/site-packages/requests/sessions.py”, line 533, in request resp = self.send(prep, **send_kwargs) File “/usr/lib/python2.7/site-packages/requests/sessions.py”, line 646, in send r = adapter.send(request, **kwargs) File “/usr/lib/python2.7/site-packages/requests/adapters.py”, line 449, in send timeout=timeout File “/usr/lib/python2.7/site-packages/requests/packages/urllib3/connectionpool.py”, line 547, in urlopen timeout_obj = self._get_timeout(timeout) File “/usr/lib/python2.7/site-packages/requests/packages/urllib3/connectionpool.py”, line 302, in _get_timeout return Timeout.from_float(timeout) File “/usr/lib/python2.7/site-packages/requests/packages/urllib3/util/timeout.py”, line 154, in from_float return Timeout(read=timeout, connect=timeout) File “/usr/lib/python2.7/site-packages/requests/packages/urllib3/util/timeout.py”, line 97, in init self._connect = self._validate_timeout(connect, ‘connect’) File “/usr/lib/python2.7/site-packages/requests/packages/urllib3/util/timeout.py”, line 127, in _validate_timeout “int or float.” % (name, value)) ValueError: Timeout value connect was Timeout(connect=60, read=60, total=None), but it must be an int or float.

麻烦在贴一下 pip freeze 这个命令的输出

[root@JH-BJ-TEST-8-16 data]# pip freeze

DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won’t be maintained after that date. A future version of pip will drop support for Python 2.7. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support
amqp==1.4.9
anyjson==0.3.3
asn1crypto==0.24.0
backports.ssl-match-hostname==3.7.0.1
bcrypt==3.1.7
billiard==3.3.0.23
cached-property==1.5.1
celery==3.1.18
certifi==2019.6.16
cffi==1.12.3
chardet==3.0.4
configobj==4.7.2
cryptography==2.7
decorator==3.4.0
Django==1.8.11
django-celery==3.2.1
docker==3.7.3
docker-compose==1.24.1
docker-pycreds==0.4.0
dockerpty==0.4.1
docopt==0.6.2
enum34==1.1.6
functools32==3.2.3.post2
httplib2==0.9.1
idna==2.7
iniparse==0.4
ipaddress==1.0.22
IPy==0.75
javapackages==1.0.0
jsonschema==2.6.0
kitchen==1.1.1
kombu==3.0.37
lxml==3.2.1
Mako==1.0.4
MarkupSafe==0.23
meld3==1.0.2
MySQL-python==1.2.3
netsnmp-python==1.0a1
paramiko==2.6.0
perf==0.1
policycoreutils-default-encoding==0.1
pycparser==2.19
pycurl==7.19.0
pygobject==3.22.0
pygpgme==0.3
pyliblzma==0.5.3
pymongo==3.8.0
PyMySQL==0.6.7
PyNaCl==1.3.0
pyparsing==1.5.6
python-linux-procfs==0.4.9
pytoml==0.1.14
pytz==2019.1
pyudev==0.15
pyxattr==0.5.1
PyYAML==3.13
redis==3.2.1
registries==0.1
requests==2.20.1
schedutils==0.4
seobject==0.1
sepolicy==1.1
six==1.12.0
slip==0.4.0
slip.dbus==0.4.0
suds==0.4
supervisor==3.3.3
texttable==0.9.1
urlgrabber==3.10
urllib3==1.24.3
uWSGI==2.0.13.1
websocket-client==0.56.0
yum-metadata-parser==1.1.4

这个问题是不是解决了?不好意思,我刚处理其它事情去了, 你这个应该是 requests 或者 urllib3 版本导致的,https://github.com/docker/compose/issues/4927 这里有个相关的issue,如果那个问题还在,可以换下不同版本的 requests 和 urllib3 库试一下

嗯嗯已经解决了

如果别人的回答有帮助,可以将其标记为解决方案:white_check_mark:,这样可以帮助其他有同样问题的人快速找到答案~

此话题已在最后回复的 1 分钟后被自动关闭。不再允许新回复。