Skip to content

Instantly share code, notes, and snippets.

@siddontang
Last active Mar 10, 2021
Embed
What would you like to do?
ROOT=$PWD/build
rm -rf $ROOT
mkdir -p $ROOT
cd $ROOT
# Go
if which go >/dev/null; then
echo "go installed, skip"
else
wget https://dl.google.com/go/go1.12.6.linux-arm64.tar.gz
sudo tar -C /usr/local -xzf go1.12.6.linux-arm64.tar.gz
echo 'export PATH=$PATH:/usr/local/go/bin' >> ~/.bashrc
source ~/.bashrc
fi
# Rust
if which rustc >/dev/null; then
echo "rust installed, skip"
else
curl https://sh.rustup.rs -sSf | sh -s -- -y
source $HOME/.cargo/env
fi
sudo yum install -y gcc gcc-c++ wget git zlib-devel
# Install cmake3
if which cmake3 >/dev/null; then
echo "cmake3 installed, skip"
else
wget http://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
sudo rpm -ivh epel-release-latest-7.noarch.rpm
sudo yum install -y epel-release
sudo yum install -y cmake3
sudo ln -s /usr/bin/cmake3 /usr/bin/cmake
fi
# # RocksDB gflags
# git clone https://github.com/gflags/gflags.git
# cd gflags
# git checkout v2.0
# ./configure --build=aarch64-unknown-linux-gnu && make && sudo make install
# cd $ROOT
git clone https://github.com/pingcap/pd.git
cd pd
make
cd $ROOT
git clone https://github.com/pingcap/tidb.git
cd tidb
make
cd $ROOT
git clone https://github.com/tikv/tikv.git
cd tikv
ROCKSDB_SYS_SSE=0 make release
cd $ROOT
@siddontang
Copy link
Author

siddontang commented Jun 18, 2019

Before run TiKV, should change max file limit.

add following to /etc/security/limits.conf, ec2-user is the account. Should re-login to make change work.

ec2-user         soft        nofile        1000000
ec2-user         hard        nofile        1000000

Loading

@siddontang
Copy link
Author

siddontang commented Jun 18, 2019

Seem there is a bug in the bash script, for 16c32g, it only changes rx-0, but we also need to change rx-1.

Because 16c32g has two network queues, one bind to CPU 0, the other to CPU 8, here we also need to avoid binding CPU 0 and 8 to RPS.

sudo sh -c 'echo fe > /sys/class/net/eth0/queues/rx-0/rps_cpus'

sudo sh -c 'echo fe00 > /sys/class/net/eth0/queues/rx-1/rps_cpus'

Loading

@WeiTangLau
Copy link

WeiTangLau commented Mar 10, 2021

Hi great script! May I know whether is this the updated way to run TiDB on arm64? Or is there an updated way? Thanks!

Loading

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment