在CentOS7.4中通过源码的方式安装Requests时,报错信息如下:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# pip3 install .
Processing /data/setup/psf-requests-fab1fd1
ERROR: Command errored out with exit status 1:
command: /opt/Python-3.7.2/bin/python3.7 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-req-build-nuwyypgj/setup.py'"'"'; __file__='"'"'/tmp/pip-req-build-nuwyypgj/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base pip-egg-info
cwd: /tmp/pip-req-build-nuwyypgj/
Complete output (11 lines):
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/opt/Python-3.7.2/lib/python3.7/site-packages/setuptools/__init__.py", line 18, in <module>
from setuptools.dist import Distribution, Feature
File "/opt/Python-3.7.2/lib/python3.7/site-packages/setuptools/dist.py", line 31, in <module>
from setuptools import windows_support
File "/opt/Python-3.7.2/lib/python3.7/site-packages/setuptools/windows_support.py", line 2, in <module>
import ctypes
File "/opt/Python-3.7.2/lib/python3.7/ctypes/__init__.py", line 7, in <module>
from _ctypes import Union, Structure, Array
ImportError: libffi.so.5: cannot open shared object file: No such file or directory
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

其实在CentOS7.4下已经存在libffi.so.6,解决方法是创建软连接,如下:

阅读全文 »

no X development libraries were found

1
2
3
4
5
6
7
8
9
10
checking for X... no
checking for X... true
configure: error: You seem to be running X, but no X development libraries
were found. You should install the relevant development files for X
and for the toolkit you want, such as Gtk+ or Motif. Also make
sure you have development files for image handling, i.e.
tiff, gif, jpeg, png and xpm.
If you are sure you want Emacs compiled without X window support, pass
--without-x
to configure.

安装libgtk开发包:

阅读全文 »

今天在使用lftp的sftp时候一直处于connecting状态,并且没有其他提示信息。状态如下图所示:
lftp sftp

导致这个问题的原因是,在sftp第一次连接服务器的时候需要接收服务端服务器的fingerprint,这个过程需要用户通过输入进行确认,如下图所示。但是这些提示信息被lftp掩盖了,所以connecting状态其实是sftp一直在等待用户的输入。解决方法是先在命令行使用sftp连接一次服务器,然后再使用lftp。

Are you sure you want to continue connecting

阅读全文 »

在MR处理ORC的时候遇到如下异常:

1
2
3
4
5
6
7
8
9
10
11
Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 1024
at org.apache.orc.impl.RunLengthIntegerReaderV2.nextVector (RunLengthIntegerReaderV2.java:369)
at org.apache.orc.impl.TreeReaderFactory$BytesColumnVectorUtil.commonReadByteArrays (TreeReaderFactory.java:1231)
at org.apache.orc.impl.TreeReaderFactory$BytesColumnVectorUtil.readOrcByteArrays (TreeReaderFactory.java:1268)
at org.apache.orc.impl.TreeReaderFactory$StringDirectTreeReader.nextVector (TreeReaderFactory.java:1368)
at org.apache.orc.impl.TreeReaderFactory$StringTreeReader.nextVector (TreeReaderFactory.java:1212)
at org.apache.orc.impl.TreeReaderFactory$ListTreeReader.nextVector (TreeReaderFactory.java:1902)
at org.apache.orc.impl.TreeReaderFactory$StructTreeReader.nextBatch (TreeReaderFactory.java:1737)
at org.apache.orc.impl.RecordReaderImpl.nextBatch(RecordReaderImpl.java:1045)
at org.apache.hadoop.hive.ql.io.orc.RecordReaderImpl.ensureBatch(RecordReaderImpl.java:77)
at org.apache.hadoop.hive.ql.io.orc.RecordReaderImpl.hasNext(RecordReaderImpl.java:89)

通过搜索发现这个Bug在Hive 2.1.1版本中已经修复。我使用的就是这个版本,检查对应的源代码发现代码是已经按照下面的Patch修复过得:https://issues.apache.org/jira/browse/HIVE-14483

阅读全文 »

Nginx是不支持POST请求静态内容的,通过POST请求时出现以下错误:

1
2
3
4
5
6
7
8
# curl -d "a=b" "http://192.16.36.15:11013/upgrade"
<html>
<head><title>405 Not Allowed</title></head>
<body bgcolor="white">
<center><h1>405 Not Allowed</h1></center>
<hr><center>nginx/1.14.2</center>
</body>
</html>

解决方法是在Nginx配置中添加以下配置:

阅读全文 »

使用Rsyslog的omhttp模块可以将收集的日志数据以HTTP请求的方式输出。该模块支持单条/批量发送数据,支持GZIP压缩,支持HTTPS。

Rsyslog默认未包含omhttp模块,需要重新编译。编译过程参考我的另外两篇博文:

阅读全文 »

导出示例:

1
$ mongoexport --host 192.168.72.60 --db realtime_statistic_backup --collection all_play_stats_summary --fields "_id.timestamp,total_uv" --type csv --out uv.csv --sort "{'_id.timestamp': -1}" --query "{'_id.province_id':'sc','_id.city_id':'all', '_id.display_name': 'all'}"
  • 3.4.6版本后支持--uri方式连接MongoDB
  • --fields指定要导出的field,如果是嵌套的json,可以通过点(.)操作指定内层的field
阅读全文 »
0%