revision-id: 283c806ee63fb19e7c3a895181dd54152db83862 () parent(s): de028bfaf6f7e27374f8a298b4e5fbf0012ed5d7 author: Sergei Petrunia committer: Sergei Petrunia timestamp: 2019-03-07 21:26:38 +0300 message: Scripts to setup servers --- .gitignore | 3 ++ setup-server/setup-fbmysql-clone.sh | 68 +++++++++++++++++++++++++++++++++++ setup-server/setup-os-ubuntu.sh | 21 +++++++++++ setup-server/setup-sysbench-ubuntu.sh | 5 +++ setup.sh | 7 ++++ 5 files changed, 104 insertions(+) diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..9e086cc --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +data-fbmysql-range-locking +mysql-5.6-orig +mysql-5.6-range-locking diff --git a/setup-server/setup-fbmysql-clone.sh b/setup-server/setup-fbmysql-clone.sh new file mode 100755 index 0000000..815c7bd --- /dev/null +++ b/setup-server/setup-fbmysql-clone.sh @@ -0,0 +1,68 @@ +set -e + +# Usage: name [revno] +name=$1 +branch=$2 +revno=$3 + +if [ "x${name}y" = "xy" ] ; then + echo "usage: $0 name branch [revno]" +fi + +# range-locking-fb-mysql-5.6.35 +if [ "x${branch}y" = "xy" ] ; then + echo "usage: $0 name branch [revno]" +fi + +DATADIR=`pwd`/data-fbmysql-$name +BASEDIR=`pwd`/mysql-5.6-name + +#git clone --branch $branch --depth 1 https://github.com/spetrunia/mysql-5.6.git mysql-5.6-$name +git clone --branch $branch --single-branch https://github.com/spetrunia/mysql-5.6.git mysql-5.6-$name +cd mysql-5.6-$name + +if [ "x${revno}y" != "xy" ] ; then + git reset --hard $revno +fi + +git submodule init +git submodule update +cmake . -DCMAKE_BUILD_TYPE=RelWithDebInfo -DWITH_SSL=system \ + -DWITH_ZLIB=bundled -DMYSQL_MAINTAINER_MODE=0 -DENABLED_LOCAL_INFILE=1 \ + -DENABLE_DTRACE=0 -DCMAKE_CXX_FLAGS="-march=native" +make -j8 + +cd mysql-test +./mtr alias +cp -r var/install.db $DATADIR +cd ../.. + +cat > my-fbmysql-$name.cnf << EOF +[mysqld] + +datadir=$DATADIR + +default-storage-engine=rocksdb +skip-innodb +default-tmp-storage-engine=MyISAM +rocksdb + +#debug +log-bin=pslp +binlog-format=row + +tmpdir=/tmp +port=3306 +socket=/tmp/mysql.sock +gdb + +language=$BASEDIR/share/english +server-id=12 + +# rocksdb_use_range_locking=1 +EOF + +echo "$BASEDIR/sql/mysqld --defaults-file=`pwd`/my-fbmysql-$name.cnf" + +#(cd ./mysql-5.6/sql; ./mysqld --defaults-file=../../my-fbmysql.cnf & ) + diff --git a/setup-server/setup-os-ubuntu.sh b/setup-server/setup-os-ubuntu.sh new file mode 100755 index 0000000..70c57ad --- /dev/null +++ b/setup-server/setup-os-ubuntu.sh @@ -0,0 +1,21 @@ +#!/bin/bash + +if [ -e /etc/debian_version ] ; then + sudo apt-get update + sudo apt-get -y install g++ cmake libbz2-dev libaio-dev bison zlib1g-dev libsnappy-dev libboost-all-dev + sudo apt-get -y install libgflags-dev libreadline6-dev libncurses5-dev liblz4-dev gdb git libzstd-dev + + sudo apt-get -y install libzstd0 + sudo apt-get -y install libssl-dev + +# percona server: + sudo apt-get -y install libcurl4-gnutls-dev + + sudo apt-get -y install sysstat + + sudo ln -s /usr/lib/x86_64-linux-gnu/libz.so /usr/lib/libz.so + sudo sh -c "echo 0 > /proc/sys/kernel/yama/ptrace_scope" + +# Need unzip to unpack TPC-DS generator + sudo apt-get -y install unzip +fi diff --git a/setup-server/setup-sysbench-ubuntu.sh b/setup-server/setup-sysbench-ubuntu.sh new file mode 100755 index 0000000..5af9a9a --- /dev/null +++ b/setup-server/setup-sysbench-ubuntu.sh @@ -0,0 +1,5 @@ +#!/bin/bash + +curl -s https://packagecloud.io/install/repositories/akopytov/sysbench/script.deb.sh | sudo bash +sudo apt-get -y install sysbench + diff --git a/setup.sh b/setup.sh new file mode 100644 index 0000000..073cf37 --- /dev/null +++ b/setup.sh @@ -0,0 +1,7 @@ +#!/bin/bash + + +./setup-server/setup-fbmysql-clone.sh range-locking range-locking-fb-mysql-5.6.35 +./setup-server/setup-fbmysql-clone.sh orig fb-mysql-5.6.35-rebase1-source + +