Skip to content

Commit

Permalink
Merge pull request #59 from pj8/docs/0507
Browse files Browse the repository at this point in the history
Sleep 1s on mongodb start and stop
  • Loading branch information
yuki777 authored May 7, 2023
2 parents e8faab9 + 98f3975 commit 40f90b6
Show file tree
Hide file tree
Showing 9 changed files with 19 additions and 13 deletions.
20 changes: 14 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ git clone https://github.com/pj8/dbdb.git
cd dbdb
```

<details><summary>MySQL</summary><div>

## MySQL

### Manage MySQL Server on localhost
Expand Down Expand Up @@ -53,7 +55,9 @@ cd dbdb
- 8.0.23
- 8.0.30

---
</div></details>

<details><summary>PostgreSQL</summary><div>

## PostgreSQL

Expand All @@ -79,7 +83,9 @@ cd dbdb
- 12.6
- 13.2

---
</div></details>

<details><summary>Redis</summary><div>

## Redis

Expand All @@ -105,7 +111,9 @@ cd dbdb
- 6.0.16
- 6.2.6

---
</div></details>

<details><summary>MongoDB</summary><div>

## MongoDB

Expand All @@ -130,7 +138,7 @@ cd dbdb
- 4.4.10
- 5.0.3

---
</div></details>

## Tips

Expand All @@ -149,7 +157,7 @@ cd dbdb
### Start by creating the database server if it does not exist.

```
# Try create, then start server.
# Create and start
/path/to/dbdb/mysql/create-start.sh mysql5-foo 5.7.31 3306
```

Expand All @@ -172,6 +180,6 @@ cd dbdb
# Start mysql8 with port 13306
@reboot /path/to/dbdb/mysql/start.sh mysql8-bar
# Try create, then start the server
# Create and start
@reboot /path/to/dbdb/redis/create-start.sh redis1 6.0.10 6379
```
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v2.0.0
v2.0.1
1 change: 0 additions & 1 deletion mongodb/delete.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ installDir=$(getInstallDir $(getType))
dir=$installDir/versions/$optVersion

./stop.sh -f "$format" $optName $optVersion $optPort > /dev/null
sleep 1

set -eu
exitIfNotExistDir $dir/datadir/$optName
Expand Down
2 changes: 0 additions & 2 deletions mongodb/restart.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,5 @@ currentDir="$(
cd $currentDir

./stop.sh -f "$format" $1 > /dev/null
sleep 1

set -eu
./start.sh -f "$format" $1
2 changes: 2 additions & 0 deletions mongodb/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ $dir/basedir/bin/mongod \
--fork 1>&2
echo $optPort > $dir/datadir/$optName/mongodb.port

sleep 1

normalOutputs=""
normalOutputs="${normalOutputs}MongoDB Successfully started. $optName $optVersion $optPort\n"
normalOutputs="${normalOutputs}Your config file is located $dir/datadir/$optName/mongodb.conf"
Expand Down
2 changes: 2 additions & 0 deletions mongodb/stop.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ exitIfNotRunningPort $optPort
[ -f "$dir/datadir/$optName/mongodb.port" ] && cp $dir/datadir/$optName/mongodb.port $dir/datadir/$optName/mongodb.port.last
[ -f "$dir/datadir/$optName/mongodb.port" ] && rm -f $dir/datadir/$optName/mongodb.port

sleep 1

normalOutputs=""
normalOutputs="${normalOutputs}MongoDB Successfully stopped. $optName $optVersion $optPort"

Expand Down
1 change: 0 additions & 1 deletion mysql/restart.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,5 @@ currentDir="$(
cd $currentDir

./stop.sh -f "$format" $1 > /dev/null

set -eu
./start.sh -f "$format" $1
1 change: 0 additions & 1 deletion postgresql/restart.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,5 @@ currentDir="$(
cd $currentDir

./stop.sh -f "$format" $1 > /dev/null

set -eu
./start.sh -f "$format" $1
1 change: 0 additions & 1 deletion redis/restart.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,5 @@ currentDir="$(
cd $currentDir

./stop.sh -f "$format" $1 > /dev/null

set -eu
./start.sh -f "$format" $1

0 comments on commit 40f90b6

Please sign in to comment.