当前位置:首页 > 服务端 > error: , syntax error: line 1, column 0: file: /usr/local/lib/python2.7/xmlrpclib.py line: 557

error: , syntax error: line 1, column 0: file: /usr/local/lib/python2.7/xmlrpclib.py line: 557

当linux设备上开启sonar6.2时,

supervisorctl status报如下错误:

error: <class 'xml.parsers.expat.ExpatError'>, syntax error: line 1, column 0: file: /usr/local/lib/python2.7/xmlrpclib.py line: 557

关闭sonar6.2时,报如下错误:

error: <class 'socket.error'>, [Errno 113] No route to host: file: /usr/local/lib/python2.7/socket.py line: 571

据说要关闭防火墙

/usr/sbin/sestatus查看防护墙状态

cat /etc/selinux/config查看防火墙配置

SELINUX=disabled关闭

原来是这两行注释掉了

[inet_http_server]         ; inet (TCP) server disabled by default
port=*:9002

tmd,supervisor.conf的配置太坑了,不小心就会出错

另外附一个坑点:supervisord.conf的配置里的注释符,注意分号前后的空格,注释符和配置之间要至少有一个空格


 

上面的方法,指标不治本,通过下面的命令,我们知道supervisord会在如下路径,寻找名字为supervisord.conf的配置文件

[etc]$ supervisord
Error: No config file found at default paths (/usr/local/etc/supervisord.conf, /usr/local/supervisord.conf, supervisord.conf, etc/supervisord.conf, /etc/supervisord.conf, /etc/supervisor/supervisord.conf); use the -c option to specify a config file at a different path
For help, use /usr/local/bin/supervisord -h

注意上面有绝对路径和相对路径

这里注意两点,一个是配置文件的名字,不能是其他名字,如果是其他名字,就需要启动时指定配置文件的路径和名字;二是路径包含在搜索路径内

1、supervisord -c /a/b/x/s/super.conf。这样启动的supervisor可以任意路径和任意的配置文件名字;

但是,执行supervisorctl的时候,也要指定配置文件的名字和路径,像:supervisor -c /a/b/x/s/super.conf status这样

如果你直接执行supervisorctl status,就会报下面的错误

error: <class 'socket.error'>, [Errno 113] No route to host: file: /usr/local/lib/python2.7/socket.py line: 571

2、另外sonar6.2会默认使用9001端口,keepalived也默认会使用9001端口,所以应该注意端口冲突问题

3、执行命令supervisord 和 supervisorctl 的时候,都会在默认路径下搜索配置文件;

error: <class 'xml.parsers.expat.ExpatError'>, syntax error: line 1, column 0: file: /usr/local/lib/python2.7/xmlrpclib.py line: 557 _ JavaClub全栈架构师技术笔记

 

error: <class 'socket.error'>, [Errno 113] No route to host: file: /usr/local/lib/python2.7/socket.py line: 571

4、再说一下上面治标的原因:启动supervisor有连个方法,一个是sock,另一个是下面的方法

error: <class 'xml.parsers.expat.ExpatError'>, syntax error: line 1, column 0: file: /usr/local/lib/python2.7/xmlrpclib.py line: 557 _ JavaClub全栈架构师技术笔记

supervisor.sock是以.sock 为后缀的文件而已,UNIX 系统不以后缀区分文件类型,但为了识别,通常使用后缀来标识一下。.sock文件通常是UNIX 域套接字(UNIX domain socket),即通过文件系统(而非网络地址)进行寻址和访问的套接字

上面的是Unix domain socket,是操作系统内部通信,所以只可以本地访问

下面的tcp通讯,可以远程访问和本地访问

详细区别参考:

https://en.wikipedia.org/wiki/Unix_domain_socket

https://lists.freebsd.org/pipermail/freebsd-performance/2005-February/001143.html

Unix domain socket

From Wikipedia, the free encyclopedia

A Unix domain socket or IPC socket (inter-process communication socket) is a data communications endpoint for exchanging data between processes executing on the same host operating system. Like named pipes, Unix domain sockets support transmission of a reliable stream of bytes (SOCK_STREAM, compare to TCP). In addition, they support ordered and reliable transmission of datagrams (SOCK_SEQPACKET), or unordered and unreliable transmission of datagrams (SOCK_DGRAM, compare to UDP). The Unix domain socket facility is a standard component of POSIX operating systems.

The API for Unix domain sockets is similar to that of an Internet socket, but rather than using an underlying network protocol, all communication occurs entirely within the operating system kernel. Unix domain sockets use the file system as their address name space. Processes reference Unix domain sockets as file system inodes, so two processes can communicate by opening the same socket.

In addition to sending data, processes may send file descriptors across a Unix domain socket connection using the sendmsg() and recvmsg() system calls. This allows the sending processes to grant the receiving process access to a file descriptor for which the receiving process otherwise does not have access.[1] This can be used to implement a rudimentary form of capability-based security.[2] For example, this allows the Clam AntiVirus scanner to run as an unprivileged daemon on Linux and BSD, yet still read any file sent to the daemon's Unix domain socket.

https://en.wikipedia.org/wiki/Unix_domain_socket

作者:脚本小娃子
来源链接:https://www.cnblogs.com/shengulong/p/6746583.html

版权声明:
1、Java侠(https://www.javaxia.com)以学习交流为目的,由作者投稿、网友推荐和小编整理收藏优秀的IT技术及相关内容,包括但不限于文字、图片、音频、视频、软件、程序等,其均来自互联网,本站不享有版权,版权归原作者所有。

2、本站提供的内容仅用于个人学习、研究或欣赏,以及其他非商业性或非盈利性用途,但同时应遵守著作权法及其他相关法律的规定,不得侵犯相关权利人及本网站的合法权利。
3、本网站内容原作者如不愿意在本网站刊登内容,请及时通知本站(javaclubcn@163.com),我们将第一时间核实后及时予以删除。





本文链接:https://www.javaxia.com/server/125669.html

标签: syntax error
分享给朋友:

“error: , syntax error: line 1, column 0: file: /usr/local/lib/python2.7/xmlrpclib.py line: 557” 的相关文章

实习第一周(Golang)2022年05月14日 16:18:05
软件工程复习要点2022年05月17日 14:38:01
[C++]VC自定义发IP包例子2022年05月17日 20:41:27
python中循环的技巧2022年05月23日 21:49:36
Struts2 和 OGNL2022年05月30日 23:11:17
OpenHarmony的多内核2022年05月30日 23:18:14
Python快速学习06:词典2022年06月01日 23:19:38