[ja] use $HOSTNAME env variable instead of hostname command
parent
e2a139c1fa
commit
914f9aeabf
|
@ -22,7 +22,7 @@ spec:
|
|||
- |
|
||||
set -ex
|
||||
# Generate mysql server-id from pod ordinal index.
|
||||
[[ `hostname` =~ -([0-9]+)$ ]] || exit 1
|
||||
[[ $HOSTNAME =~ -([0-9]+)$ ]] || exit 1
|
||||
ordinal=${BASH_REMATCH[1]}
|
||||
echo [mysqld] > /mnt/conf.d/server-id.cnf
|
||||
# Add an offset to avoid reserved server-id=0 value.
|
||||
|
|
Loading…
Reference in New Issue