Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
T
tarantool
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
core
tarantool
Commits
b979ada2
Commit
b979ada2
authored
13 years ago
by
Dmitry Simonenko
Browse files
Options
Downloads
Patches
Plain Diff
tarantool_topology.sh: additional review fixes
parent
478fca03
Loading
Loading
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
extra/tarantool_topology.sh
+20
-23
20 additions, 23 deletions
extra/tarantool_topology.sh
with
20 additions
and
23 deletions
extra/tarantool_topology.sh
+
20
−
23
View file @
b979ada2
...
...
@@ -12,14 +12,15 @@ topology_cfg="${prefix}/etc/tarantool_topology.cfg"
topology_exists
=
0
topology_count
=
0
prompt
=
1
name
=
`
basename
$0
`
error
()
{
echo
"error:
$*
"
1>&2
echo
"
$name
error:
$*
"
1>&2
exit
1
}
log
()
{
echo
">
$*
"
echo
"
$name
>
$*
"
}
toolchain_check
()
{
...
...
@@ -71,11 +72,10 @@ deploy_instance() {
workdir
=
"
${
prefix_var
}
/tarantool
$id
"
config
=
"
${
prefix
}
/etc/tarantool
$id
.cfg"
log
"
>
deploying instance
$id
"
log
"deploying instance
$id
"
# setting up work environment
mkdir
$workdir
mkdir
$workdir
/logs
mkdir
-p
$workdir
/logs
chown
tarantool:tarantool
-R
$workdir
...
...
@@ -108,18 +108,6 @@ update() {
echo
$topology_count
>
$topology_cfg
}
toolchain_check
"date"
"expr"
if
[
-f
$topology_cfg
]
;
then
topology_exists
=
1
topology_count
=
`
cat
$topology_cfg
`
# dont' change topology if it said so in configuration file
if
[
$topology_count
-eq
0
]
;
then
log
"skipping topology setup"
exit
0
fi
fi
# processing command line arguments
#
num
=
0
...
...
@@ -138,15 +126,22 @@ fi
# validating instance number
#
isnum
=
0
if
[
$num
-eq
$num
2> /dev/null
]
;
then
isnum
=
1
fi
if
[
$isnum
-eq
0
]
||
[
$num
-eq
0 2> /dev/null
]
;
then
error
"bad instance number"
[
$num
-eq
$num
-o
$num
-le
0
]
2>/dev/null
||
error
"bad instance number"
if
[
-f
$topology_cfg
]
;
then
topology_exists
=
1
topology_count
=
`
cat
$topology_cfg
`
# dont' change topology if it said so in configuration file
if
[
$topology_count
-eq
0
]
;
then
log
"skipping topology setup"
exit
0
fi
fi
toolchain_check
"date"
"expr"
# time-stamp
#
ts
=
`
/bin/date +
"%Y%m%d-%H%M%S"
`
# asking permission to continue
...
...
@@ -168,6 +163,7 @@ if [ $prompt -eq 1 ]; then
fi
# stop on error
#
set
-e
if
[
$topology_exists
-eq
1
]
;
then
...
...
@@ -175,6 +171,7 @@ if [ $topology_exists -eq 1 ]; then
fi
# updating instances count
#
topology_count
=
$num
deploy
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment