~percona-toolkit-dev/percona-toolkit/pt-stalk-iter-1-bug-1070434

« back to all changes in this revision

Viewing changes to sandbox/start-sandbox

  • Committer: Daniel Nichter
  • Date: 2012-10-16 15:13:19 UTC
  • Revision ID: daniel@percona.com-20121016151319-0wyqdpegxkk9e84h
Add 5.6 sandbox.  Fix start-sandbox so it doesn't s/PORT// in data files.  Add loading sys.sql for InnoDB tables in mysql db.

Show diffs side-by-side

added added

removed removed

Lines of Context:
34
34
   cp $PERCONA_TOOLKIT_BRANCH/sandbox/servers/$version/my.sandbox.cnf /tmp/$port
35
35
   tar xzf $PERCONA_TOOLKIT_BRANCH/sandbox/servers/$version/data.tar.gz -C /tmp/$port
36
36
 
 
37
   if [ -f $PERCONA_TOOLKIT_BRANCH/sandbox/servers/$version/sys.sql ]; then
 
38
      cp $PERCONA_TOOLKIT_BRANCH/sandbox/servers/$version/sys.sql /tmp/$port
 
39
   fi
 
40
 
37
41
   for script in `ls $PERCONA_TOOLKIT_BRANCH/sandbox/servers/*`; do
38
42
      if [ -f $script ]; then
39
43
        cp $script /tmp/$port
40
44
      fi
41
45
   done
42
46
 
43
 
   for file in `grep -rl PORT /tmp/$port`; do
 
47
   for file in `grep -l PORT /tmp/$port/*`; do
44
48
      sed -e "s/PORT/$port/g" -i.bak $file
45
49
      # Use ! instead of / because the replacment has / (it's a directory)
46
50
      sed -e "s!PERCONA_TOOLKIT_SANDBOX!$PERCONA_TOOLKIT_SANDBOX!g" -i.bak $file
96
100
      exit 1
97
101
   fi
98
102
 
 
103
   if [ -f "/tmp/$port/sys.sql" ]; then
 
104
      /tmp/$port/use < /tmp/$port/sys.sql
 
105
   fi
 
106
 
99
107
   # If the sandbox is a slave, start the slave.
100
108
   if [ "$type" = "slave" ]; then
101
109
      /tmp/$port/use -e "change master to master_host='127.0.0.1', master_user='msandbox', master_password='msandbox', master_port=$master_port"