-
Notifications
You must be signed in to change notification settings - Fork 12
/
anydbver.sh
executable file
·2327 lines (2151 loc) · 90.6 KB
/
anydbver.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#!/bin/bash
[ -f .anydbver ] && source .anydbver
print_help() {
echo "Usage: "
echo "$0 configure provider:lxd"
echo "$0 fix ip # update container ip addresses"
echo "$0 ssh default or $0 ssh node1"
echo "$0 update # refresh version information"
echo "$0 destroy # remove containers and cleanup"
echo "$0 list # show currently running containers"
echo "$0 list-caches # show available caches"
echo "$0 deploy help"
echo "$0 add nodeN node_definition # spawn additional node and deploy software on it"
echo "$0 replace nodeN node_definition # delete existing node, spawn additional and deploy software on it"
echo "$0 apply nodeN node_definition # deploy software on existing node"
echo "$0 --namespace mynsp <ssh|list|deploy|add|replace|apply> ... # separate deployments operations"
echo "$0 port forward # forward port from lxc to Vagrant VM"
echo "Bash completion: source <($0 completion bash)"
exit 0
}
if [ "x$1" = "xhelp" -o "x$1" = "x--help" ] ; then
print_help
fi
if [[ "$1" == "completion" && "$2" == "bash" ]] ; then
echo "complete -C './anydbver complete bash' ./anydbver"
exit 0
fi
print_completion_variants() {
#echo "'$COMP_LINE'" >> ./completion.log
local PROG=''
local CMD=''
local NODE=''
local valid_commands=(deploy configure fix ssh update destroy list list-caches add replace apply --namespace --dry-run)
local valid_targets=(anydbver backup backend-ip cache cert-manager certmanager channel cluster clustercheck configsrv debug development docker docker-registry etcd-ip galera-master garbd group-replication gtid haproxy-galera haproxy-postgresql haproxy-pg haproxy hostname hn install k3s-master k3s-leader k3s k8s kubernetes k8s-minio k8s-mongo k8s-pg k8s-pg-zalando k8s-pmm k8s-pxc kube-config ldap-master ldap-leader ldap-server ldap ldap-simple logical mariadb-galera mariadb maria master_ip leader minio minio-ip mongo-community mongos-cfg mongos-shard mydumper mysql-jdbc mysql-router mysql mysql-ndb-data mysql-ndb-management ps percona-server pxc pxc: percona-xtradb-cluster percona-xtradb-cluster:)
for w in $COMP_LINE ; do
if [[ "$PROG" == "" ]] ; then
PROG="$w"
#echo "Command: '$PROG'" >> ./completion.log
continue
fi
if [[ "$CMD" == "" ]] ; then
if [[ " ${valid_commands[@]} " =~ " ${w} " ]] ; then
CMD="$w"
#echo "Valid command: '$CMD'" >> ./completion.log
continue
fi
fi
if [[ "$w" == "node"[0-9] || "$w" == "node"[0-9][0-9] ]] ; then
NODE="$w"
fi
done
if [[ "${COMP_LINE:$((${#COMP_LINE}-1))}" == " " ]] ; then
w=''
fi
if [[ "$CMD" == "" ]] ; then
for i in "${valid_commands[@]}" ; do
if [[ "$i" == "$w"* ]] ; then
echo "$i"
fi
done
fi
if [[ "$CMD" == "deploy" ]] ; then
local NEXT_NODE=''
if [[ "$NODE" == "" ]] ; then
NEXT_NODE=node0
else
NEXT_NODE=node$(( ${NODE/node/} + 1 ))
fi
#echo "Last node: $NODE" >> ./completion.log
#echo "Last word: $w" >> ./completion.log
for i in $NEXT_NODE "${valid_targets[@]}" ; do
if [[ "$i" == "$w"* ]] ; then
echo "$i"
fi
done
fi
}
if [[ "$1" == "complete" && "$2" == "bash" ]] ; then
print_completion_variants
exit 0
fi
if [ "x$1" = "xdeploy" ] && ([ "x$2" = "xpsmdb" -o "x$2" = "xmongo" -o "x$2" = "xmongodb" ] ) && [ "x$3" = "xhelp" -o "x$3" = "x--help" ] ; then
echo "Deploy mongodb/psmdb: "
echo "$0 deploy psmdb"
echo "$0 deploy psmdb replica-set:rs0 node1 psmdb master:default replica-set:rs0 node2 psmdb master:default replica-set:rs0"
echo "$0 deploy node0 mongo-community replica-set:rs0 node1 mongo-community master:default replica-set:rs0 node2 mongo-community master:default replica-set:rs0"
echo -e $0' deploy \\\n psmdb:4.2 replica-set:rs0 shardsrv \\\n node1 psmdb:4.2 master:default replica-set:rs0 shardsrv \\\n node2 psmdb:4.2 master:default replica-set:rs0 shardsrv \\\n node3 psmdb:4.2 configsrv replica-set:cfg0 \\\n node4 psmdb:4.2 configsrv replica-set:cfg0 master:node3 \\\n node5 psmdb:4.2 configsrv replica-set:cfg0 master:node3 \\\n node6 psmdb:4.2 mongos-cfg:cfg0/node3,node4,node5 mongos-shard:rs0/default,node1,node2'
echo "$0 deploy ldap node1 ldap-master:default psmdb:4.2"
echo "$0 deploy samba node1 psmdb:4.2 samba-dc:default"
echo "Deploy multiple shards:"
cat <<EOF
openssl rand -base64 756 > secret/cfg0-keyfile
for keyfile in rs{0,1,2}-keyfile ; do cp -L secret/cfg0-keyfile secret/\$keyfile; done
$0 deploy install psmdb:4.2.12 cache:psmdb-4.2.12
$0 deploy \\
default hostname:rs0-0 cache:psmdb-4.2.12 \\
node1 hostname:rs0-1 cache:psmdb-4.2.12 \\
node2 hostname:rs0-2 cache:psmdb-4.2.12 \\
node3 hostname:rs1-0 cache:psmdb-4.2.12 \\
node4 hostname:rs1-1 cache:psmdb-4.2.12 \\
node5 hostname:rs1-2 cache:psmdb-4.2.12 \\
node6 hostname:rs2-0 cache:psmdb-4.2.12 \\
node7 hostname:rs2-1 cache:psmdb-4.2.12 \\
node8 hostname:rs2-2 cache:psmdb-4.2.12 \\
node9 hostname:cfg0-0 cache:psmdb-4.2.12 \\
node10 hostname:cfg0-1 cache:psmdb-4.2.12 \\
node11 hostname:cfg0-2 cache:psmdb-4.2.12 \\
node12 hostname:route1 cache:psmdb-4.2.12 \\
node13 hostname:route1 cache:psmdb-4.2.12 \\
node14 hostname:route1 cache:psmdb-4.2.12 \\
\\
default psmdb:4.2.12 replica-set:rs0 shardsrv \\
node1 psmdb:4.2.12 master:rs0-0 replica-set:rs0 shardsrv \\
node2 psmdb:4.2.12 master:rs0-0 replica-set:rs0 shardsrv \\
node3 psmdb:4.2.12 replica-set:rs1 shardsrv \\
node4 psmdb:4.2.12 master:rs1-0 replica-set:rs1 shardsrv \\
node5 psmdb:4.2.12 master:rs1-0 replica-set:rs1 shardsrv \\
node6 psmdb:4.2.12 replica-set:rs2 shardsrv \\
node7 psmdb:4.2.12 master:rs2-0 replica-set:rs2 shardsrv \\
node8 psmdb:4.2.12 master:rs2-0 replica-set:rs2 shardsrv \\
node9 psmdb:4.2.12 replica-set:cfg0 configsrv \\
node10 psmdb:4.2.12 master:cfg0-0 replica-set:cfg0 configsrv \\
node11 psmdb:4.2.12 master:cfg0-0 replica-set:cfg0 configsrv \\
node12 psmdb:4.2.12 mongos-cfg:cfg0/cfg0-0,cfg0-1,cfg0-2 mongos-shard:rs0/rs0-0,rs0-1,rs0-2,rs1/rs1-0,rs1-1,rs1-2,rs2/rs2-0,rs2-1,rs2-2 \\
node13 psmdb:4.2.12 mongos-cfg:cfg0/cfg0-0,cfg0-1,cfg0-2 \\
node14 psmdb:4.2.12 mongos-cfg:cfg0/cfg0-0,cfg0-1,cfg0-2
$0 deploy mongo pbm
$0 deploy mongo percona-backup-mongodb
$0 deploy \\
--shared-directory \\
node0 psmdb replica-set:rs0 pbm pbm-agent \\
node1 psmdb master:default replica-set:rs0 pbm pbm-agent \\
node2 psmdb master:default replica-set:rs0 pbm pbm-agent
# mongodb sharded cluster with Percona Backup
./anydbver deploy \\
--shared-directory \\
default hostname:rs0-0 cache:psmdb-4.2.12 \\
node1 hostname:rs0-1 cache:psmdb-4.2.12 \\
node2 hostname:rs0-2 cache:psmdb-4.2.12 \\
node3 hostname:rs1-0 cache:psmdb-4.2.12 \\
node4 hostname:rs1-1 cache:psmdb-4.2.12 \\
node5 hostname:rs1-2 cache:psmdb-4.2.12 \\
node6 hostname:rs2-0 cache:psmdb-4.2.12 \\
node7 hostname:rs2-1 cache:psmdb-4.2.12 \\
node8 hostname:rs2-2 cache:psmdb-4.2.12 \\
node9 hostname:cfg0-0 cache:psmdb-4.2.12 \\
node10 hostname:cfg0-1 cache:psmdb-4.2.12 \\
node11 hostname:cfg0-2 cache:psmdb-4.2.12 \\
node12 hostname:route1 cache:psmdb-4.2.12 \\
\\
default psmdb:4.2.12 replica-set:rs0 shardsrv \\
node1 psmdb:4.2.12 master:rs0-0 replica-set:rs0 shardsrv \\
node2 psmdb:4.2.12 master:rs0-0 replica-set:rs0 shardsrv \\
node3 psmdb:4.2.12 replica-set:rs1 shardsrv \\
node4 psmdb:4.2.12 master:rs1-0 replica-set:rs1 shardsrv \\
node5 psmdb:4.2.12 master:rs1-0 replica-set:rs1 shardsrv \\
node6 psmdb:4.2.12 replica-set:rs2 shardsrv \\
node7 psmdb:4.2.12 master:rs2-0 replica-set:rs2 shardsrv \\
node8 psmdb:4.2.12 master:rs2-0 replica-set:rs2 shardsrv \\
node9 psmdb:4.2.12 replica-set:cfg0 configsrv pbm pbm-agent \\
node10 psmdb:4.2.12 master:cfg0-0 replica-set:cfg0 configsrv pbm pbm-agent \\
node11 psmdb:4.2.12 master:cfg0-0 replica-set:cfg0 configsrv pbm pbm-agent \\
node12 psmdb:4.2.12 mongos-cfg:cfg0/cfg0-0,cfg0-1,cfg0-2 mongos-shard:rs0/rs0-0,rs0-1,rs0-2,rs1/rs1-0,rs1-1,rs1-2,rs2/rs2-0,rs2-1,rs2-2 \\
node0 pbm pbm-agent \\
node1 pbm pbm-agent \\
node2 pbm pbm-agent \\
node3 pbm pbm-agent \\
node4 pbm pbm-agent \\
node5 pbm pbm-agent \\
node6 pbm pbm-agent \\
node7 pbm pbm-agent \\
node8 pbm pbm-agent
EOF
exit 0
fi
if [ "x$1" = "xdeploy" ] && ([ "x$2" = "xmysql" -o "x$2" = "xpercona-server" -o "x$2" = "xmariadb" ] ) && [ "x$3" = "xhelp" -o "x$3" = "x--help" ] ; then
echo "Deploy MySQL/Percona Server/MariaDB: "
echo "$0 deploy percona-server:8.0.16"
echo "$0 deploy percona-server:8.0"
echo "$0 deploy percona-server"
echo "$0 deploy percona-server rocksdb"
echo "$0 deploy ps:5.7"
echo "$0 deploy ps:5.7 mydumper"
echo "$0 deploy ps:8.0.22 xtrabackup"
echo "$0 deploy ps:5.7 perf devel"
echo "$0 deploy ps node1 sysbench sysbench-mysql:default oltp_read_write"
echo "$0 deploy hn:vault.percona.local vault node1 ps:8.0 vault-server:vault.percona.local"
echo "$0 deploy ps:5.7 percona-toolkit"
echo "$0 deploy ps:8.0.22 hn:ps0 node1 ps:8.0.22 hn:ps1 node2 ps:8.0.22 hn:ps2 master:ps0 node2 ps:8.0.22 master:ps1 channel:ps1ch"
echo "$0 deploy mysql"
echo -e $0' deploy \\\n hn:mysql_rs0_gr0 mysql:8.0.18 group-replication \\\n node1 hn:mysql_rs0_gr1 mysql:8.0.18 group-replication master:default \\\n node2 hn:mysql_rs0_gr2 mysql:8.0.18 group-replication master:default \\\n node3 hn:mysql_rs0_router mysql-router:8.0.18 master:default'
echo -e $0' deploy \\\n node0 mysql-ndb-management ndb-data-nodes:node1,node2 ndb-sql-nodes:node3 ndb-connectstring:node0 hn:mgm \\\n node1 mysql-ndb-data ndb-connectstring:node0 hn:data1 \\\n node2 mysql-ndb-data ndb-connectstring:node0 hn:data2 \\\n node3 mysql-ndb-sql ndb-connectstring:node0 hn:sql'
echo "$0 deploy mariadb:10.4"
echo "$0 deploy maria:10.4"
echo "$0 deploy mariadb node1 mariadb master:default"
echo "$0 deploy mariadb node1 mariadb master:default default mariadb master:node1 node2 mariadb master:node1"
echo "$0 deploy mariadb-cluster:10.3.26:25.3.30"
echo "$0 deploy mariadb-cluster:10.4 node1 mariadb-cluster:10.4 galera-master:default node2 mariadb-cluster:10.4 galera-master:default"
echo "$0 deploy ldap node1 ldap-master:default ps:5.7"
echo "$0 deploy ps:5.7 node1 ps:5.7 master:default node2 ps:5.7 master:node1"
echo "$0 deploy ps:5.7 hostname:leader.percona.local node1 ps:5.7 hostname:follower.percona.local leader:default"
echo "$0 deploy ps:8.0 utf8 node1 ps:5.7 master:default node2 ps:5.6 master:node1 row"
echo "$0 deploy hn:ps0 ps:5.7 node1 hn:ps1 ps:5.7 master:default node2 hn:ps2 ps:5.7 master:node1 node3 hn:orc orchestrator master:default"
echo "$0 deploy hn:ps0 ps:5.7 node1 hn:ps1 ps:5.7 master:default node2 hn:ps2 ps:5.7 master:node1 node3 hn:orc percona-orchestrator master:default"
echo "$0 deploy samba node1 ps samba-dc:default"
echo "$0 deploy pxc:5.7 node1 pxc:5.7 galera-master:default node2 pxc:5.7 galera-master:default"
echo -e $0' deploy \\\n pxc:5.7 node1 pxc:5.7 galera-master:default node2 pxc:5.7 galera-master:default \\\n node3 pxc:5.7 cluster:cluster2 node4 pxc:5.7 cluster:cluster2 galera-master:node3 node5 pxc:5.7 cluster:cluster2 galera-master:node3'
echo "$0 deploy pxc:5.7 node1 pxc:5.7 galera-master:default node2 pxc:5.7 garbd galera-master:default"
echo -e $0' deploy \\\n haproxy-galera:node1,node2,node3 \\\n node1 pxc clustercheck \\\n node2 pxc galera-master:node1 clustercheck \\\n node3 pxc galera-master:node1 clustercheck'
echo "$0 deploy ps:8.0 group-replication node1 ps:8.0 group-replication master:default node2 ps:8.0 group-replication master:default"
cat <<EOF
# Create MySQL NDB Cluster HA setup: 3 Management nodes, 6 Data nodes, 2 SQL nodes
$0 deploy \
node0 mysql-ndb-management ndb-data-nodes:node3,node4,node5,node6,node7,node8 ndb-sql-nodes:node9,node10 ndb-connectstring:node0,node1,node2 hn:mgm1 \\
node1 mysql-ndb-management ndb-data-nodes:node3,node4,node5,node6,node7,node8 ndb-sql-nodes:node9,node10 ndb-connectstring:node0,node1,node2 hn:mgm2 \\
node2 mysql-ndb-management ndb-data-nodes:node3,node4,node5,node6,node7,node8 ndb-sql-nodes:node9,node10 ndb-connectstring:node0,node1,node2 hn:mgm3 \\
node3 mysql-ndb-data ndb-connectstring:node0,node1,node2 hn:data1 \\
node4 mysql-ndb-data ndb-connectstring:node0,node1,node2 hn:data2 \\
node5 mysql-ndb-data ndb-connectstring:node0,node1,node2 hn:data3 \\
node6 mysql-ndb-data ndb-connectstring:node0,node1,node2 hn:data4 \\
node7 mysql-ndb-data ndb-connectstring:node0,node1,node2 hn:data5 \\
node8 mysql-ndb-data ndb-connectstring:node0,node1,node2 hn:data6 \\
node9 mysql-ndb-sql ndb-connectstring:node0,node1,node2 hn:sql1 \\
node10 mysql-ndb-sql ndb-connectstring:node0,node1,node2 hn:sql2
EOF
exit 0
fi
if [ "x$2" = "xhelp" -o "x$2" = "x--help" ] ; then
if [ "x$1" = "xdeploy" ] ; then
echo "Deploy: "
echo "$0 deploy percona-server:8.0.16"
echo "$0 deploy percona-server:8.0"
echo "$0 deploy percona-server"
echo "$0 deploy ps:5.7"
echo "$0 deploy ps:5.7 mydumper"
echo "$0 deploy ps:8.0.22 xtrabackup"
echo "$0 deploy ps:5.7 perf devel"
echo "$0 deploy ps node1 sysbench sysbench-mysql:default oltp_read_write"
echo "$0 deploy hn:vault.percona.local vault node1 ps:8.0 vault-server:vault.percona.local"
echo "$0 deploy ps:5.7 percona-toolkit"
echo "$0 deploy ps:8.0.22 hn:ps0 node1 ps:8.0.22 hn:ps1 node2 ps:8.0.22 hn:ps2 master:ps0 node2 ps:8.0.22 master:ps1 channel:ps1ch"
echo "$0 deploy mysql"
echo -e $0' deploy \\\n hn:mysql_rs0_gr0 mysql:8.0.18 group-replication \\\n node1 hn:mysql_rs0_gr1 mysql:8.0.18 group-replication master:default \\\n node2 hn:mysql_rs0_gr2 mysql:8.0.18 group-replication master:default \\\n node3 hn:mysql_rs0_router mysql-router:8.0.18 master:default'
echo -e $0' deploy \\\n node0 mysql-ndb-management ndb-data-nodes:node1,node2 ndb-sql-nodes:node3 ndb-connectstring:node0 hn:mgm \\\n node1 mysql-ndb-data ndb-connectstring:node0 hn:data1 \\\n node2 mysql-ndb-data ndb-connectstring:node0 hn:data2 \\\n node3 mysql-ndb-sql ndb-connectstring:node0 hn:sql'
echo "$0 deploy mariadb:10.4"
echo "$0 deploy maria:10.4"
echo "$0 deploy mariadb node1 mariadb master:default"
echo "$0 deploy mariadb node1 mariadb master:default default mariadb master:node1 node2 mariadb master:node1"
echo "$0 deploy mariadb-cluster:10.3.26:25.3.30"
echo "$0 deploy mariadb-cluster:10.4 node1 mariadb-cluster:10.4 galera-master:default node2 mariadb-cluster:10.4 galera-master:default"
echo "$0 deploy ldap node1 ldap-master:default ps:5.7"
echo "$0 deploy ps:5.7 node1 ps:5.7 master:default node2 ps:5.7 master:node1"
echo "$0 deploy ps:5.7 hostname:leader.percona.local node1 ps:5.7 hostname:follower.percona.local leader:default"
echo "$0 deploy ps:8.0 utf8 node1 ps:5.7 master:default node2 ps:5.6 master:node1 row"
echo "$0 deploy hn:ps0 ps:5.7 node1 hn:ps1 ps:5.7 master:default node2 hn:ps2 ps:5.7 master:node1 node3 hn:orc orchestrator master:default"
echo "$0 deploy samba node1 ps samba-dc:default"
echo "$0 deploy pxc:5.7 node1 pxc:5.7 galera-master:default node2 pxc:5.7 galera-master:default"
echo -e $0' deploy \\\n pxc:5.7 node1 pxc:5.7 galera-master:default node2 pxc:5.7 galera-master:default \\\n node3 pxc:5.7 cluster:cluster2 node4 pxc:5.7 cluster:cluster2 galera-master:node3 node5 pxc:5.7 cluster:cluster2 galera-master:node3'
echo "$0 deploy pxc:5.7 node1 pxc:5.7 galera-master:default node2 pxc:5.7 garbd galera-master:default"
echo -e $0' deploy \\\n haproxy-galera:node1,node2,node3 \\\n node1 pxc clustercheck \\\n node2 pxc galera-master:node1 clustercheck \\\n node3 pxc galera-master:node1 clustercheck'
echo "$0 deploy ps:8.0 group-replication node1 ps:8.0 group-replication master:default node2 ps:8.0 group-replication master:default"
echo "$0 deploy node0 docker kubeadm hn:master1.percona.local virtual-machine cpu:2 mem:3GB node1 kubeadm-url:master1.percona.local docker hn:worker1.percona.local virtual-machine cpu:2 mem:3GB node2 kubeadm-url:master1.percona.local docker hn:worker2.percona.local virtual-machine cpu:2 mem:3GB node3 kubeadm-url:master1.percona.local docker hn:worker3.percona.local virtual-machine cpu:2 mem:3GB node0 k8s-pxc kubeadm"
echo "$0 deploy k3s node1 k3s-master:default node2 k3s-master:default node3 k3s-master:default"
echo "$0 deploy k3s node1 k3s-master:default node2 k3s-master:default node3 k3s-master:default default k8s-mongo"
echo "$0 deploy k3s node1 k3s-master:default node2 k3s-master:default node3 k3s-master:default default k8s-minio k8s-mongo"
echo "$0 deploy k3s node1 k3s-master:default node2 k3s-master:default node3 k3s-master:default default k8s-pxc"
echo "$0 deploy k3s node1 k3s-master:default node2 k3s-master:default node3 k3s-master:default default cert-manager k8s-pxc"
echo "$0 deploy k3s node1 k3s-master:default node2 k3s-master:default node3 k3s-master:default node4 k3s-master:default default vites"
echo "$0 deploy k3s node1 k3s-master:default node2 k3s-master:default node3 k3s-master:default default k8s-minio k8s-pmm k8s-pxc backup"
echo "$0 deploy k3s node1 k3s-master:default node2 k3s-master:default node3 k3s-master:default default k8s-minio k8s-pxc backup pxc57"
echo "$0 deploy k3s node1 k3s-master:default node2 k3s-master:default node3 k3s-master:default default k8s-pg"
echo "$0 deploy k3s node1 k3s-master:default node2 k3s-master:default node3 k3s-master:default default k8s-pg-zalando"
echo "$0 deploy pg:12.3"
echo "$0 deploy pg:12.3 node1 pg:12.3 master:default"
echo "$0 deploy pg pgbackrest"
echo "$0 deploy node0 hn:minio.percona.local minio node1 minio-ip:minio.percona.local pg pgbackrest"
echo "$0 deploy node0 hn:minio.percona.local minio node1 minio-ip:minio.percona.local pg wal-g"
echo "$0 deploy pg node1 pg master:default default pg pgpool backend-ip:default"
echo "$0 deploy pg:13 patroni node1 pg:13 master:default patroni etcd-ip:default node2 pg:13 master:default patroni etcd-ip:default"
echo "$0 deploy haproxy-pg:node1,node2,node3 node1 pg clustercheck node2 pg clustercheck master:node1 node3 pg clustercheck master:node1"
echo "$0 deploy node0 pmm node1 pmm-client pmm-server:node0 pg pg_stat_monitor development"
echo "$0 deploy pmm node1 ppg pmm-client pmm-server:default"
echo "$0 deploy postgresql sysbench sysbench-pg:default oltp_read_write"
echo -e $0' deploy percona-postgresql \\\n sysbench sysbench-pg:default oltp_read_write # prepare, execute run_sysbench.sh to start sysbench'
echo -e $0' deploy \\\n postgresql sysbench sysbench-pg:default oltp_read_write \\\n node1 postgresql master:default logical:sbtest \\\n node2 postgresql master:default logical:sbtest'
echo "$0 deploy psmdb"
echo "$0 deploy mongo pbm"
echo "$0 deploy psmdb replica-set:rs0 node1 psmdb master:default replica-set:rs0 node2 psmdb master:default replica-set:rs0"
echo -e $0' deploy \\\n psmdb:4.2 replica-set:rs0 shardsrv \\\n node1 psmdb:4.2 master:default replica-set:rs0 shardsrv \\\n node2 psmdb:4.2 master:default replica-set:rs0 shardsrv \\\n node3 psmdb:4.2 configsrv replica-set:cfg0 \\\n node4 psmdb:4.2 configsrv replica-set:cfg0 master:node3 \\\n node5 psmdb:4.2 configsrv replica-set:cfg0 master:node3 \\\n node6 psmdb:4.2 mongos-cfg:cfg0/node3,node4,node5 mongos-shard:rs0/default,node1,node2'
echo "$0 deploy ldap node1 ldap-master:default psmdb:4.2"
echo "$0 deploy samba node1 psmdb:4.2 samba-dc:default"
echo "$0 deploy sysbench"
echo "$0 deploy ps:5.7 node1 ps:5.7 master:default node2 ps:5.7 master:default node3 proxysql master:default"
echo -e $0' deploy ps:5.7 node1 ps:5.7 master:default node2 ps:5.7 master:default \\\n node3 proxysql master:default node4 proxysql proxysql-ip:node3 node5 proxysql proxysql-ip:node3'
echo "$0 deploy pxc:5.7 node1 pxc:5.7 galera-master:default node2 pxc:5.7 galera-master:default node3 proxysql galera-master:default"
echo "$0 deploy pxc node1 pxc galera-master:default node2 pxc galera-master:default node3 proxysql galera-master:default"
echo "$0 deploy pmm node1 ps:5.7 pmm-client pmm-server:default"
echo "$0 deploy pmm:1.17.4 node1 ps:5.7 pmm-client:1.17.4 pmm-server:default"
echo "$0 deploy docker"
echo "$0 deploy docker docker-registry hn:registry.percona.local"
echo "$0 deploy node0 docker docker-registry hn:registry.percona.local node1 k3s k3s-registry:node0 node2 k3s-master:node1 k3s-registry:node0 node3 k3s-master:node1 k3s-registry:node0 node4 k3s-master:node1 k3s-registry:node0"
echo "$0 deploy mongo help"
echo "$0 deploy mysql help"
echo "$0 deploy psmdb help"
exit 0
fi
fi
NAMESPACE_CMD=''
NAMESPACE=''
SHARED_DIRECTORY=0
DRY_RUN=0
if [ "x$1" = "xdeploy" ] && [ "x$2" = "x--dry-run" ] ; then
DRY_RUN=1
fi
opts=$(getopt \
--longoptions "dry-run,destroy,namespace:,provider:,os:,shared-directory" \
--name "$(basename "$0")" \
--options "-n:" \
-- "$@"
)
eval set --"$opts"
while [[ $# -gt 0 ]]; do
case "$1" in
--dry-run)
DRY_RUN=1
shift
;;
--namespace | -n)
NAMESPACE="$2-"
NAMESPACE_CMD="--namespace $2"
shift 2
;;
--provider)
PROVIDER="$2"
shift 2
;;
--os)
NODE_OS="$2"
shift 2
;;
--destroy)
DESTROY=1
shift
;;
--shared-directory)
SHARED_DIRECTORY=1
shift
;;
*)
break
;;
esac
done
if [[ "$1" == "--" ]] ; then
shift
fi
setup_existing_hosts() {
PYTHON_INT=/usr/bin/python
:> ${NAMESPACE}ansible_hosts
for w in ${ANSIBLE_WORKERS//,/ } ; do
NODE=${USER}.${w//:*/}
IP=${w//*:/}
if [ "x$NODE" = "x${USER}.node0" ] ; then
echo "${USER}.default ansible_connection=ssh ansible_user=root ansible_ssh_private_key_file=secret/id_rsa ansible_host=$IP ansible_python_interpreter=$PYTHON_INT ansible_ssh_common_args='-o StrictHostKeyChecking=no -o ProxyCommand=none'" >> ${NAMESPACE}ansible_hosts
fi
echo "$NODE ansible_connection=ssh ansible_user=root ansible_ssh_private_key_file=secret/id_rsa ansible_host=$IP ansible_python_interpreter=$PYTHON_INT ansible_ssh_common_args='-o StrictHostKeyChecking=no -o ProxyCommand=none'" >> ${NAMESPACE}ansible_hosts
cat >> ${NAMESPACE}ssh_config <<EOF
Host ${NODE/$USER./}
User root
HostName $IP
StrictHostKeyChecking no
UserKnownHostsFile /dev/null
IdentityFile ~/.ssh/id_rsa
ProxyCommand none
EOF
done
}
if [ "x$1" = "xconfigure" ] ; then
while (( "$#" )); do
if [[ "$1" == provider:* ]] ; then
PROVIDER=$(echo "$1"|cut -d: -f 2)
case "$PROVIDER" in
vagrant)
;;
lxdock)
;;
podman)
;;
lxd)
;;
docker)
;;
existing)
setup_existing_hosts
;;
*)
echo "Please select VM/Container provider with $0 configure provider:PROVIDERNAME"
exit 1
esac
fi
shift
done
:> .anydbver
echo "PROVIDER=$PROVIDER" >> .anydbver
echo "LXD_PROFILE=$LXD_PROFILE" >> .anydbver
exit 0
fi
if [ "x$1" = "xssh" ] ; then
shift
NODE="$1"
if [[ "$NODE" == "" || "$NODE" == "--" ]] ; then
NODE=default
else
shift
fi
case "$PROVIDER" in
vagrant)
exec vagrant ssh "$NODE" "$@"
;;
lxdock)
;;
podman)
exec ./podmanctl ssh "$NODE" "$@"
;;
lxd)
exec ./lxdctl $NAMESPACE_CMD ssh "$NODE" "$@"
;;
docker)
exec ./lxdctl $NAMESPACE_CMD ssh "$NODE" "$@"
;;
existing)
exec ./lxdctl $NAMESPACE_CMD ssh "$NODE" "$@"
;;
*)
echo "Please select VM/Container provider with $0 configure provider:PROVIDERNAME"
exit 1
esac
fi
if [ "x$1" = "xlist" ] || [ "x$1" = "xls" ] ; then
case "$PROVIDER" in
podman)
exec ./podmanctl list
;;
lxd)
exec ./lxdctl $NAMESPACE_CMD list
;;
existing)
echo $ANSIBLE_WORKERS
;;
*)
echo "Please select VM/Container provider with $0 configure provider:PROVIDERNAME"
exit 1
esac
exit 0
fi
if [ "x$1" = "xlist-caches" ] ; then
case "$PROVIDER" in
podman)
exec ./podmanctl list-caches
;;
lxd)
exec ./lxdctl $NAMESPACE_CMD list-caches
;;
existing)
;;
*)
echo "Please select VM/Container provider with $0 configure provider:PROVIDERNAME"
exit 1
esac
exit 0
fi
if [ "x$1" = "xfix" ] && [ "x$2" = "xip" ] ; then
exec ./lxdctl $NAMESPACE_CMD --fix-ip
exit 0
fi
if [ "x$1" = "xdestroy" ] || [[ "$DESTROY" == 1 ]] ; then
shift
NODE="$1"
if [[ "x$NODE" != "x" ]] ; then
shift
fi
case "$PROVIDER" in
vagrant)
exec vagrant destroy -f
;;
lxdock)
exec lxdock destroy -f
;;
podman)
exec ./podmanctl --destroy
;;
lxd)
exec ./lxdctl $NAMESPACE_CMD --destroy $NODE
;;
docker)
exec ./docker_container.py --nodes=3 --destroy
;;
existing)
echo "Please destroy $ANSIBLE_WORKERS manually"
;;
*)
echo "Please select VM/Container provider with $0 configure provider:PROVIDERNAME"
exit 1
esac
fi
get_version() {
if [[ $i == *':'* ]] ; then
echo "$1" | cut -d: -f2
else
echo "$1" | cut -d= -f2
fi
}
get_2nd_version() {
if [[ $i == *':'* ]] ; then
echo "$1" | cut -d: -f3
else
echo "$1" | cut -d= -f3
fi
}
search_for_latest_version() {
local prod=$1
local user_ver=$2
if [[ $user_ver == *':'* ]] || [[ $user_ver == *'='* ]] ; then
VER=$(get_version "$user_ver")
VER=$(grep "^$VER" .version-info/${prod}.${NODE_OS}.txt |tail -n 1)
else
VER=$(tail -n 1 .version-info/${prod}.${NODE_OS}.txt)
fi
if [ "x$VER" == "x" ] ; then
echo "No such version ${prod} for $NODE_OS: '$user_ver'" >&2
exit 1
fi
}
refresh_percona_server_version_info() {
[ -d .version-info ] || mkdir .version-info
curl -sL https://repo.percona.com/percona/yum/release/7/RPMS/x86_64/|perl -ne '/Percona-Server-server-\d\d-([^"]*).el7.x86_64.rpm/ and print "$1\n"' > .version-info/percona-server.el7.txt
curl -sL https://www.percona.com/downloads/Percona-Server-LATEST/ > .version-info/percona-server-80.html
for VER in $( cat .version-info/percona-server-80.html |perl -ne 'm,option value=\"Percona-Server-LATEST/Percona-Server-([^/]*?)\", and print "$1\n"'|sort -n ) ; do
curl -sL https://www.percona.com/downloads/Percona-Server-LATEST/Percona-Server-"$VER"/binary/redhat/7/ |grep "$VER"|perl -ne '/percona-server-server-(.*?).el7.x86_64.rpm/ and print "$1\n"'
done >> .version-info/percona-server.el7.txt
curl -sL https://repo.percona.com/percona/yum/release/8/RPMS/x86_64/|perl -ne '/Percona-Server-server-\d\d-([^"]*).el8.x86_64.rpm/ and print "$1\n"' | grep -v debuginfo > .version-info/percona-server.el8.txt
for VER in $( cat .version-info/percona-server-80.html |perl -ne 'm,option value=\"Percona-Server-LATEST/Percona-Server-([^/]*?)\", and print "$1\n"'|sort -n ) ; do
curl -sL https://www.percona.com/downloads/Percona-Server-LATEST/Percona-Server-"$VER"/binary/redhat/8/ |grep "$VER"|perl -ne '/percona-server-server-(.*?).el8.x86_64.rpm/ and print "$1\n"'
done >> .version-info/percona-server.el8.txt
rm -f .version-info/percona-server-80.html
curl -sL https://repo.percona.com/ps-57/apt/pool/main/p/percona-server-5.7/ \
| perl -ne '/percona-server-server-\d.\d_([^"]*).focal_amd64.deb/ and print "$1\n"' > .version-info/percona-server.focal.txt
curl -sL https://repo.percona.com/ps-80/apt/pool/main/p/percona-server/ \
| perl -ne '/percona-server-server_([^"]*).focal_amd64.deb/ and print "$1\n"' >> .version-info/percona-server.focal.txt
curl -sL https://repo.percona.com/percona/apt/pool/main/p/percona-xtradb-cluster-5.7/ \
| perl -ne '/percona-xtradb-cluster-server-5.7_([^"]*).focal_amd64.deb/ and print "$1\n"' > .version-info/percona-xtradb-cluster.focal.txt
curl -sL https://repo.percona.com/pxc-80/apt/pool/main/p/percona-xtradb-cluster/ \
| perl -ne '/percona-xtradb-cluster-server_([^"]*).focal_amd64.deb/ and print "$1\n"' >> .version-info/percona-xtradb-cluster.focal.txt
for os in bionic stretch buster ; do
curl -sL https://repo.percona.com/percona/apt/pool/main/p/percona-server-5.6/ https://repo.percona.com/percona/apt/pool/main/p/percona-server-5.7/ \
| perl -ne '/percona-server-server-\d.\d_([^"]*).'$os'_amd64.deb/ and print "$1\n"' | sort -n -t . -k1,1 -k2,2 -k3,3 > .version-info/percona-server.$os.txt
curl -sL https://repo.percona.com/ps-80/apt/pool/main/p/percona-server/ \
| perl -ne '/percona-server-server_([^"]*).'$os'_amd64.deb/ and print "$1\n"' >> .version-info/percona-server.$os.txt
curl -sL https://repo.percona.com/percona/apt/pool/main/p/percona-xtradb-cluster-5.6/ \
| perl -ne '/percona-xtradb-cluster-server-5.?6_([^"]*).'$os'_amd64.deb/ and print "$1\n"' > .version-info/percona-xtradb-cluster.$os.txt
curl -sL https://repo.percona.com/percona/apt/pool/main/p/percona-xtradb-cluster-5.7/ \
| perl -ne '/percona-xtradb-cluster-server-5.7_([^"]*).'$os'_amd64.deb/ and print "$1\n"' >> .version-info/percona-xtradb-cluster.$os.txt
curl -sL https://repo.percona.com/pxc-80/apt/pool/main/p/percona-xtradb-cluster/ \
| perl -ne '/percona-xtradb-cluster-server_([^"]*).'$os'_amd64.deb/ and print "$1\n"' >> .version-info/percona-xtradb-cluster.$os.txt
done
curl -sL https://repo.percona.com/percona/yum/release/7/RPMS/x86_64/|perl -ne '/Percona-XtraDB-Cluster-\d\d-([0-9.-]*).el7.x86_64.rpm/ and print "$1\n"' > .version-info/percona-xtradb-cluster.el7.txt
curl -sL https://repo.percona.com/pxc-80/yum/release/7/RPMS/x86_64/|perl -ne '/percona-xtradb-cluster-([0-9.-]*).el7.x86_64.rpm/ and print "$1\n"' >> .version-info/percona-xtradb-cluster.el7.txt
# el8
curl -sL https://repo.percona.com/percona/yum/release/8/RPMS/x86_64/|perl -ne '/Percona-XtraDB-Cluster-\d\d-([0-9.-]*).el8.x86_64.rpm/ and print "$1\n"' > .version-info/percona-xtradb-cluster.el8.txt
curl -sL https://repo.percona.com/pxc-80/yum/release/8/RPMS/x86_64/|perl -ne '/percona-xtradb-cluster-([0-9.-]*).el8.x86_64.rpm/ and print "$1\n"' >> .version-info/percona-xtradb-cluster.el8.txt
curl -sL https://repo.percona.com/percona/yum/release/7/RPMS/x86_64/ \
| perl -ne '/proxysql[0-9]*-([0-9.-]*).el7.x86_64.rpm/ and print "$1\n"' \
| sort -n -t . -k1,1 -k2,2 -k3,3 > .version-info/percona-proxysql.el7.txt
curl -sL https://repo.percona.com/percona/yum/release/8/RPMS/x86_64/ \
| perl -ne '/proxysql[0-9]*-([0-9.-]*).el8.x86_64.rpm/ and print "$1\n"' \
| sort -n -t . -k1,1 -k2,2 -k3,3 > .version-info/percona-proxysql.el8.txt
curl -sL https://repo.percona.com/percona/yum/release/7/RPMS/x86_64/ \
| perl -ne '/percona-xtrabackup(?:-[0-9]+)-([0-9.-]*).el7.x86_64.rpm/ and print "$1\n"' \
| sort -n -t . -k1,1 -k2,2 -k3,3 > .version-info/xtrabackup.el7.txt
curl -sL https://repo.percona.com/percona/yum/release/8/RPMS/x86_64/ \
| perl -ne '/percona-xtrabackup(?:-[0-9]+)-([0-9.-]*).el8.x86_64.rpm/ and print "$1\n"' \
| sort -n -t . -k1,1 -k2,2 -k3,3 > .version-info/xtrabackup.el8.txt
:> .version-info/mariadb.el7.txt
:> .version-info/mariadb.el8.txt
for i in $(curl -sL https://archive.mariadb.org/|grep -F mariadb-10.|sed -re 's,^.*href="mariadb-(10\.[0-9]+\.[0-9]+)/.*$,\1,'|grep -v '[a-zA-Z]') ; do echo https://archive.mariadb.org/mariadb-$i/yum/centos7-amd64/rpms/ ; done|xargs curl -sL |sort -u > .version-info/mariadb-pkg.list.txt
perl -ne '/MariaDB-server-(\d[^"]*).el7.centos.x86_64.rpm/ and print "$1\n"' .version-info/mariadb-pkg.list.txt|sort -n -t . -k1,1 -k2,2 -k3,3|uniq > .version-info/mariadb.el7.txt
rm -f .version-info/mariadb-pkg.list.txt
for ver in $(grep 10.[3-6] .version-info/mariadb.el7.txt) ; do
short_ver=$(echo $ver|sed -re 's/-[0-9]+$//')
for galera_ver in $( curl -sL https://archive.mariadb.org/mariadb-$short_ver/yum/centos7-amd64/rpms/ |grep galera|perl -pe 's/^.*<a href="galera-([0-9]+-)?([^>]+)\.rhel7\.el7\.centos\.x86_64\.rpm" title=.*$/\2/;s/^.*<a href="galera-([0-9]+-)?([^>]+)\.el7\.centos\.x86_64\.rpm" title=.*$/\2/' | egrep -v '[a-zA-Z]' ) ; do
echo -n "$ver "
echo $galera_ver
done
done > .version-info/mariadb-galera.el7.txt
for maver in 10.3 10.4 10.5 10.6 10.7 10.8 10.9 10.10 10.11 ; do
curl -sL http://yum.mariadb.org/$maver/centos8-amd64/rpms/| perl -ne '/MariaDB-server-(\d[^"]*).el8.x86_64.rpm/ and print "$1\n"' >> .version-info/mariadb.el8.txt
done
for ver in $(grep 10.[3-5] .version-info/mariadb.el8.txt) ; do
short_ver=$(echo $ver|sed -re 's/-[0-9]+$//')
for galera_ver in $( curl -sL https://mirrors.ukfast.co.uk/sites/mariadb/mariadb-${short_ver}/yum/centos8-amd64/rpms/|grep galera|grep -v rhel8|sed -re 's/<a href="galera-([0-9]+-)?([^>]+)\.el8\.x86_64\.rpm">.*$/\2/' ) ; do
echo -n "$ver "
echo $galera_ver
done
done > .version-info/mariadb-galera.el8.txt
curl -s \
https://repo.mysql.com/yum/mysql-5.6-community/el/7/x86_64/ \
https://repo.mysql.com/yum/mysql-5.7-community/el/7/x86_64/ \
https://repo.mysql.com/yum/mysql-8.0-community/el/7/x86_64/ \
| sed -rne 's/^.*HREF="mysql-community-server-([0-9].*)\.el.\.x86_64\.rpm".*$/\1/p' \
| sort -t. -k 1,1n -k 2,2n -k 3,3n \
> .version-info/mysql.el7.txt
curl -s \
https://repo.mysql.com/yum/mysql-8.0-community/el/8/x86_64/ \
| sed -rne 's/^.*HREF="mysql-community-server-([0-9].*)\.el.\.x86_64\.rpm".*$/\1/p' \
| sort -t. -k 1,1n -k 2,2n -k 3,3n \
> .version-info/mysql.el8.txt
curl -sL https://repo.mysql.com/apt/ubuntu/pool/mysql-5.6/m/mysql-community/ https://repo.mysql.com/apt/ubuntu/pool/mysql-5.7/m/mysql-community/ https://repo.mysql.com/apt/ubuntu/pool/mysql-8.0/m/mysql-community/ > .version-info/mysql-ubuntu-versions.txt
sed -rne 's/^.*HREF="mysql-community-server_([0-9].*)ubuntu18.04_amd64\.deb.*$/\1/p' .version-info/mysql-ubuntu-versions.txt | sort -t. -k 1,1n -k 2,2n -k 3,3n > .version-info/mysql.bionic.txt
sed -rne 's/^.*HREF="mysql-community-server_([0-9].*)ubuntu20.04_amd64\.deb.*$/\1/p' .version-info/mysql-ubuntu-versions.txt | sort -t. -k 1,1n -k 2,2n -k 3,3n > .version-info/mysql.focal.txt
rm .version-info/mysql-ubuntu-versions.txt
curl -sL https://repo.mysql.com/apt/debian/pool/mysql-5.6/m/mysql-community/ https://repo.mysql.com/apt/debian/pool/mysql-5.7/m/mysql-community/ https://repo.mysql.com/apt/debian/pool/mysql-8.0/m/mysql-community/|egrep -i 'mysql-server_.*(debian9|debian10)_amd64.deb' > .version-info/mysql-debian-versions.txt
grep debian9 .version-info/mysql-debian-versions.txt|sed -re 's,^.*A HREF="mysql-server_([^"]+)debian.*$,\1,' | egrep -v 'rc|dmr' > .version-info/mysql.stretch.txt
grep debian10 .version-info/mysql-debian-versions.txt|sed -re 's,^.*A HREF="mysql-server_([^"]+)debian.*$,\1,' | egrep -v 'rc|dmr' > .version-info/mysql.buster.txt
rm .version-info/mysql-debian-versions.txt
curl -s \
https://repo.mysql.com/yum/mysql-cluster-7.5-community/el/7/x86_64/ \
https://repo.mysql.com/yum/mysql-cluster-7.6-community/el/7/x86_64/ \
https://repo.mysql.com/yum/mysql-cluster-8.0-community/el/7/x86_64/ \
| grep mysql-cluster-community-server | grep -v debuginfo \
| sed -re 's/^.*HREF="mysql-cluster-community-server-(.[-.0-9]+).el.*/\1/i' \
| sort -t. -k 1,1n -k 2,2n -k 3,3n \
> .version-info/mysql_ndb.el7.txt
if test -f /usr/bin/which && which jq &>/dev/null ; then
curl -s 'https://hub.docker.com/v2/repositories/percona/pmm-server/tags/?page_size=10000' \
| jq -r '.results|.[]|.name'|egrep '[0-9]*\.[0-9]*\.[0-9]*' \
| sort -t. -k 1,1n -k 2,2n -k 3,3n \
> .version-info/pmm-server.txt
else
cat > .version-info/pmm-server.txt <<EOF
1.17.1
1.17.2
1.17.3
1.17.4
2.0.0
2.0.1
2.1.0
2.2.0
2.2.1
2.2.2
2.3.0
2.4.0
2.5.0
2.6.0
2.6.1
2.8.0
2.9.1
2.10.0
2.10.1
2.11.0
2.11.1
2.12.0
2.13.0
2.14.0
2.15.0
2.15.1
EOF
fi
curl -sL https://repo.percona.com/percona/yum/release/7/RPMS/x86_64/ \
| perl -ne '/percona-toolkit-([0-9.-]*).el7.x86_64.rpm/ and print "$1\n"' | sort -n -t . -k1,1 -k2,2 -k3,3 > .version-info/percona-toolkit.el7.txt
curl -sL https://repo.percona.com/percona/yum/release/8/RPMS/x86_64/ \
| perl -ne '/percona-toolkit-([0-9.-]*).el8.x86_64.rpm/ and print "$1\n"' | sort -n -t . -k1,1 -k2,2 -k3,3 > .version-info/percona-toolkit.el8.txt
curl -sL https://repo.percona.com/pt/apt/pool/main/p/percona-toolkit/ \
| perl -ne '/percona-toolkit_([^"]*).focal_amd64.deb/ and print "$1\n"' | sort -n -t . -k1,1 -k2,2 -k3,3 > .version-info/percona-toolkit.focal.txt
curl -sL https://repo.percona.com/percona/yum/release/7/RPMS/x86_64/ | perl -ne '/pmm2?-client-([0-9.-]*).el7.x86_64.rpm/ and print "$1\n"' | sort -n -t . -k1,1 -k2,2 -k3,3 > .version-info/pmm-client.el7.txt
curl -sL https://repo.percona.com/percona/yum/release/8/RPMS/x86_64/ | perl -ne '/pmm2?-client-([0-9.-]*).el8.x86_64.rpm/ and print "$1\n"' | sort -n -t . -k1,1 -k2,2 -k3,3 > .version-info/pmm-client.el8.txt
cat > .version-info/ppg.el7.txt <<EOF
12.2-4
12.3-1
12.4-2
12.5-1
12.6-1
12.7-1
12.8-1
12.9-2
13.0-1
13.1-1
13.2-2
13.3-2
13.4-1
13.5-1
13.5-2
EOF
cp .version-info/ppg.el7.txt .version-info/ppg.el8.txt
cat > .version-info/ppg2.el8.txt <<EOF
13.0-1 221-1
13.1-1 223-1
13.2-2 223-1
13.3-2 226-1
13.4-1 226-2
13.5-1 230-1
13.5-2 230-2
EOF
cat > .version-info/ppg.focal.txt <<EOF
13-1.1
13-2.2
13-3.2
13-4.1
13.5-2
EOF
cat > .version-info/ppg2.focal.txt <<EOF
13-1.1 223-1
13-2.2 225-1
13-3.2 226-1
13-4.1 226-3
13.5-2 230-2
EOF
curl -sL https://download.postgresql.org/pub/repos/yum/9.5/redhat/rhel-7-x86_64/ https://download.postgresql.org/pub/repos/yum/9.6/redhat/rhel-7-x86_64/ https://download.postgresql.org/pub/repos/yum/10/redhat/rhel-7-x86_64/ https://download.postgresql.org/pub/repos/yum/11/redhat/rhel-7-x86_64/ https://download.postgresql.org/pub/repos/yum/12/redhat/rhel-7-x86_64/ https://download.postgresql.org/pub/repos/yum/13/redhat/rhel-7-x86_64/ https://download.postgresql.org/pub/repos/yum/14/redhat/rhel-7-x86_64/ |sed -nre 's/^.*href="postgresql[0-9.]+-server-(.*)PGDG.*.rpm".*$/\1/p' | sort -n -t . -k1,1 -k2,2 -k3,3 > .version-info/pg.el7.txt
curl -sL https://download.postgresql.org/pub/repos/yum/9.6/redhat/rhel-8-x86_64/ https://download.postgresql.org/pub/repos/yum/10/redhat/rhel-8-x86_64/ https://download.postgresql.org/pub/repos/yum/11/redhat/rhel-8-x86_64/ https://download.postgresql.org/pub/repos/yum/12/redhat/rhel-8-x86_64/ https://download.postgresql.org/pub/repos/yum/13/redhat/rhel-8-x86_64/ https://download.postgresql.org/pub/repos/yum/14/redhat/rhel-8-x86_64/ |sed -nre 's/^.*href="postgresql[0-9.]+-server-(.*)PGDG.*.rpm".*$/\1/p' | sort -n -t . -k1,1 -k2,2 -k3,3 > .version-info/pg.el8.txt
# curl -s https://apt-archive.postgresql.org/pub/repos/apt/dists/focal-pgdg-archive/main/binary-amd64/Packages.bz2 | bzcat
cat > .version-info/pg.focal.txt <<EOF
13.0-1.pgdg20.04+1
13.1-1.pgdg20.04+1
13.2-1.pgdg20.04+1
13.3-1.pgdg20.04+1
13.4-1.pgdg20.04+1
13.4-4.pgdg20.04+1
13.5-1.pgdg20.04+1
13.5-2.pgdg20.04+1
EOF
cat > .version-info/pg2.focal.txt <<EOF
13.0-1.pgdg20.04+1 220.pgdg20.04+1
13.1-1.pgdg20.04+1 225.pgdg20.04+1
13.2-1.pgdg20.04+1 225.pgdg20.04+1
13.3-1.pgdg20.04+1 226.pgdg20.04+1
13.4-1.pgdg20.04+1 226.pgdg20.04+1
13.4-4.pgdg20.04+1 226.pgdg20.04+1
13.5-1.pgdg20.04+1 226.pgdg20.04+1
13.5-2.pgdg20.04+1 226.pgdg20.04+1
EOF
cat > .version-info/pko4psmdb.txt <<EOF
master
main
0.1.0
0.2.0
0.2.1
0.3.0
1.0.0
1.1.0
1.2.0
1.3.0
1.4.0
1.5.0
1.6.0
1.7.0
1.8.0
1.9.0
1.10.0
1.11.0
1.12.0
1.13.0
EOF
cat > .version-info/pko4ps.txt <<EOF
main
0.1.0
0.2.0
EOF
cat > .version-info/pko4pxc.txt <<EOF
master
main
0.1.0
0.2.0
0.3.0
1.0.0
1.1.0
1.2.0
1.3.0
1.4.0
1.5.0
1.6.0
1.7.0
1.8.0
1.9.0
1.10.0
1.11.0
EOF
cat > .version-info/percona_postgres_op.txt << EOF
master
main
0.1.0
0.2.0
1.0.0
1.1.0
1.2.0
1.3.0
EOF
cat > .version-info/zalando_pg.txt <<EOF
1.0.0
1.1.0
1.2.0
1.3.0
1.3.1
1.4.0
1.5.0
1.6.0
1.6.1
1.6.2
1.6.3
1.7.0
1.7.1
EOF
cat > .version-info/vites.txt <<EOF
10.0.2
EOF
cat > .version-info/pgpool.el7.txt <<EOF
4.2.0-1
4.2.1-1
4.2.2-1
EOF
cat > .version-info/odyssey.el8.txt <<EOF
1.1
EOF
cat > .version-info/walg.el7.txt <<EOF
0.2.15
0.2.16
0.2.19
EOF
cat > .version-info/sysbench.el7.txt <<EOF
1.0.20-6
EOF
cp .version-info/sysbench.el7.txt .version-info/sysbench.el8.txt
cp .version-info/sysbench.el7.txt .version-info/sysbench.focal.txt
cat > .version-info/proxysql.el7.txt <<EOF
1.3.10-1
EOF
curl -sL \
https://repo.proxysql.com/ProxySQL/proxysql-1.4.x/centos/7/ \
https://repo.proxysql.com/ProxySQL/proxysql-2.0.x/centos/7/ \
https://repo.proxysql.com/ProxySQL/proxysql-2.1.x/centos/7/ \
| perl -ne '/proxysql-([0-9.-]*).centos7.x86_64.rpm/ and print "$1\n"' \
| sort -n -t . -k1,1 -k2,2 -k3,3 \
>> .version-info/proxysql.el7.txt
curl -sL \
https://repo.proxysql.com/ProxySQL/proxysql-1.4.x/centos/8/ \
https://repo.proxysql.com/ProxySQL/proxysql-2.0.x/centos/8/ \
https://repo.proxysql.com/ProxySQL/proxysql-2.1.x/centos/8/ \
| perl -ne '/proxysql-([0-9.-]*).centos8.x86_64.rpm/ and print "$1\n"' \
| sort -n -t . -k1,1 -k2,2 -k3,3 \
> .version-info/proxysql.el8.txt
curl -sL \
https://repo.proxysql.com/ProxySQL/proxysql-2.0.x/focal/ \
https://repo.proxysql.com/ProxySQL/proxysql-2.1.x/focal/ \
| perl -ne '/proxysql_([0-9.-]*)-ubuntu20_amd64.deb/ and print "$1\n"' \
| sort -n -t . -k1,1 -k2,2 -k3,3 \
> .version-info/proxysql.focal.txt
curl -sL https://api.github.com/repos/maxbube/mydumper/releases|sed -nr -e 's/^.*name.*mydumper-(.*)\.el7\.x86_64\.rpm.*$/\1/p' | sort -n -t . -k1,1 -k2,2 -k3,3 > .version-info/mydumper.el7.txt
curl -sL https://api.github.com/repos/maxbube/mydumper/releases|sed -nr -e 's/^.*name.*mydumper-(.*)\.el8\.x86_64\.rpm.*$/\1/p' | sort -n -t . -k1,1 -k2,2 -k3,3 > .version-info/mydumper.el8.txt
cat > .version-info/mydumper.focal.txt <<EOF
10.1-2
EOF
cat > .version-info/mysql-jdbc.txt <<EOF
8.0.17-1
8.0.18-1
8.0.19-1
8.0.20-1
8.0.21-1
8.0.22-1
8.0.23-1
EOF
cat > .version-info/percona-orchestrator.el7.txt <<EOF
3.2.6-6
EOF
cp .version-info/percona-orchestrator.el7.txt .version-info/percona-orchestrator.el8.txt
cp .version-info/percona-orchestrator.el7.txt .version-info/percona-orchestrator.el9.txt
for osver in 7 8 9 ; do
curl -sL https://repo.percona.com/pdps-8.0/yum/release/$osver/RPMS/x86_64/ \
| perl -ne '/percona-orchestrator-(\d[^"]*).el'$osver'.x86_64.rpm/ and print "$1\n"' | sort -n -t . -k1,1 -k2,2 -k3,3 > .version-info/percona-orchestrator.el$osver.txt
done
cat > .version-info/orchestrator.el7.txt <<EOF
3.0.3-1
3.0.5-1
3.0.6-1
3.0.7-1
3.0.8-1
3.0.9-1
3.0.10-1
3.0.11-1
3.0.12-1
3.0.13-1
3.0.14-1
3.1.0-1
3.1.2-1
3.1.3-1
3.1.4-1
3.2.2-1
3.2.3-1
3.2.4-1
EOF
cat .version-info/orchestrator.el7.txt > .version-info/orchestrator.el8.txt
sed -e 's/-1//' .version-info/orchestrator.el7.txt > .version-info/orchestrator.focal.txt
sed -e 's/-1//' .version-info/orchestrator.el7.txt > .version-info/orchestrator.bionic.txt
curl -sL https://repo.percona.com/pbm/yum/release/7/RPMS/x86_64/ \
| perl -ne '/percona-backup-mongodb-([^"]*).el7.x86_64.rpm/ and print "$1\n"'|sort -n --field-separator=. -k 1,1 -k 2,2 -k 3,3 > .version-info/pbm.el7.txt
curl -sL https://repo.percona.com/pbm/yum/release/7/RPMS/x86_64/ \
| perl -ne '/percona-backup-mongodb-([^"]*).el8.x86_64.rpm/ and print "$1\n"'|sort -n --field-separator=. -k 1,1 -k 2,2 -k 3,3 > .version-info/pbm.el8.txt
curl -sL https://repo.percona.com/percona/yum/release/7/RPMS/x86_64/ \
| perl -ne '/Percona-Server-MongoDB(-\d\d)?-server-([^"]*).el7.x86_64.rpm/ and print "$2\n"'|sort -n --field-separator=. -k 1,1 -k 2,2 -k 3,3 > .version-info/psmdb.el7.txt
curl -sL https://repo.percona.com/psmdb-40/yum/release/7/RPMS/x86_64/ \
| perl -ne '/percona-server-mongodb(-\d\d)?-server-([^"]*).el7.x86_64.rpm/ and print "$2\n"'|sort -n --field-separator=. -k 1,1 -k 2,2 -k 3,3 >> .version-info/psmdb.el7.txt
curl -sL https://repo.percona.com/pdmdb-4.2/yum/release/7/RPMS/x86_64/ \
| perl -ne '/percona-server-mongodb(-\d\d)?-server-([^"]*).el7.x86_64.rpm/ and print "$2\n"'|sort -n --field-separator=. -k 1,1 -k 2,2 -k 3,3 >> .version-info/psmdb.el7.txt
curl -sL https://repo.percona.com/pdmdb-4.4/yum/release/7/RPMS/x86_64/ \
| perl -ne '/percona-server-mongodb(-\d\d)?-server-([^"]*).el7.x86_64.rpm/ and print "$2\n"'|sort -n --field-separator=. -k 1,1 -k 2,2 -k 3,3 >> .version-info/psmdb.el7.txt