Clickhouse源码编译环境配置
clang 配置
wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-vault-8.5.2111.repo
cd /etc/yum.repos.d
4 ll
5 rm -rf CentOS-Linux-*
6 ll
7 yum clean all
8 yum makecache
9 yum install clang
10 reboot
ios:
-DCMAKE_C_COMPILER=
(
b
r
e
w
−
−
p
r
e
f
i
x
l
l
v
m
)
/
b
i
n
/
c
l
a
n
g
−
D
C
M
A
K
E
C
X
X
C
O
M
P
I
L
E
R
=
(brew --prefix llvm)/bin/clang -DCMAKE_CXX_COMPILER=
(brew−−prefixllvm)/bin/clang−DCMAKECXXCOMPILER=(brew --prefix llvm)/bin/clang++
linux:
在编辑工具中(clion)
File-settings-CMake中 配置上: -DCMAKE_C_COMPILER=/usr/bin/clang -DCMAKE_CXX_COMPILER=/usr/bin/clang++
编译通过后
Clion 的编译参数配置中增加 server 参数;执行programs main.cpp main方法时,自动执行 ./clickhouse server 命令
查看Clickhouse 命令,直接使用 ./clickhouse 命令查看
启动服务端 命令:
./clickhouse server
启动客户端命令
./clickhouse client
centos7 致命错误解决:curl/curl.h:没有那个文件或目录 #include “curl/curl.h”
yum -y install curl-devel
sudo yum install cmake
git clone https://github.com/open-source-parsers/jsoncpp.git
cd jsoncpp
mkdir -p build/debug
cd build/debug
cmake -DCMAKE_BUILD_TYPE=debug -DJSONCPP_LIB_BUILD_SHARED=OFF -G “Unix Makefiles” …/…/
make
sudo make install
ldconfig
遇到错误:
fatal: 无法访问 https://github.com/ :Failed to connect to github.com port 443: 拒绝连接的解决办法
;
解决办法:在终端输入 sudo gedit /etc/hosts ,打开/etc/hosts文件,然后注释掉所有只涉及到github.com的行(注意是 只有github.com ,有任何别的都不可以)即可解决。
删除内容:
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
解决不存在 json.h 问题
sudo yum install jsoncpp-devel
解决 未找到匹配的参数: jsoncpp-devel问题
yum install epel-release
Centos8下ssh -T git@github.com提示Broken pipe错误
vim /etc/ssh/ssh_config
Host *
IPQoS=throughput
systemctl restart sshd
操作替换clickhouse文件
ssh root@10.216.26.51
密码 ziroom
cd /usr/bin
mv clickhouse clickhouse_back
exit cd /home/clickhouse/Clickhouse/cmake-build-release/program
ls | grep clickhouse
scp clickhouse root@10.216.26.51:/usr/bin
ClickHouse自定义函数研发总结
(1)配置文件中可配置用户名密码:优先采用 config.xml中的配置;其次采用user.xml中的配置;
(2)C++中的容器用法是关键