Skip to content

Instantly share code, notes, and snippets.

@siddontang
Last active March 10, 2021 07:03
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save siddontang/3a35473437bc47ebf27e541ba7d41141 to your computer and use it in GitHub Desktop.
Save siddontang/3a35473437bc47ebf27e541ba7d41141 to your computer and use it in GitHub Desktop.
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

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'

@WeiTangLau
Copy link

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

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