Skip to content

Commit 5300a09

Browse files
authored
Merge pull request #21 from redhat-performance/log_disk
Log disk
2 parents 9a355bc + 4959daf commit 5300a09

File tree

6 files changed

+54
-9
lines changed

6 files changed

+54
-9
lines changed

README.md

100644100755
File mode changed.

gpl_license

100644100755
File mode changed.

hammerdb/hammerdb

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
2020

2121
arguments="$@"
22+
log_mount=""
2223

2324
curdir=`pwd`
2425
if [[ $0 == "./"* ]]; then
@@ -51,6 +52,7 @@ test_name="hammerdb"
5152
setenforce 0
5253
tuned_original=""
5354
disks=none
55+
log_disks=""
5456
user=""
5557
fs="xfs"
5658
tools_git=https://github.com/redhat-performance/test_tools-wrappers
@@ -166,9 +168,25 @@ create_and_mount_fs()
166168
mkdir /perf1
167169
$TOOLS_BIN/create_filesystem --fs_type $fs --mount_dir /perf1 --device /dev/hammerdb/hammerdb
168170
if [ $? -ne 0 ]; then
169-
echo filesystem create failedd.
171+
echo filesystem create failed.
170172
exit 1
171173
fi
174+
175+
if [[ $log_disks != "" ]]; then
176+
log_disks=`echo $log_disks | sed "s/,/ /g"`
177+
umount /perf2
178+
mkdir /perf2
179+
$TOOLS_BIN/lvm_create --devices "${log_disks}" --lvm_vol log_hammerdb --lvm_grp log_hammerdb --wipefs
180+
if [ $? -ne 0 ]; then
181+
echo LVM create of log disk failed.
182+
exit 1
183+
fi
184+
$TOOLS_BIN/create_filesystem --fs_type $fs --mount_dir /perf2 --device /dev/log_hammerdb/log_hammerdb
185+
if [ $? -ne 0 ]; then
186+
echo filesystem create for log failed.
187+
exit 1
188+
fi
189+
fi
172190
}
173191

