q - text-as-data的介绍点击:
我主要用他来分析日志,公司跑hive的机器glibc版本很低,无法作者打好的bin直接跑。
今天主要做了几件事情:
(1)安装open-ssl
wget https://www.openssl.org/source/openssl-1.1.1c.tar.gz --no-check-certificate
tar zxvf openssl-1.1.1c.tar.gz
cd openssl-1.1.1c
./config --openssldir=/home/xxx/local/openssl --prefix=/home/xxx/local/openssl
make && make install
编辑 ~/.bashrc 将ssl 安装目录放入系统默认的运行和链接搜索目录:
(2)安装sqllite. -- q是先将文本转成sqllite数据库,再查询的。
wget https://www.sqlite.org/2020/sqlite-autoconf-3320300.tar.gz
wget https://www.sqlite.org/2020/sqlite-autoconf-3320300.tar.gz --no-check-certificate
tar xzvf sqlite-autoconf-3320300.tar.gz
cd sqlite-autoconf-3320300
./configure --prefix=/home/xxx/local/sqllite3♡
编辑.bashrc添加以下一行
export LD_LIBRARY_PATH=/home/xxx/local/sqllite3/lib:$LD_LIBRARY_PATH
(3) 安装Python3
wget https://www.python.org/ftp/python/3.7.12/Python-3.7.12.tgz --no-check-certificate
tar -xvzf Python-3.7.12.tgz
指定sqllite的头文件地址:编辑Python-3.7.12中的setup.py,在sqlite_inc_paths中加入/home/xxx/local/sqllite3/include
./configure --prefix=/home/xxx/local/python3.7/ --with-openssl=/home/xxx/local/openssl/
make -j24 install
export PATH=/home/xxx/local/python3.7/bin:$PATH
(4)添加alias
wget https://codeload.github.com/harelba/q/tar.gz/refs/tags/v3.1.6
mv q-3.1.6 q-3.1.6.tar.gz
tar -xvf q-3.1.6.tar.gz
安装依赖
cd q-3.1.6
pip3 install -r requirements.txt
编辑.bashrc添加 alias q='python3 q.py -Creadwrite'
然后就可以愉快了在cache模式下玩耍了。
收获一:没root权限,但自己想用新版本的lib库的时候,可以安装到自己home目录,然后在.bashrc中将其加入searchPath,也不影响别人。
收获二:对为啥root权限发放谨慎有了理解,真的可能有人在老机器上升级glibc把机器玩崩溃的。
收货三:对程序的链接有了新的认识,
export LD_LIBRARY_PATH=/home/xxx/local/openssl/lib/:$LD_LIBRARY_PATH
上面这行配置为例:不添加这行,pip install 会报错:WARNING: pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.
pip在拉取远程依赖的时候,需要动态链接到ssl的lib库。然而我们的ssl lib安装到了home目录。而系统默认的搜索路径通常是/usr/lib这样的。所以无法正确的链接。因此需要设置搜索目录,这样pip在动态链接ssl里面lib的时候,知道从哪儿找到正确的so文件。



