整理最近遇到的错误解决方法

问题一:
安装psycopg2-binary报错

[root@node1 Python-3.7.13]# pip install psycopg2-binary
WARNING: pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.
WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/psycopg2-binary/
WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/psycopg2-binary/
WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/psycopg2-binary/
WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/psycopg2-binary/
WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/psycopg2-binary/
Could not fetch URL https://pypi.org/simple/psycopg2-binary/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/psycopg2-binary/ (Caused by SSLError("Can't connect to HTTPS URL because the SSL module is not available.")) - skipping
ERROR: Could not find a version that satisfies the requirement psycopg2-binary (from versions: none)
ERROR: No matching distribution found for psycopg2-binary
WARNING: pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.
Could not fetch URL https://pypi.org/simple/pip/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/pip/ (Caused by SSLError("Can't connect to HTTPS URL because the SSL module is not available.")) - skipping

问题一 :解决方法

[root@node1 Python-3.7.13]pip install psycopg2-binary -i http://mirrors.aliyun.com/pypi/simple/ --trusted-host mirrors.aliyun.com
Looking in indexes: http://mirrors.aliyun.com/pypi/simple/, http://mirrors.aliyun.com/pypi/simple
Collecting psycopg2-binary
  Downloading http://mirrors.aliyun.com/pypi/packages/6f/ac/0cc0412f1710598537af8021a7c63334daaa8d3474d17133a6805bf54f5b/psycopg2_binary-2.9.7-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.0 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 3.0/3.0 MB 16.2 MB/s eta 0:00:00
Installing collected packages: psycopg2-binary
Successfully installed psycopg2-binary-2.9.7
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv
WARNING: You are using pip version 22.0.4; however, version 23.2.1 is available.
You should consider upgrading via the '/usr/local/python3/bin/python3.7 -m pip install --upgrade pip' command.

问题二:
python3.7 以上版本需要一个新的依赖包 libffi-devel,系统环境中缺乏这个包

ModuleNotFoundError: No module named '_ctypes'

问题二:解决方法

[root@node1 Python-3.7.13]# yum install libffi-devel -y
[root@node1 Python-3.7.13]# make install   #Python3安装目录下重新编译安装Python
[root@node1 Python-3.7.13]# pip install patroni[etcd] -i http://mirrors.aliyun.com/pypi/simple/ --trusted-host mirrors.aliyun.com

问题三:
新Etcd节点,启动失败无法加入到集群

Aug 23 23:00:59 localhost etcd: publish error: etcdserver: request timed out

问题三:解决方法 删除集群下所有节点的数据,使他重新同步

[root@localhost ~]# systemctl start etcd
Job for etcd.service failed because a timeout was exceeded. See "systemctl status etcd.service" and "journalctl -xe" for details.
[root@localhost ~]# cd /var/lib/etcd/
[root@localhost etcd]# ll
total 0
drwx------ 3 etcd etcd 20 Aug 23 23:04 pg2.etcd
[root@localhost etcd]# mv pg2.etcd/ /tmp/
[root@localhost etcd]# systemctl start etcd

你可能感兴趣的:(linux运维,linux,运维,centos,python)