mirror of
https://github.com/percona/percona-toolkit.git
synced 2025-09-20 02:44:58 +00:00
PMM-8575 migrate toolkit to modules (#512)
* PMM-8575 Fixed test Fixed sandbox used by go programs, updated all tests. * PMM-8575 Fixed test Fixed sandbox used by go programs, updated all tests. * Removed Gopkg * Switched to go 1.16 * Updated go.mod * Upgraded deps * Updated deps
This commit is contained in:
0
src/go/docker/Dockerfile.common
Normal file → Executable file
0
src/go/docker/Dockerfile.common
Normal file → Executable file
0
src/go/docker/Dockerfile.release
Normal file → Executable file
0
src/go/docker/Dockerfile.release
Normal file → Executable file
32
src/go/docker/scripts/init-shard.sh
Executable file
32
src/go/docker/scripts/init-shard.sh
Executable file
@@ -0,0 +1,32 @@
|
||||
#!/bin/bash
|
||||
|
||||
mongodb1=`getent hosts ${MONGOS} | awk '{ print $1 }'`
|
||||
|
||||
mongodb11=`getent hosts ${MONGO11} | awk '{ print $1 }'`
|
||||
mongodb12=`getent hosts ${MONGO12} | awk '{ print $1 }'`
|
||||
mongodb13=`getent hosts ${MONGO13} | awk '{ print $1 }'`
|
||||
|
||||
mongodb21=`getent hosts ${MONGO21} | awk '{ print $1 }'`
|
||||
mongodb22=`getent hosts ${MONGO22} | awk '{ print $1 }'`
|
||||
mongodb23=`getent hosts ${MONGO23} | awk '{ print $1 }'`
|
||||
|
||||
mongodb31=`getent hosts ${MONGO31} | awk '{ print $1 }'`
|
||||
mongodb32=`getent hosts ${MONGO32} | awk '{ print $1 }'`
|
||||
mongodb33=`getent hosts ${MONGO33} | awk '{ print $1 }'`
|
||||
|
||||
port=${PORT:-27017}
|
||||
|
||||
echo "Waiting for startup.."
|
||||
until mongo --host ${mongodb1}:${port} --eval 'quit(db.runCommand({ ping: 1 }).ok ? 0 : 2)' &>/dev/null; do
|
||||
printf '.'
|
||||
sleep 1
|
||||
done
|
||||
|
||||
echo "Started.."
|
||||
|
||||
echo init-shard.sh time now: `date +"%T" `
|
||||
mongo --host ${mongodb1}:${port} <<EOF
|
||||
sh.addShard( "${RS1}/${mongodb11}:${PORT1},${mongodb12}:${PORT2},${mongodb13}:${PORT3}" );
|
||||
sh.addShard( "${RS2}/${mongodb21}:${PORT1},${mongodb22}:${PORT2},${mongodb23}:${PORT3}" );
|
||||
sh.status();
|
||||
EOF
|
40
src/go/docker/scripts/setup.sh
Executable file
40
src/go/docker/scripts/setup.sh
Executable file
@@ -0,0 +1,40 @@
|
||||
#!/bin/bash
|
||||
|
||||
mongodb1=`getent hosts ${MONGO1} | awk '{ print $1 }'`
|
||||
mongodb2=`getent hosts ${MONGO2} | awk '{ print $1 }'`
|
||||
mongodb3=`getent hosts ${MONGO3} | awk '{ print $1 }'`
|
||||
|
||||
port=${PORT:-27017}
|
||||
|
||||
echo "Waiting for startup.."
|
||||
until mongo --host ${mongodb1}:${port} --eval 'quit(db.runCommand({ ping: 1 }).ok ? 0 : 2)' &>/dev/null; do
|
||||
printf '.'
|
||||
sleep 1
|
||||
done
|
||||
|
||||
echo "Started.."
|
||||
|
||||
echo setup.sh time now: `date +"%T" `
|
||||
mongo --host ${mongodb1}:${port} <<EOF
|
||||
var cfg = {
|
||||
"_id": "${RS}",
|
||||
"protocolVersion": 1,
|
||||
"members": [
|
||||
{
|
||||
"_id": 0,
|
||||
"host": "${mongodb1}:${port}"
|
||||
},
|
||||
{
|
||||
"_id": 1,
|
||||
"host": "${mongodb2}:${port}"
|
||||
},
|
||||
{
|
||||
"_id": 2,
|
||||
"host": "${mongodb3}:${port}"
|
||||
}
|
||||
]
|
||||
};
|
||||
rs.initiate(cfg, { force: true });
|
||||
rs.reconfig(cfg, { force: true });
|
||||
EOF
|
||||
|
0
src/go/docker/test/Dockerfile
Normal file → Executable file
0
src/go/docker/test/Dockerfile
Normal file → Executable file
0
src/go/docker/test/mongod.key
Normal file → Executable file
0
src/go/docker/test/mongod.key
Normal file → Executable file
0
src/go/docker/test/ssl/client.pem
Normal file → Executable file
0
src/go/docker/test/ssl/client.pem
Normal file → Executable file
0
src/go/docker/test/ssl/mongod.pem
Normal file → Executable file
0
src/go/docker/test/ssl/mongod.pem
Normal file → Executable file
0
src/go/docker/test/ssl/mongodb.pem
Normal file → Executable file
0
src/go/docker/test/ssl/mongodb.pem
Normal file → Executable file
0
src/go/docker/test/ssl/rootCA.crt
Normal file → Executable file
0
src/go/docker/test/ssl/rootCA.crt
Normal file → Executable file
Reference in New Issue
Block a user