Skip to content

Commit dc8e68f

Browse files
authored
Merge pull request #15 from ClickHouse/victoria-lifecycle
Fix misuse of installation script as cleanup script
2 parents 109fc5a + ede80ee commit dc8e68f

File tree

4 files changed

+19
-23
lines changed

4 files changed

+19
-23
lines changed

victorialogs/drop_tables.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/bin/bash
2+
3+
echo "Stopping VictoriaLogs"
4+
pidof victoria-logs-prod && kill `pidof victoria-logs-prod`
5+
6+
echo "Dropping all data"
7+
rm -rf victoria-logs-data

victorialogs/install.sh

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2,26 +2,5 @@
22

33
RELEASE_VERSION=v1.10.1-victorialogs
44

5-
# stop the existing victorialogs instance if any and drop its data
6-
while true
7-
do
8-
pidof victoria-logs-prod && kill `pidof victoria-logs-prod` || break
9-
sleep 1
10-
done
11-
rm -rf victoria-logs-data
12-
13-
# download victorialogs
145
wget -N https://github.com/VictoriaMetrics/VictoriaMetrics/releases/download/${RELEASE_VERSION}/victoria-logs-linux-amd64-${RELEASE_VERSION}.tar.gz
156
tar xzf victoria-logs-linux-amd64-${RELEASE_VERSION}.tar.gz
16-
echo "Downloaded victorialogs."
17-
18-
# start victorialogs
19-
./victoria-logs-prod -loggerOutput=stdout -retentionPeriod=20y -search.maxQueryDuration=5m > server.log &
20-
21-
while true
22-
do
23-
curl -s --fail http://localhost:9428/select/logsql/query -d 'query=_time:2100-01-01Z' && break
24-
sleep 1
25-
done
26-
27-
echo "Started victorialogs."

victorialogs/main.sh

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,12 @@ echo "4) 1000m"
2727
echo "5) all"
2828
read -p "Enter the number corresponding to your choice: " choice
2929

30+
./install.sh
31+
3032
benchmark() {
3133
local size=$1
3234

33-
# install is needed here in order to drop the previously ingested data
34-
./install.sh
35+
./start.sh
3536

3637
./load_data.sh "$DATA_DIRECTORY" "$size" "$SUCCESS_LOG" "$ERROR_LOG"
3738

@@ -44,6 +45,8 @@ benchmark() {
4445
./count.sh | tee "${OUTPUT_PREFIX}_bluesky_${size}m.count"
4546
#./query_results.sh | tee "${OUTPUT_PREFIX}_bluesky_${size}m.query_results"
4647
./run_queries.sh | tee "${OUTPUT_PREFIX}_bluesky_${size}m.results_runtime"
48+
49+
./drop_tables.sh # also stops VictoriaLogs
4750
}
4851

4952
case $choice in

victorialogs/start.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/bin/bash
2+
3+
# Do we run already?
4+
pidof victoria-logs-prod >/dev/null && exit 1
5+
6+
echo "Starting VictoriaLogs"
7+
./victoria-logs-prod -loggerOutput=stdout -retentionPeriod=20y -search.maxQueryDuration=5m > server.log &

0 commit comments

Comments
 (0)