6错误记录 · SpringCloud微服务实战 · 看云

错误1:curl: (35) TCP connection reset by peer

因为国内访问不到docker官方镜像的缘故,所以我们要使用 国内的源来访问,切换阿里源就可以解决这个问题
yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo

错误2:ERROR: Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-install-rqaYFB/pycparser/

解决方法是更新 setuptools 和 pip:

pip install --upgrade setuptools
python -m pip install --upgrade pip

错误3:Setup script exited with error: command 'gcc' failed with exit status 1

解决方法是

$ yum install python-devel
$ yum install libevent-devel
$ pip install gevent
$ yum install groupinstall 'development tools' ##把环境更新下

错误4:_posixsubprocess.c:16:20: fatal error: Python.h: No such file or directory Command errored out with exit status 1: /usr/bin/python2 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-UoL3hv/subprocess32/setup.py'"'"';

stackoverflow 给出的解释:
Looks like you haven't properly installed the header files and static libraries for python dev. Use your package manager to install them system-wide.

Forapt(Ubuntu, Debian...):

sudo apt-get install python-dev   # for python2.x installs
sudo apt-get install python3-dev  # for python3.x installs

Foryum(CentOS, RHEL...):

sudo yum install python-devel   # for python2.x installs
sudo yum install python3-devel   # for python3.x installs

Fordnf(Fedora...):

sudo dnf install python2-devel  # for python2.x installs
sudo dnf install python3-devel  # for python3.x installs

Forzypper(openSUSE...):

sudo zypper in python-devel   # for python2.x installs
sudo zypper in python3-devel  # for python3.x installs

Forapk(Alpine...):

# This is a departure from the normal Alpine naming
# scheme, which uses py2- and py3- prefixes
sudo apk add python2-dev  # for python2.x installs
sudo apk add python3-dev  # for python3.x installs

Forapt-cyg(Cygwin...):

apt-cyg install python-devel   # for python2.x installs
apt-cyg install python3-devel  # for python3.x installs

错误5 docker-compose up -d

报一下错误

Creating network "prometheus_default" with the default driver
ERROR: Failed to Setup IP tables: Unable to enable SKIP DNAT rule:  (iptables failed: iptables --wait -t nat -I DOCKER -i br-79a85facd842 -j RETURN: iptables: No chain/target/match by that name.
 (exit status 1))

重启docker

service docker restart