CentOS6 x64 under Compile Tidb

Source: Internet
Author: User
Tags git clone

TIDB consists of three parts: TIDB (SQL parsing engine), TIKV (storage engine), PD (placement driver, which provides timestamp service and system topology maintenance). Where Tidb and PD were developed in Golang language, TIKV was developed in the rust language.

1. Configuring the compilation Environment

    • In order to improve the speed of downloading Yum packets from the extranet, we can first specify a domestic yum image:

# yum Install Epel-release

    • Installing Cmake3

# yum Install Cmake3

# ln-s/usr/bin/cmake3/usr/bin/cmake

    • Compiling and installing gcc-4.8.5
    • Install Golang language:

# yum Install Golang Golang-docs

    • Install the Rust language:

Https://www.rust-lang.org/en-US/other-installers.html

Find the nightly version of the platform (later compiled TIKV requires this version of Rust), replace the www.rust-lang.org in the URL with mirrors.ustc.edu.cn/rust-static, download the unzip and install:

# wget https://mirrors.ustc.edu.cn/rust-static/dist/rust-nightly-x86_64-unknown-linux-gnu.tar.gz && tar zxf Rust-nightly-x86_64-unknown-linux-gnu.tar.gz

# CD Rust-nightly-x86_64-unknown-linux-gnu &&./install.sh

    • Add to. Bash_profile:
export goroot=/usr/lib/golangexport GOBIN= $GOROOT/binexport goarch=Amd64export GOOS =linuxexport gopath=/home/xxx/goexport rustup_dist_server=https://  Mirrors.ustc.edu.cn/rust-staticExport Rustup_update_root=https://mirrors.ustc.edu.cn/ Rust-static/rustup# # # corresponds to GCC-4.8respectively. 5, rust-nightly, go path of the exportpath =/opt/xxx/bin:/usr/local/bin: $GOBIN: $GOPKG: $PATH

and import these environment variables:

# . ~/.bash_profile

    • Creating a source code compilation path

Note: This step is important and you must make sure that the Go src path is correct:

# mkdir-p $GOPATH/src/github.com/pingcap/pingcap

2. Compiling TIDB

# CD $GOPATH/src/github.com/pingcap/pingcap

# git clone https://github.com/pingcap/tidb.git && gmake

3. Compiling PD

# CD $GOPATH/src/github.com/pingcap/pingcap

# git clone https://github.com/pingcap/pd.git && gmake

4. Compiling tikv

Build TIKV requires rust nightly version, gcc-4.8.5 (other versions may encounter problems during compilation)

# CD $GOPATH/src/github.com/pingcap/pingcap

# git clone https://github.com/pingcap/tikv.git && cargo Build

CentOS6 x64 under Compile Tidb

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.