174192
#
@@ -179,6 +197,7 @@ ARGUMENT_LIST=(
179197
"filesys"
180198
"home_parent"
181199
"iterations"
200+
"log_disks"
182201
"run_user"
183202
"sub_test"
184203
"tools_git"
@@ -220,6 +239,11 @@ while [[ $# -gt 0 ]]; do
220239
iterations=${2}
221240
shift 2
222241
;;
242+
--log_disks)
243+
log_mount="-M /perf2"
244+
log_disks=${2}
245+
shift 2
246+
;;
223247
--users)
224248
setto=`echo $2 | sed "s/,/ /g"`
225249
users_to_run="-u \"${setto}\""
@@ -270,7 +294,7 @@ if [[ $to_tuned_setting != "none" ]]; then
270294
tuned-adm profile $to_tuned_setting
271295
fi
272296
cd $exec_dir
273-
echo ./run_hammerdb -m /perf1 -t ${test} ${users_to_run} ${warehouses} > run_this
297+
echo ./run_hammerdb -m /perf1 -t ${test} ${users_to_run} ${warehouses} ${log_mount} > run_this
274298
chmod 755 run_this
275299
./run_this
276300

hammerdb/install-script

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
disks=none
2424
mountpoint=none
2525
db_type=none
26+
log_mount_point="none"
2627

2728
install_mssql()
2829
{
@@ -97,9 +98,12 @@ install_mariadb()
9798
#
9899
# Clean up any residual stuff and set up the directories
99100
#
100-
rm -rf ${mountpoint}/mysql/*
101+
rm -rf ${mountpoint}/mysql/* ${log_mount_point}/mysql/log
101102
mkdir -p ${mountpoint}/mysql/data
102103
chown -R mysql:mysql ${mountpoint}/mysql
104+
mkdir -p ${log_mount_point}/mysql/log
105+
chown -R mysql:mysql ${log_mount_point}/mysql
106+
103107

104108
totmem=`cat /proc/meminfo | grep "MemTotal:" | awk '{print $2}'`
105109
#
@@ -119,15 +123,15 @@ install_mariadb()
119123
else
120124
sed -i "s/^innodb_buffer_pool_size=.*/innodb_buffer_pool_size=64000M/" my.cnf
121125
fi
126+
sed -i "/innodb_file_per_table/a innodb_log_group_home_dir = ${log_mount_point}\/mysql\/log" my.cnf
122127

123128
/usr/bin/cp my.cnf /etc/my.cnf
124129

125130
systemctl restart mariadb.service
126131

127132
#echo "UPDATE mysql.user SET Password=PASSWORD('100yard-') WHERE User='root';" > input
128133
#echo "GRANT ALL ON *.* to root@'%' IDENTIFIED BY '100yard-';" >> input
129-
echo "use mysql;" > input
130-
echo "SET PASSWORD FOR 'root'@localhost = PASSWORD('mysql');" > input
134+
echo "SET PASSWORD FOR 'root'@localhost = PASSWORD('mysql');" > input
131135
echo "flush privileges;" >> input
132136
echo "exit" >> input
133137

@@ -154,8 +158,13 @@ install_postgres()
154158
ln -sf ${mountpoint}/postgres_data /var/lib/pgsql/data
155159
chmod 700 ${mountpoint}/postgres_data
156160
chown -R postgres:postgres ${mountpoint}/postgres_data
161+
mkdir -p ${log_mount_point}/postgres_log
162+
chown -R mysql:mysql ${log_mount_point}/postgres_log
157163

158164
postgresql-setup initdb
165+
sleep 10
166+
mv /var/lib/pgsql/data/pg_wal ${log_mount_point}/postgres_log
167+
ln -sf ${log_mount_point}/postgres_log/pg_wal /var/lib/pgsql/data/pg_wal
159168

160169
totmem=`cat /proc/meminfo |grep "MemTotal:" | awk '{print $2}'`
161170

@@ -220,6 +229,10 @@ do
220229
disks=$2
221230
shift 2
222231
;;
232+
-M)
233+
log_mount_point=$2
234+
shift 2
235+
;;
223236
-m)
224237
mountpoint=$2
225238
shift 2
@@ -284,6 +297,9 @@ else
284297
echo ${mountpoint}
285298
fi
286299

300+
if [[ $log_mount_point == "none" ]]; then
301+
log_mount_point=${mountpoint}
302+
fi
287303
if [[ $db_type == "mssql" ]]; then
288304
install_mssql
289305
exit

hammerdb/run_hammerdb

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
# mssql.
2626
#
2727
mountpoint=none
28+
log_mount_point=""
2829
disklist=none
2930
whc=""
3031
#Usercount="10 20 40 80 100"
@@ -86,9 +87,9 @@ install_it()
8687
export disklist
8788
export mountpoint
8889
if [[ $mountpoint == *"none"* ]]; then
89-
ssh root@${hostnm} "./install-script -d ${disklist} -t $1" &
90+
ssh root@${hostnm} "./install-script -d ${disklist} -t $1 ${log_mount_point}" &
9091
else
91-
ssh root@${hostnm} "./install-script -m ${mountpoint} -t $1" &
92+
ssh root@${hostnm} "./install-script -m ${mountpoint} -t $1 ${log_mount_point}" &
9293
fi
9394
ctr=$((ctr + 1))
9495
done
@@ -104,9 +105,9 @@ install_it()
104105
# Local system
105106
#
106107
if [[ $mountpoint == *"none"* ]]; then
107-
./install-script -d ${disklist} -t $1
108+
./install-script -d ${disklist} -t $1 ${log_mount_point}
108109
else
109-
./install-script -m ${mountpoint} -t $1
110+
./install-script -m ${mountpoint} -t $1 ${log_mount_point}
110111
fi
111112
if [[ $2 != "none" ]]; then
112113
systemctl restart ${2}
@@ -438,6 +439,10 @@ do
438439
disklist=$2
439440
shift 2
440441
;;
442+
-M)
443+
log_mount_point="-M $2"
444+
shift 2
445+
;;
441446
-m)
442447
mountpoint=$2
443448
shift 2

license

100644100755
File mode changed.

0 commit comments

Comments
 (0)