aboutsummaryrefslogtreecommitdiffstats
path: root/docker
diff options
context:
space:
mode:
authorfujinhua <fu.jinhua@zte.com.cn>2017-09-05 14:00:37 +0800
committerfujinhua <fu.jinhua@zte.com.cn>2017-09-05 14:10:37 +0800
commit880272dbf48594791a2d93e74f0ffab896c49cdd (patch)
treedce581edb7ac6c5df429bc7447043d586c13813d /docker
parentb18660b3019f22ec49e5e9fde701e9b8d8a0691a (diff)
Fix docker ENTRYPOINT script
Fix wait msb retry num to 5 Fix mysql listen ip address Change-Id: Ia1492e4cb1b44e61ca7abe990828dcc72dc42ca4 Issue-Id: VFC-277 Signed-off-by: fujinhua <fu.jinhua@zte.com.cn>
Diffstat (limited to 'docker')
-rwxr-xr-xdocker/docker-entrypoint.sh2
-rwxr-xr-xdocker/instance_config.sh2
-rwxr-xr-xdocker/instance_init.sh10
3 files changed, 5 insertions, 9 deletions
diff --git a/docker/docker-entrypoint.sh b/docker/docker-entrypoint.sh
index 16738ac6..3a309f7d 100755
--- a/docker/docker-entrypoint.sh
+++ b/docker/docker-entrypoint.sh
@@ -18,7 +18,7 @@ echo "MSB_ADDR=$MSB_ADDR"
# Wait for MSB initialization
echo "Wait for MSB initialization"
-for i in {1..20}; do
+for i in {1..5}; do
curl -sS -m 1 $MSB_ADDR > /dev/null && break
sleep $i
done
diff --git a/docker/instance_config.sh b/docker/instance_config.sh
index 1fc5edaa..06e0d027 100755
--- a/docker/instance_config.sh
+++ b/docker/instance_config.sh
@@ -31,7 +31,7 @@ sed -i "s|DB_PASSWD.*|DB_PASSWD = 'vfcnfvolcm'|" vfc/nfvo/lcm/lcm/pub/config/con
# Configure MYSQL
if [ -z "$MYSQL_ADDR" ]; then
- export MYSQL_IP=127.0.0.1
+ export MYSQL_IP=`hostname -i`
export MYSQL_PORT=3306
export MYSQL_ADDR=$MYSQL_IP:$MYSQL_PORT
else
diff --git a/docker/instance_init.sh b/docker/instance_init.sh
index f758a71b..f5a50547 100755
--- a/docker/instance_init.sh
+++ b/docker/instance_init.sh
@@ -10,13 +10,9 @@ function start_redis_server {
}
function start_mysql {
- su mysql -c /usr/bin/mysqld_safe &
- service mysql start
- # Wait for mysql to initialize; Set mysql root password
- for i in {1..10}; do
- sleep $i
- bash /usr/bin/mysqladmin -u root password $MYSQL_ROOT_PASSWORD &> /dev/null && break
- done
+ sed -i "s|bind-address.*|# bind-address = 127.0.0.1|" /etc/mysql/my.cnf
+ service mysql restart
+ sleep 1
}
function create_database {