Yashan Health Check is a lightweight database health check tool, which can perform in-depth checks on Yashan database and the server where it is located, and give professional suggestions based on the actual situation.
- Database health checks
- The actual alerting policy
- Professional handling advice
- Custom checks
- Reports in multiple formats
// TODO: yhc-pdf
TOOL | VERSION |
---|---|
go | go 1.19 |
python | python3 |
make | v3+ |
gcc | v7+ |
# example for x86_64
cd ~
# x86_64
wget https://dl.google.com/go/go1.19.7.linux-amd64.tar.gz
# aarch64
# wget https://dl.google.com/go/go1.19.7.linux-arm64.tar.gz
tar -xzvf go1.19.7.linux-amd64.tar.gz
mkdir golang
mv go golang/
vim ~/.golang.env
<insert>
export GOROOT=${HOME}/golang/go
export GOPATH=${HOME}/golang/src
export GO111MODULE=on
export GOPROXY=https://goproxy.cn,direct
export PATH=$PATH:${GOROOT}/bin:${GOPATH}/bin
<wq>
vim ~/.bashrc
<insert>
source ~/.golang.env
<wq>
source ~/.bashrc
# example for centos 7
yum install -y python3
# example for centos 7 x86_64
yum install -y make.x86_64
# example for centos 7 x86_64
yum install -y centos-release-scl
yum install -y devtoolset-7-gcc.x86_64
yum install -y devtoolset-7-gcc-c++.x86_64
# set env
vim ~/.bashrc
<insert>
source /opt/rh/devtoolset-7/enable
<wq>
TOOL | VERSION |
---|---|
golangci-lint | v1.53.2 |
goimports-reviser | v3.4.1 |
yapf | 0.32.0 |
mypy | 0.950 |
shellcheck | 0.3.8 |
# use script for installation
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh |\
sh -s -- -b $(go env GOPATH)/bin v1.53.2
# or use package for installation
# Releases: https://github.com/golangci/golangci-lint/releases/tag/v1.53.2
# Available Resource: wget http://192.168.8.236:8888/golang/golangci-lint-1.53.2-linux-amd64.tar.gz
# NOTE: such go install/go get installation aren't guaranteed to work. We recommend using binary installation.
go install -v github.com/incu6us/goimports-reviser/v3@v3.4.1
pip3 install yapf==0.32.0
pip3 install mypy==0.950
# example for centos 7
yum install -y epel-release
yum install -y ShellCheck-0.3.8-1.el7
TOOL | VERSION |
---|---|
gotestsum | v1.10.1 |
go-test-html-report | v1.1.0 |
junit2html | 30.1.3 |
go install gotest.tools/gotestsum@v1.10.1
go install github.com/Thatooine/go-test-html-report@v1.1.0
pip3 install junit2html==30.1.3
go env -w GOPRIVATE=git.yasdb.com
vim ~/.gitconfig
[url "git@git.yasdb.com:"]
insteadOf = https://git.yasdb.com/
There's a build.py
file located at the root directory of the project.
# clean compilation data
python3 build.py clean
# start compilation
python3 build.py build
# --skip-check build without checking code (default: False)
# --skip-test build without running unit test (default: False)
# -c, --clean clean before building (default: False)
# -f, --force clean before building, then build without checking code and running unit test (default: False)
# check code
python3 build.py check
# run unit test
python3 build.py test
cd yashan-health-check
export YHC_HOME=$(pwd)
export YHC_DEBUG_MODE=true
go run cmd/yhcctl/*.go
go run cmd/yhcd/*.go