4

时序数据库Influx-IOx源码学习二(环境搭建)

 3 years ago
source link: https://my.oschina.net/u/3374539/blog/5016798
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

欢迎关注微信公众号:atoildw (数据库技术研究)

上一篇介绍了InfluxDB IOx的一些项目背景及现有架构中存在的问题,详情见:https://my.oschina.net/u/3374539/blog/5015114

1.克隆仓库

git clone https://github.com/influxdata/influxdb_iox.git

2.安装基础语言依赖

根据readme文件中的的描述,项目依赖两个基础环境,分别是rustclang

rust是使用rustup来进行版本管理的。默认的情况下,会为你安装最后的stable版本,但是IOx项目为了使用不太稳定的SIMD特性,从而达到更高的性能,所以在rust-toolchain文件中指定了一个nightly的版本。

rust安装

curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

测试版本号:

rustc --version
rustc 1.51.0 (2fd73fabe 2021-03-23)

cd influxdb_iox
rustc --version
rustc 1.50.0-nightly (825637983 2020-11-18)

clang安装

安装clang是为了编译croaring这个依赖(RoaringBitmap,根据查询语句进行逐列查询的时候使用),安装脚本根据系统的不同。

xcode-select --install

clang --version
Apple clang version 12.0.0 (clang-1200.0.32.29)
Target: x86_64-apple-darwin20.3.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin

3.IDE搭建

我个人使用的goland,感觉相比于IDEA要速度更快一些。

4.导入工程

当全部完成后,你可以在IDE的右侧看到如下截图:

你也可以在命令行中执行:

cargo build

具体速度快慢就要看命了,网络至少需要访问github、crates.io

5.在IDE中启动

打开src/main.rs文件,然后右键-->Run. 在运行之后,在命令行里会提示一个错误,然后退出。原因是我们并没有输入系统可以识别的启动命令。

打开启动配置页面,在command中贴入,

run --package influxdb_iox --bin influxdb_iox run

然后就能看到程序启动成功的提示:

祝玩儿的开心!


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK