Compare commits

..
858 Commits
Author SHA1 Message Date
Mr Chen 3e51722085 Merge pull request #620 from midoks/dev
0.17.2
2024-07-26 23:08:01 +08:00
Mr Chen d5f5287ca3 Update README.md 2024-07-26 23:06:46 +08:00
Mr Chen f0f491fa86 Update README.md 2024-07-26 23:05:02 +08:00
Mr Chen bbaa00a479 Update README.md 2024-07-26 23:03:43 +08:00
Mr Chen 6df248ec22 Update config_api.py 2024-07-26 22:59:43 +08:00
Mr Chen eae61c827d Update cert_api.py 2024-07-26 22:58:38 +08:00
Mr Chen eed5c91435 Update redis_simple.conf 2024-07-26 22:52:55 +08:00
Mr Chen 9e09952471 update 2024-07-26 19:22:57 +08:00
Mr Chen 46a3591019 Update index.py 2024-07-26 17:00:52 +08:00
Mr Chen 5419a01b5c Update cert_api.py 2024-07-26 12:59:59 +08:00
Mr Chen 3770ebc0f3 Update cert_api.py 2024-07-26 12:58:52 +08:00
Mr Chen 209ae03e63 Update cert_api.py 2024-07-26 12:44:52 +08:00
Mr Chen fc7609874d Update cert_api.py 2024-07-26 12:43:32 +08:00
Mr Chen 3c99f17158 Update cert_api.py 2024-07-26 12:18:04 +08:00
Mr Chen 6fb3a52e31 Update my.cnf 2024-07-25 15:37:06 +08:00
Mr Chen 4f6a626e3e Update install.sh 2024-07-25 13:57:48 +08:00
Mr Chen 7021015a66 Update install.sh 2024-07-25 13:33:00 +08:00
Mr Chen 185c5cb45b Update ubuntu.sh 2024-07-25 12:34:37 +08:00
Mr Chen 011d3dccaa update 2024-07-25 12:30:09 +08:00
Mr Chen a629eeac55 Update ubuntu.sh 2024-07-25 12:29:28 +08:00
Mr Chen d3ce4a1aac Update firewall_api.py 2024-07-25 12:23:00 +08:00
Mr Chen 8ff13fac5b Update install.sh 2024-07-25 02:43:57 +08:00
Mr Chen d5c232201b update 2024-07-25 01:27:44 +08:00
Mr Chen fb4e16790e Update install.sh 2024-07-25 00:53:35 +08:00
Mr Chen be4cdd194d Update install.sh 2024-07-25 00:52:07 +08:00
Mr Chen 398165d832 update 2024-07-25 00:49:00 +08:00
Mr Chen 7d70fdcd1d Update install.sh 2024-07-25 00:39:29 +08:00
Mr Chen 5c33504582 Update install.sh 2024-07-25 00:39:04 +08:00
Mr Chen e4223a7a58 Update install.sh 2024-07-25 00:36:34 +08:00
Mr Chen f2d5e166da Update install.sh 2024-07-25 00:36:11 +08:00
Mr Chen 55d0f2fad8 Update install.sh 2024-07-25 00:35:43 +08:00
Mr Chen 58068a06dd Update install.sh 2024-07-25 00:34:59 +08:00
Mr Chen 01a76ff5de Update install.sh 2024-07-24 23:16:36 +08:00
Mr Chen 53dd0d81e7 update 2024-07-24 23:07:08 +08:00
Mr Chen 8d4b5e8403 Update install.sh 2024-07-24 22:31:25 +08:00
Mr Chen c6e491a9bc Update install.sh 2024-07-24 22:19:39 +08:00
Mr Chen 55f6a3189c Update install.sh 2024-07-24 22:19:31 +08:00
Mr Chen dfaa041843 update 2024-07-24 21:03:48 +08:00
Mr Chen 0bcf0465a6 Update plugins_api.py 2024-07-24 20:56:15 +08:00
Mr Chen 517c65b790 Update plugins_api.py 2024-07-24 20:55:42 +08:00
Mr Chen 4bda6ab1b1 Update cert_api.py 2024-07-24 20:53:58 +08:00
Mr Chen 5a71ec8d6c Update index.py 2024-07-24 14:48:47 +08:00
Mr Chen f622ea6779 update 2024-07-24 14:46:10 +08:00
Mr Chen 875db69bcf Update index.py 2024-07-24 14:33:47 +08:00
Mr Chen 97a07b4955 Update index.py 2024-07-24 14:32:35 +08:00
Mr Chen 0912360794 Update index.py 2024-07-24 14:30:42 +08:00
Mr Chen bfc2a82384 Update install.sh 2024-07-24 14:26:08 +08:00
Mr Chen 6f02ccf6e7 update 2024-07-24 14:21:36 +08:00
Mr Chen 36e7085ce0 update 2024-07-24 14:10:30 +08:00
Mr Chen 044f130671 update 2024-07-24 14:04:38 +08:00
Mr Chen bf95d50cfd Update install.sh 2024-07-24 14:03:22 +08:00
Mr Chen 63349ce33b Update index.py 2024-07-24 13:48:03 +08:00
Mr Chen 3618940713 Update index.py 2024-07-24 13:45:17 +08:00
Mr Chen f5f9064c52 Update index.py 2024-07-24 13:45:08 +08:00
Mr Chen fd8bda7f48 Update index.py 2024-07-24 13:44:51 +08:00
Mr Chen 5e9b5466a6 Update ubuntu.sh 2024-07-24 13:43:15 +08:00
Mr Chen 82a0fde37c Update index.py 2024-07-24 13:40:53 +08:00
Mr Chen 72367c40fe update 2024-07-24 13:29:14 +08:00
Mr Chen b8502c7459 update 2024-07-24 13:22:26 +08:00
Mr Chen 6b33cfe6bb update 2024-07-24 13:16:21 +08:00
Mr Chen 81e61a469e Update index.py 2024-07-24 13:08:04 +08:00
Mr Chen 267213efc1 Update install.sh 2024-07-24 12:57:12 +08:00
Mr Chen 03ca9512a4 Update index.py 2024-07-24 12:33:44 +08:00
Mr Chen e77b24a213 Update index.py 2024-07-24 12:30:50 +08:00
Mr Chen 6118c49335 Update index.py 2024-07-24 12:21:08 +08:00
Mr Chen 843321dfe5 Update install.sh 2024-07-24 12:13:47 +08:00
Mr Chen bd13bc8d68 Update index.py 2024-07-24 12:08:18 +08:00
Mr Chen 9f8af72c70 Update index.py 2024-07-24 12:07:00 +08:00
Mr Chen 50e3173706 Update index.py 2024-07-24 12:06:53 +08:00
Mr Chen a43bfbebab Update index.py 2024-07-24 12:02:38 +08:00
Mr Chen ffaac9553e Update cert_api.py 2024-07-24 01:26:50 +08:00
Mr Chen f480cbeda4 Update cert_api.py 2024-07-24 01:26:14 +08:00
Mr Chen e8a72a0b7a Update cert_api.py 2024-07-24 01:23:15 +08:00
Mr Chen b4b14d2c28 Update cert_api.py 2024-07-24 01:21:25 +08:00
Mr Chen 672ebb013f Update cert_api.py 2024-07-24 01:20:47 +08:00
Mr Chen 8e5f1ae809 Update cert_api.py 2024-07-24 01:17:49 +08:00
Mr Chen 1cf77806ba Update cert_api.py 2024-07-24 01:17:34 +08:00
Mr Chen d1a6c61bd8 Update install.sh 2024-07-24 01:15:47 +08:00
Mr Chen e15cb57c27 Update update.sh 2024-07-24 01:09:02 +08:00
Mr Chen c187c36c51 Update update_dev.sh 2024-07-24 01:07:56 +08:00
Mr Chen 5bec8e0c38 Update install_dev.sh 2024-07-24 01:04:16 +08:00
Mr Chen ed4a58025b Update phplib.conf 2024-07-24 00:46:26 +08:00
Mr Chen 67178757c0 Update common.sh 2024-07-24 00:44:16 +08:00
Mr Chen d4679e2b5c Update common.sh 2024-07-24 00:44:08 +08:00
Mr Chen 7b8ecd520c Delete yaf.sh 2024-07-24 00:42:09 +08:00
Mr Chen f2c188b245 Update yaf.sh 2024-07-24 00:36:09 +08:00
Mr Chen 8ca6c32a76 Update yaf.sh 2024-07-24 00:35:43 +08:00
Mr Chen e6ac37644b Create yaf.sh 2024-07-24 00:32:43 +08:00
Mr Chen 048df7e1e7 Update install.sh 2024-07-24 00:16:21 +08:00
Mr Chen 73f0ed73d4 update 2024-07-23 23:17:02 +08:00
Mr Chen 4ce9a8cc0f Update ioncube.sh 2024-07-23 22:30:13 +08:00
Mr Chen 3c6538565e Update phalcon.sh 2024-07-23 22:27:29 +08:00
Mr Chen 995fa234d9 Update phalcon.sh 2024-07-23 22:24:31 +08:00
Mr Chen efa9890019 Update phplib.conf 2024-07-23 22:19:56 +08:00
Mr Chen d7f710d3e0 Update phplib.conf 2024-07-23 22:12:11 +08:00
Mr Chen 552cab5632 Update phplib.conf 2024-07-23 22:10:27 +08:00
Mr Chen 4d32683e66 Update index.py 2024-07-23 21:48:30 +08:00
Mr Chen 2cd41b91f5 Create install.sh 2024-07-23 21:47:58 +08:00
Mr Chen d26f840b68 Update phplib.conf 2024-07-23 21:43:52 +08:00
Mr Chen 93ddd3c2c4 Update yar.sh 2024-07-23 21:42:42 +08:00
Mr Chen 95dcd4c04d Update yaf.sh 2024-07-23 21:42:16 +08:00
Mr Chen a886359e94 Update yar.sh 2024-07-23 21:35:43 +08:00
Mr Chen 1d48010a0d Update phplib.conf 2024-07-23 21:31:47 +08:00
Mr Chen b220628ca1 Update phplib.conf 2024-07-23 21:28:12 +08:00
Mr Chen c7a8ca2ec9 Update install.sh 2024-07-23 21:23:56 +08:00
Mr Chen 9720cf7a69 update 2024-07-23 21:22:35 +08:00
Mr Chen 4eb33806bf Update info.json 2024-07-23 20:43:32 +08:00
Mr Chen 3d12bbcdd1 Update info.json 2024-07-23 20:43:06 +08:00
Mr Chen fa8b2aefb7 Update info.json 2024-07-23 18:55:29 +08:00
Mr Chen e08bea00eb Update info.json 2024-07-23 16:17:00 +08:00
Mr Chen 8427a0d9be update 2024-07-23 16:00:07 +08:00
Mr Chen 79a44f4b15 Update index.py 2024-07-23 15:21:48 +08:00
Mr Chen 2dba6e6816 Update index.py 2024-07-23 15:17:37 +08:00
Mr Chen 258576963d Update index.py 2024-07-23 15:14:52 +08:00
Mr Chen 68e9ffffe3 Update index.py 2024-07-23 15:14:13 +08:00
Mr Chen b26717eab3 Create my9.0.cnf 2024-07-23 15:08:54 +08:00
Mr Chen 83810a8dd8 Update index.py 2024-07-23 15:05:11 +08:00
Mr Chen 3ba6d5c3c4 Update index.py 2024-07-23 15:04:00 +08:00
Mr Chen c6b5a92e7d Update mysql9.0.service.tpl 2024-07-23 14:54:47 +08:00
Mr Chen 8a5e2a45dc update 2024-07-23 14:52:50 +08:00
Mr Chen 0fd5ef28e2 Update index.py 2024-07-23 14:42:57 +08:00
Mr Chen fcb5a44abe Create my9.0.cnf 2024-07-23 14:33:31 +08:00
Mr Chen fb83cb40df update 2024-07-23 14:28:09 +08:00
Mr Chen 4211934490 update 2024-07-23 14:23:08 +08:00
Mr Chen 4ca64694ff Update install.sh 2024-07-23 14:17:28 +08:00
Mr Chen 75d13f3cc7 Update install.sh 2024-07-23 14:12:53 +08:00
Mr Chen db14ede309 Update install.sh 2024-07-23 14:04:37 +08:00
Mr Chen 9e2d17f3f3 update 2024-07-23 14:03:43 +08:00
Mr Chen 7af56e1c56 update 2024-07-23 14:02:57 +08:00
Mr Chen 0c06ae6028 Update install.sh 2024-07-23 13:46:24 +08:00
Mr Chen c39076dfb7 Update install.sh 2024-07-23 12:50:13 +08:00
Mr Chen fd81666453 update 2024-07-23 12:49:46 +08:00
Mr Chen 2e7afad20b update 2024-07-23 12:47:30 +08:00
Mr Chen c962c6f86a update 2024-07-23 12:43:11 +08:00
Mr Chen 277939ba29 update 2024-07-23 11:02:30 +08:00
Mr Chen c7f3445e79 update 2024-07-23 11:00:46 +08:00
Mr Chen c1a1e80185 Update install.sh 2024-07-23 10:44:55 +08:00
Mr Chen 16892d474e Update site_api.py 2024-07-23 00:52:56 +08:00
Mr Chen 167977a3d1 Update site_api.py 2024-07-23 00:50:01 +08:00
Mr Chen bc876232f9 Update site_api.py 2024-07-23 00:49:43 +08:00
Mr Chen d529ff596b Update __init__.py 2024-07-23 00:45:14 +08:00
Mr Chen c7cad36fde Update cert_api.py 2024-07-23 00:17:38 +08:00
Mr Chen b299d5f74b Update cert_api.py 2024-07-23 00:17:10 +08:00
Mr Chen 20df24ca80 Update cert_api.py 2024-07-23 00:16:59 +08:00
Mr Chen 2482a24898 Update info.json 2024-07-22 23:30:24 +08:00
Mr Chen 9621f112d1 update 2024-07-22 23:13:15 +08:00
Mr Chen 82e2ee2aea Update ubuntu.sh 2024-07-22 23:05:33 +08:00
Mr Chen b602ab678f Merge pull request #619 from midoks/dev
update
2024-07-20 19:25:15 +08:00
Mr Chen 03a5f750ec Update install.sh 2024-07-20 19:24:52 +08:00
Mr Chen e3888244ac update 2024-07-20 19:00:27 +08:00
Mr Chen d0a513d64d Update zabbix.js 2024-07-20 18:38:57 +08:00
Mr Chen 26817c7e61 update 2024-07-20 18:35:32 +08:00
Mr Chen cad77c69d9 update 2024-07-20 17:49:25 +08:00
Mr Chen ad0b667ed2 update 2024-07-20 17:43:29 +08:00
Mr Chen bc6c1886b9 Update index.py 2024-07-20 17:37:08 +08:00
Mr Chen 084843586e Update zabbix_agentd.conf 2024-07-20 17:32:38 +08:00
Mr Chen 981e320664 Update index.py 2024-07-20 17:29:22 +08:00
Mr Chen e57e043edf Update README.md 2024-07-20 14:33:13 +08:00
Mr Chen 5045af850f Merge pull request #618 from midoks/dev
增加zabbix插件
2024-07-20 14:32:37 +08:00
Mr Chen 59f80800c3 Update index.py 2024-07-20 14:27:37 +08:00
Mr Chen ae4db462b0 Update index.py 2024-07-20 14:19:10 +08:00
Mr Chen ab939aa359 Update index.py 2024-07-20 14:16:58 +08:00
Mr Chen e90c4a0e19 Update opensuse.sh 2024-07-20 13:39:25 +08:00
Mr Chen bed6b7c347 Update opensuse.sh 2024-07-20 13:22:37 +08:00
Mr Chen f626291e2e Update opensuse.sh 2024-07-20 13:10:55 +08:00
Mr Chen 996e452966 Update index.py 2024-07-20 13:06:50 +08:00
Mr Chen d32ccbce0c update_dev 2024-07-20 13:01:23 +08:00
Mr Chen 72b44bcceb Update install.sh 2024-07-20 12:47:40 +08:00
Mr Chen ed02c3bad6 Update install.sh 2024-07-20 12:46:06 +08:00
Mr Chen 86deba3111 Update install.sh 2024-07-20 12:32:39 +08:00
Mr Chen dbc7fc08a8 Update install.sh 2024-07-20 12:30:52 +08:00
Mr Chen 948dadcf57 Update install.sh 2024-07-20 12:29:31 +08:00
Mr Chen f0a7ceb255 Update install.sh 2024-07-20 12:25:58 +08:00
Mr Chen c14bd47ad2 update 2024-07-20 12:25:27 +08:00
Mr Chen 0824c0f509 Update install.sh 2024-07-20 12:24:29 +08:00
Mr Chen 0177e3d7bb update 2024-07-20 12:24:07 +08:00
Mr Chen 159701e840 Create opensuse.sh 2024-07-20 12:16:42 +08:00
Mr Chen 1c47a4cc2f update 2024-07-20 12:16:00 +08:00
Mr Chen f9caafcb86 update 2024-07-20 12:09:40 +08:00
Mr Chen da6d8aa797 Update opensuse.sh 2024-07-20 12:08:24 +08:00
Mr Chen 88a846aef1 Update opensuse.sh 2024-07-20 12:06:02 +08:00
Mr Chen 6ee0780fec update 2024-07-20 12:04:37 +08:00
Mr Chen 116549329c Update install.sh 2024-07-20 11:41:19 +08:00
Mr Chen 11d90b704a Update install.sh 2024-07-20 11:41:06 +08:00
Mr Chen 8bdc60e75a Update install.sh 2024-07-20 11:39:58 +08:00
Mr Chen 7fd3e4e0a7 update 2024-07-20 11:39:17 +08:00
Mr Chen 18ed21b36a Update index.py 2024-07-20 11:32:58 +08:00
Mr Chen b77801112f Update zabbix.js 2024-07-20 11:09:11 +08:00
Mr Chen efb237c783 Update centos.sh 2024-07-20 10:30:55 +08:00
Mr Chen 15375c575a update 2024-07-20 10:30:24 +08:00
Mr Chen e5dc00dbd3 Update index.py 2024-07-20 10:26:30 +08:00
Mr Chen 8d8231f787 Create centos.sh 2024-07-20 10:21:15 +08:00
Mr Chen 025ed5aa5a Create rocky.sh 2024-07-20 03:25:43 +08:00
Mr Chen b62d228ec8 Update index.py 2024-07-20 03:09:49 +08:00
Mr Chen 01894ad91e Update index.py 2024-07-20 03:09:29 +08:00
Mr Chen ee3258196b Update index.py 2024-07-20 03:08:52 +08:00
Mr Chen b1ce9fb05e Update index.py 2024-07-20 03:07:33 +08:00
Mr Chen 2c996b0a41 Update index.py 2024-07-20 03:06:19 +08:00
Mr Chen e4ded8950e Update install.sh 2024-07-20 03:03:10 +08:00
Mr Chen 11a69cfb8b Update index.py 2024-07-20 03:00:06 +08:00
Mr Chen 85fa8fcbd1 update 2024-07-20 02:51:09 +08:00
Mr Chen 68b2bcee33 Create rocky.sh 2024-07-20 02:38:44 +08:00
Mr Chen 1796eecc9b Create rocky.sh 2024-07-20 02:37:58 +08:00
Mr Chen d6b0601f74 Update index.py 2024-07-20 02:29:00 +08:00
Mr Chen 2c250ee67c Update index.py 2024-07-20 02:28:41 +08:00
Mr Chen 5b451e211f Update index.py 2024-07-20 02:26:13 +08:00
Mr Chen 1389f210de Update index.py 2024-07-20 02:25:19 +08:00
Mr Chen b0f0706dfd Update index.py 2024-07-20 02:23:39 +08:00
Mr Chen 8f66e8c39e Update index.py 2024-07-20 02:22:56 +08:00
Mr Chen 3c788afce6 Update zabbix_server6.conf 2024-07-20 02:21:16 +08:00
Mr Chen e03ada5191 Update zabbix_server6.conf 2024-07-20 02:21:02 +08:00
Mr Chen 7998177e03 Update zabbix_server6.conf 2024-07-20 02:18:40 +08:00
Mr Chen aef54656d2 update 2024-07-20 02:16:43 +08:00
Mr Chen 9b52fee2a7 Update index.py 2024-07-20 01:53:29 +08:00
Mr Chen f89be00419 Update index.py 2024-07-20 01:48:36 +08:00
Mr Chen bad4415650 Update index.py 2024-07-20 01:46:13 +08:00
Mr Chen e5f3e85f8b Update install.sh 2024-07-20 01:32:12 +08:00
Mr Chen 0c45a5035b Create alma.sh 2024-07-20 01:21:07 +08:00
Mr Chen c3347fcb28 Update alma.sh 2024-07-20 01:18:21 +08:00
Mr Chen a97e8ceee5 Update index.py 2024-07-20 01:16:19 +08:00
Mr Chen 87da782cc3 Update index.py 2024-07-20 01:14:59 +08:00
Mr Chen 7416be6680 Update phplib.conf 2024-07-20 01:11:34 +08:00
Mr Chen df8eb7f9ef Update phplib.conf 2024-07-20 01:06:44 +08:00
Mr Chen 8198ea6941 Update phplib.conf 2024-07-20 01:02:03 +08:00
Mr Chen 6f7513a013 Update install.sh 2024-07-20 00:58:48 +08:00
Mr Chen 5f163b0661 Update index.py 2024-07-20 00:57:36 +08:00
Mr Chen 11a9bd2ecc Update index.py 2024-07-20 00:57:31 +08:00
Mr Chen 1e6f143eb7 Update install.sh 2024-07-20 00:57:10 +08:00
Mr Chen b99bd5fded Update install.sh 2024-07-20 00:56:16 +08:00
Mr Chen 442896eadc Update index.py 2024-07-20 00:50:41 +08:00
Mr Chen 38c7b2d44e Update index.py 2024-07-20 00:50:23 +08:00
Mr Chen 662e983f01 Update index.py 2024-07-20 00:46:41 +08:00
Mr Chen de402e9996 Update install.sh 2024-07-20 00:22:07 +08:00
Mr Chen 69fc4323f3 Update index.py 2024-07-20 00:08:19 +08:00
Mr Chen 617a986325 Update index.py 2024-07-20 00:02:35 +08:00
Mr Chen c09c7fa1a8 Update index.py 2024-07-19 23:59:57 +08:00
Mr Chen 2b43680099 Update ubuntu.sh 2024-07-19 23:59:32 +08:00
Mr Chen c1bb8ad7a6 Update zabbix.nginx.conf 2024-07-19 23:57:10 +08:00
Mr Chen f59c68edb8 Update index.py 2024-07-19 23:55:50 +08:00
Mr Chen 85ae2ff349 Update install.sh 2024-07-19 23:50:45 +08:00
Mr Chen b52635c747 Update ubuntu.sh 2024-07-19 23:41:41 +08:00
Mr Chen d09c8ac98f Create ubuntu.sh 2024-07-19 23:38:33 +08:00
Mr Chen 1921deb7e3 update 2024-07-19 23:37:27 +08:00
Mr Chen a21c7eac02 update 2024-07-19 23:33:39 +08:00
Mr Chen 50ab9c21cd Update index.py 2024-07-19 23:31:21 +08:00
Mr Chen edd1b34217 Update index.py 2024-07-19 23:08:05 +08:00
Mr Chen c1f165bfa3 Create ubuntu.sh 2024-07-19 20:16:24 +08:00
Mr Chen 799be0fd3e Update index.py 2024-07-19 19:48:54 +08:00
Mr Chen 1f8c975c4d Update zabbix_server.conf 2024-07-19 19:43:45 +08:00
Mr Chen b10967bfad Create server6.0.sql.gz 2024-07-19 19:39:51 +08:00
Mr Chen 835cf6ad8f update 2024-07-19 19:34:28 +08:00
Mr Chen 6b55a4e0ca Update index.py 2024-07-19 19:30:39 +08:00
Mr Chen aa3a5a90c4 Update index.py 2024-07-19 19:30:08 +08:00
Mr Chen 5f34d52542 Update index.py 2024-07-19 19:28:52 +08:00
Mr Chen ad49cadfb8 Update index.py 2024-07-19 19:28:42 +08:00
Mr Chen b4c00a2d27 Update index.py 2024-07-19 19:28:17 +08:00
Mr Chen 42dfe63c2f Update index.py 2024-07-19 19:26:53 +08:00
Mr Chen 4fa2588b66 Update index.py 2024-07-19 19:26:32 +08:00
Mr Chen a3227a681a Update index.py 2024-07-19 19:26:09 +08:00
Mr Chen 1abbaa29ff Update info.json 2024-07-19 19:22:37 +08:00
Mr Chen b783a90d81 update 2024-07-19 19:14:21 +08:00
Mr Chen 263243ecd4 update 2024-07-19 19:13:04 +08:00
Mr Chen 5942c2e822 Update index.py 2024-07-19 19:11:05 +08:00
Mr Chen 0a87dcc610 Update index.py 2024-07-19 19:08:27 +08:00
Mr Chen a80e1db128 Update index.py 2024-07-19 17:36:37 +08:00
Mr Chen fad851edea Update index.py 2024-07-19 17:16:50 +08:00
Mr Chen 4d23d7d354 Update index.py 2024-07-19 17:09:11 +08:00
Mr Chen a19fe7b0b5 Update index.py 2024-07-19 16:51:49 +08:00
Mr Chen 15096e7954 Update index.py 2024-07-19 14:58:18 +08:00
Mr Chen 2da9b59ae9 update 2024-07-19 14:55:59 +08:00
Mr Chen c4cda94309 update 2024-07-19 14:52:13 +08:00
Mr Chen d32dd19dd0 Update debian.sh 2024-07-19 11:59:38 +08:00
Mr Chen 269d0dc57e update 2024-07-19 11:47:58 +08:00
Mr Chen bd221e2c75 Update debian.sh 2024-07-18 23:06:48 +08:00
Mr Chen eb26c7d4e1 Create alma.sh 2024-07-18 21:11:44 +08:00
Mr Chen 4de0ecb5cc Update centos.sh 2024-07-18 13:52:45 +08:00
Mr Chen 5753e3fb51 Update centos.sh 2024-07-18 12:53:51 +08:00
Mr Chen 14cf933487 update 2024-07-18 12:33:51 +08:00
Mr Chen df240ac681 Update centos.sh 2024-07-18 12:23:11 +08:00
Mr Chen cf2d53fe0d Update index.py 2024-07-18 12:18:21 +08:00
Mr Chen 520f46441e Update index.py 2024-07-18 12:13:08 +08:00
Mr Chen be1117ba31 Update index.py 2024-07-18 12:07:38 +08:00
Mr Chen e35ff2da63 Update centos.sh 2024-07-18 11:59:24 +08:00
Mr Chen 99f91768ad Update centos.sh 2024-07-18 11:29:09 +08:00
Mr Chen d8e6e63b90 Update info.json 2024-07-18 00:58:25 +08:00
Mr Chen 9f4a3ed53d Update index.py 2024-07-17 19:41:01 +08:00
Mr Chen b06dd84f6b Create centos.sh 2024-07-17 19:38:37 +08:00
Mr Chen bf77d84227 Update index.py 2024-07-17 19:34:33 +08:00
Mr Chen 1ff24a2835 update 2024-07-17 19:32:19 +08:00
Mr Chen a10f31f4fb update 2024-07-17 17:19:26 +08:00
Mr Chen c47dac6731 update 2024-07-17 13:09:20 +08:00
Mr Chen 0de883b5b1 Update debian.sh 2024-07-17 12:26:04 +08:00
Mr Chen a160b5bfac Update zabbix.js 2024-07-17 12:22:03 +08:00
Mr Chen d7580842a8 Update debian.sh 2024-07-16 20:18:43 +08:00
Mr Chen 40dfc60079 Update debian.sh 2024-07-16 20:17:31 +08:00
Mr Chen bfa593ea46 update 2024-07-16 19:29:25 +08:00
Mr Chen 68de2d2c5f Update debian.sh 2024-07-16 18:36:26 +08:00
Mr Chen e883ccfb62 Update debian.sh 2024-07-16 18:14:41 +08:00
Mr Chen 2f530d8c9e Update debian.sh 2024-07-16 18:14:12 +08:00
Mr Chen 43e7363535 Update install.sh 2024-07-16 18:08:03 +08:00
Mr Chen fbe8a06d0b Update install.sh 2024-07-16 18:07:01 +08:00
Mr Chen 421757e88a Update install.sh 2024-07-16 18:06:47 +08:00
Mr Chen 07340dc68c Update index.py 2024-07-16 17:52:51 +08:00
Mr Chen f7559f6a55 Update index.py 2024-07-16 17:36:39 +08:00
Mr Chen dd45fb47d6 Update index.py 2024-07-16 17:35:44 +08:00
Mr Chen d2ade7aa90 Update index.py 2024-07-16 17:31:55 +08:00
Mr Chen 7bed4cda8e Update index.py 2024-07-16 17:28:54 +08:00
Mr Chen 24c37d5b92 Update index.py 2024-07-16 17:18:10 +08:00
Mr Chen c03add82a5 Update debian.sh 2024-07-16 17:13:15 +08:00
Mr Chen 6f443ef414 Update debian.sh 2024-07-16 17:13:05 +08:00
Mr Chen 939b44699f Update debian.sh 2024-07-16 17:09:32 +08:00
Mr Chen db5f979149 Update install.sh 2024-07-16 17:09:16 +08:00
Mr Chen ded03b5c46 update 2024-07-16 17:05:02 +08:00
Mr Chen f755a39589 update 2024-07-16 17:02:52 +08:00
Mr Chen 788c097a50 Update zabbix_server.conf 2024-07-16 15:53:53 +08:00
Mr Chen 3fe4c80784 Update zabbix.conf.php 2024-07-16 15:31:58 +08:00
Mr Chen 74ae353761 Update debian.sh 2024-07-16 15:25:26 +08:00
Mr Chen 05d62c7105 Update index.py 2024-07-16 15:24:36 +08:00
Mr Chen 79ffa0b5b1 Update zabbix_server.conf 2024-07-16 15:23:59 +08:00
Mr Chen ec68096e52 Update debian.sh 2024-07-16 15:20:22 +08:00
Mr Chen 2e79def40d Update zabbix_server.conf 2024-07-16 15:00:33 +08:00
Mr Chen c0fbf71a8e Update index.py 2024-07-16 14:09:56 +08:00
Mr Chen cb62e367ec Update index.py 2024-07-16 14:07:47 +08:00
Mr Chen 1608fae975 Update index.py 2024-07-16 13:52:34 +08:00
Mr Chen 8d1ce42004 Update zabbix.js 2024-07-16 12:30:42 +08:00
Mr Chen fd7314b603 Update index.py 2024-07-16 12:28:16 +08:00
Mr Chen e2433964e9 Update zabbix_agentd.conf 2024-07-16 12:26:44 +08:00
Mr Chen 9ef7b36998 update 2024-07-16 12:12:21 +08:00
Mr Chen 9ae7fd716c Update index.py 2024-07-16 12:11:23 +08:00
Mr Chen 7fbc7bef5e Update index.py 2024-07-16 12:11:14 +08:00
Mr Chen 43bab2a80e update 2024-07-16 12:07:53 +08:00
Mr Chen b4eaec1ca5 Update debian.sh 2024-07-16 12:02:12 +08:00
Mr Chen c391e54ee5 Update debian.sh 2024-07-16 12:01:54 +08:00
Mr Chen 0c226b1fc7 update 2024-07-16 11:38:17 +08:00
Mr Chen b218874a2b Update index.py 2024-07-16 11:32:21 +08:00
Mr Chen fce367075d update 2024-07-16 11:28:29 +08:00
Mr Chen f06b5004e2 Update index.py 2024-07-16 11:25:04 +08:00
Mr Chen 03c5191e89 zabbix_agent 初始化 2024-07-16 11:13:08 +08:00
Mr Chen 492ac0bb60 Update install.sh 2024-07-16 02:37:44 +08:00
Mr Chen 9ab9330671 Update index.py 2024-07-16 02:20:30 +08:00
Mr Chen 9851b5406e update 2024-07-16 02:15:29 +08:00
Mr Chen 19e10199e0 Update index.py 2024-07-16 02:09:30 +08:00
Mr Chen f11b1b3219 Update index.py 2024-07-16 02:02:28 +08:00
Mr Chen 49c37fa307 Update index.py 2024-07-16 02:01:44 +08:00
Mr Chen d7fedc3118 Update zabbix_server.conf 2024-07-16 01:59:37 +08:00
Mr Chen 0cd9f7f0d6 Update zabbix_server.conf.bak 2024-07-16 01:59:24 +08:00
Mr Chen 82f6b8cb56 update 2024-07-16 01:59:08 +08:00
Mr Chen 1f723ab8e0 Update index.py 2024-07-16 01:44:36 +08:00
Mr Chen 9496968fbb Update zabbix.js 2024-07-16 01:42:25 +08:00
Mr Chen c1e66ac574 Update debian.sh 2024-07-16 01:41:43 +08:00
Mr Chen 0b6506885a Update index.py 2024-07-16 01:39:57 +08:00
Mr Chen d018163ef2 Update zabbix.js 2024-07-16 01:32:37 +08:00
Mr Chen d89ab5c45f Update index.py 2024-07-16 01:30:57 +08:00
Mr Chen c3c536632d Update index.py 2024-07-16 01:27:17 +08:00
Mr Chen b73070231e update 2024-07-16 01:21:07 +08:00
Mr Chen a9c0c0d1d2 Update index.py 2024-07-16 00:49:25 +08:00
Mr Chen f65b16723b Update index.py 2024-07-16 00:45:42 +08:00
Mr Chen 69f828b169 Update index.py 2024-07-16 00:44:16 +08:00
Mr Chen dbf0b963bd Update zabbix.js 2024-07-16 00:35:20 +08:00
Mr Chen 5c20185426 update 2024-07-16 00:34:44 +08:00
Mr Chen f976b8c315 update 2024-07-16 00:31:46 +08:00
Mr Chen d5fac8bb07 Update index.py 2024-07-16 00:30:50 +08:00
Mr Chen c33431a2fc Update index.html 2024-07-16 00:29:58 +08:00
Mr Chen 23ba7bf636 Update index.py 2024-07-15 23:22:36 +08:00
Mr Chen 232f992203 Update index.py 2024-07-15 23:20:42 +08:00
Mr Chen 4438d5a8b4 Update index.py 2024-07-15 23:20:23 +08:00
Mr Chen ca213242fd Update debian.sh 2024-07-15 23:17:53 +08:00
Mr Chen 360221aa7a Update debian.sh 2024-07-15 23:17:39 +08:00
Mr Chen 987f56331b Update index.py 2024-07-15 23:15:29 +08:00
Mr Chen 8ee23d694f Update index.py 2024-07-15 23:13:12 +08:00
Mr Chen 0f93997aed Update index.py 2024-07-15 23:09:54 +08:00
Mr Chen 012bc92042 update 2024-07-15 23:09:49 +08:00
Mr Chen ef6fdfc71c Update index.py 2024-07-15 22:56:50 +08:00
Mr Chen 150d8e30b0 Update index.py 2024-07-15 22:51:52 +08:00
Mr Chen 491927a32c Update index.py 2024-07-15 22:47:09 +08:00
Mr Chen f5020404df Update index.py 2024-07-15 20:03:26 +08:00
Mr Chen d4ddf22e5b Update index.py 2024-07-15 16:39:48 +08:00
Mr Chen 45b30dc38e Update index.py 2024-07-15 16:11:45 +08:00
Mr Chen fed57f1f68 Update index.py 2024-07-15 16:11:12 +08:00
Mr Chen 6d02d6a85f update 2024-07-15 16:00:05 +08:00
Mr Chen 39bc0ff55d Update debian.sh 2024-07-15 15:47:57 +08:00
Mr Chen 9e0f045696 Update zabbix.nginx.conf 2024-07-15 15:46:54 +08:00
Mr Chen 2d1897fe62 Update install.sh 2024-07-15 15:46:18 +08:00
Mr Chen b35107016e Update zabbix.nginx.conf 2024-07-15 15:40:43 +08:00
Mr Chen 67f5342be4 Update index.py 2024-07-15 15:07:21 +08:00
Mr Chen 835796a9b1 Update index.html 2024-07-15 13:06:38 +08:00
Mr Chen b32fe10047 Update zabbix.nginx.conf 2024-07-15 12:17:47 +08:00
Mr Chen 43bdff7af1 Update index.py 2024-07-15 12:09:20 +08:00
Mr Chen 6628e135fc up 2024-07-15 02:36:09 +08:00
Mr Chen e94dc60f28 Update info.json 2024-07-14 18:54:59 +08:00
Mr Chen 8a4453ec84 Update install.sh 2024-07-14 18:47:05 +08:00
Mr Chen 1916e4c34a Update install.sh 2024-07-14 18:45:50 +08:00
Mr Chen f2a54682a1 Update debian.sh 2024-07-14 18:44:25 +08:00
Mr Chen 163903cc8a Update index.py 2024-07-14 18:42:07 +08:00
Mr Chen 6653f0b8ee Update install.sh 2024-07-14 18:31:06 +08:00
Mr Chen 7fa0200889 Update index.py 2024-07-14 18:30:37 +08:00
Mr Chen 7bf0611d67 Update debian.sh 2024-07-14 18:28:12 +08:00
Mr Chen 1cd3c3df17 Update debian.sh 2024-07-14 18:28:02 +08:00
Mr Chen e9ff82f0a3 zabbix初始化 2024-07-14 18:24:30 +08:00
Mr Chen e381309ba7 Update info.json 2024-07-14 18:02:52 +08:00
Mr Chen bd6d063a49 Merge pull request #617 from midoks/dev
增加插件simpleping及其他问题解决
2024-07-14 15:43:37 +08:00
Mr Chen de1e1401b9 Update index.py 2024-07-14 15:24:40 +08:00
Mr Chen 52bb6099d7 Update index.py 2024-07-14 15:22:45 +08:00
Mr Chen f42ec4973a Update index.py 2024-07-14 15:20:38 +08:00
Mr Chen ba8374cc5a Update index.py 2024-07-14 15:17:55 +08:00
Mr Chen d1f0ee9c20 update 2024-07-14 15:15:33 +08:00
Mr Chen 2a934daf89 Update mariadb.js 2024-07-14 14:45:39 +08:00
Mr Chen ac0fab2f2b update 2024-07-14 13:06:11 +08:00
Mr Chen ffab97d4c8 update 2024-07-14 12:58:33 +08:00
Mr Chen f51ed6115d update 2024-07-14 12:51:19 +08:00
Mr Chen f126015e70 Update simpleping.js 2024-07-13 22:07:05 +08:00
Mr Chen 699f71e636 update 2024-07-13 22:05:27 +08:00
Mr Chen 88a7431067 update 2024-07-13 14:25:49 +08:00
Mr Chen bf256c6e60 update 2024-07-12 18:14:51 +08:00
Mr Chen 0c718229d1 Update simpleping_index.py 2024-07-11 15:20:11 +08:00
Mr Chen 2366a4e551 update 2024-07-11 15:17:57 +08:00
Mr Chen 81bddd7eee Update simpleping.js 2024-07-11 13:43:00 +08:00
Mr Chen 35f2791c72 Update simpleping_index.py 2024-07-11 13:32:16 +08:00
Mr Chen 0dbbbf4359 Update simpleping_index.py 2024-07-11 13:28:44 +08:00
Mr Chen 04b7e07e90 Update simpleping_index.py 2024-07-11 13:24:31 +08:00
Mr Chen 85c84b64c4 Update install.sh 2024-07-11 04:38:02 +08:00
Mr Chen b0014c0477 Update install.sh 2024-07-11 04:37:55 +08:00
Mr Chen a53ad5d1b1 Update install.sh 2024-07-11 04:37:37 +08:00
Mr Chen 73a418376d Update mw.tpl 2024-07-11 04:33:51 +08:00
Mr Chen 437088663e Update simpleping.js 2024-07-11 04:18:29 +08:00
Mr Chen 9db5188d30 update 2024-07-11 04:17:47 +08:00
Mr Chen 53563cb130 Update simpleping.js 2024-07-11 04:11:25 +08:00
Mr Chen c989644c6f Update simpleping.js 2024-07-11 04:05:36 +08:00
Mr Chen c2a55f2658 Update install.sh 2024-07-11 03:57:20 +08:00
Mr Chen 8ca63c0396 update 2024-07-11 03:50:31 +08:00
Mr Chen 3b1fcac0aa Update index.py 2024-07-11 03:27:33 +08:00
Mr Chen 7c093617f5 update 2024-07-11 03:04:23 +08:00
Mr Chen 9e2f1dc172 Update simpleping.js 2024-07-11 02:55:31 +08:00
Mr Chen 25591dc3e5 Update install.sh 2024-07-11 02:54:14 +08:00
Mr Chen 4596a3a73c Update install.sh 2024-07-11 02:49:19 +08:00
Mr Chen 818ab604e2 update 2024-07-11 02:35:33 +08:00
Mr Chen 04e18490fb Update db.py 2024-07-11 01:06:53 +08:00
Mr Chen b519bb5522 plugins ping init 2024-07-11 00:37:08 +08:00
Mr Chen 9d8e76faec update 2024-07-10 11:49:41 +08:00
Mr Chen cbdfb1a033 update 2024-07-08 23:08:36 +08:00
Mr Chen 8b10a5839a Update push_ad.py 2024-07-08 23:01:20 +08:00
Mr Chen 905cecc060 Update ubuntu.sh 2024-07-05 16:13:57 +08:00
Mr Chen 486cf03c79 Update ubuntu.sh 2024-07-05 14:48:48 +08:00
Mr Chen 735b669d44 Update ubuntu.sh 2024-07-05 14:48:15 +08:00
Mr Chen 489caa6070 Merge pull request #616 from midoks/dev
Update install.sh
2024-07-05 12:38:59 +08:00
Mr Chen f6284ed167 Update install.sh 2024-07-05 12:34:55 +08:00
Mr Chen a843dd4a87 Merge pull request #615 from midoks/dev
Update index.py
2024-07-05 12:00:10 +08:00
Mr Chen b5c14926df Update index.py 2024-07-05 11:57:19 +08:00
Mr Chen 8b58c34e5b Merge pull request #614 from midoks/dev
Update index.py
2024-07-05 11:45:33 +08:00
Mr Chen f29d10b0b9 Update index.py 2024-07-05 11:38:43 +08:00
Mr Chen ce15f78a56 Merge pull request #613 from midoks/dev
mysql>=8.0优化
2024-07-04 03:49:13 +08:00
Mr Chen 033db86d3b up 2024-07-04 03:42:48 +08:00
Mr Chen 7d32309183 Update index.py 2024-07-04 03:42:11 +08:00
Mr Chen 353290cfa8 Update index.py 2024-07-04 03:37:42 +08:00
Mr Chen a7aa34795b update 2024-07-04 03:37:22 +08:00
Mr Chen 994bc4aa6a Update index.py 2024-07-04 03:34:01 +08:00
Mr Chen 9737d65592 Update index.py 2024-07-04 03:32:40 +08:00
Mr Chen e9ee66e932 Update index.py 2024-07-04 03:25:02 +08:00
Mr Chen 42f66a2fb8 Update my8.0.cnf 2024-07-04 02:58:31 +08:00
Mr Chen 5aaac1bdec Update my8.0.cnf 2024-07-04 02:58:00 +08:00
Mr Chen 57a1721f62 Update my8.0.cnf 2024-07-04 02:57:39 +08:00
Mr Chen 8134c3c9c0 update 2024-07-04 02:53:01 +08:00
Mr Chen cdaf64b41b Update index.py 2024-07-04 02:51:14 +08:00
Mr Chen 5f5384f5aa Update index.py 2024-07-04 02:50:49 +08:00
Mr Chen a11e43f9a5 update 2024-07-04 02:47:57 +08:00
Mr Chen b76a9bf13c update 2024-07-04 02:33:09 +08:00
Mr Chen 4653667ef1 Update mysql-apt.js 2024-07-04 02:30:35 +08:00
Mr Chen a1cc2f0147 update 2024-07-04 02:29:25 +08:00
Mr Chen d08b97415b Update mysql-apt.js 2024-07-04 02:26:28 +08:00
Mr Chen 7fc9045688 Update index.py 2024-07-04 02:16:20 +08:00
Mr Chen d9f77537f1 Update index.py 2024-07-04 02:15:25 +08:00
Mr Chen bc8a874c68 update 2024-07-04 02:03:15 +08:00
Mr Chen 8067c20e5a Update index.py 2024-07-04 02:01:59 +08:00
Mr Chen 22526d5255 Update my8.0.cnf 2024-07-04 01:45:02 +08:00
Mr Chen 83f846eb69 update 2024-07-04 01:42:12 +08:00
Mr Chen 61a8bf0275 Update mysql-apt.js 2024-07-04 01:41:45 +08:00
Mr Chen 1662c3ff3f update 2024-07-04 01:38:31 +08:00
Mr Chen 41a1fa856c Update mw.tpl 2024-07-04 01:26:10 +08:00
Mr Chen eee5881ca7 Update lib.sh 2024-07-04 01:25:28 +08:00
Mr Chen 3ce92f2477 Update lib.sh 2024-07-04 01:25:18 +08:00
Mr Chen 4020ecff80 Update lib.sh 2024-07-04 01:15:40 +08:00
Mr Chen 979b86b7cb update 2024-07-04 01:06:50 +08:00
Mr Chen 26080ade0e Update index.py 2024-07-04 01:05:17 +08:00
Mr Chen 4deb9c59ea Update index.py 2024-07-04 01:00:39 +08:00
Mr Chen b640515243 Merge pull request #612 from midoks/dev
常规优化
2024-07-03 16:24:43 +08:00
Mr Chen 130da4e311 Update mw.tpl 2024-07-03 16:19:12 +08:00
Mr Chen dcca93baef Merge pull request #611 from midoks/dev
mysql修改同步账户
2024-07-01 13:34:08 +08:00
Mr Chen 92525b0549 Update mariadb.js 2024-07-01 13:32:24 +08:00
Mr Chen fa0bca88b3 update 2024-07-01 13:31:22 +08:00
Mr Chen 72961e3dca Update logs_api.py 2024-06-29 00:18:38 +08:00
Mr Chen 7ac4000687 Update index.py 2024-06-28 22:37:20 +08:00
Mr Chen 3c0d0f9036 Merge pull request #610 from midoks/dev
计划任务优化2
2024-06-28 22:10:08 +08:00
Mr Chen 790fa18e1b Update crontab.js 2024-06-28 22:05:16 +08:00
Mr Chen 7b06b5533c Update crontab.js 2024-06-28 21:59:08 +08:00
Mr Chen 9301783c3a Update crontab.js 2024-06-28 21:56:53 +08:00
Mr Chen 39359ab783 Update crontab.js 2024-06-28 21:54:33 +08:00
Mr Chen a44be32cdc Update crontab.js 2024-06-28 21:51:51 +08:00
Mr Chen d4a4f238f2 Update index.py 2024-06-28 21:09:03 +08:00
Mr Chen 60584ee79f Update index.py 2024-06-28 21:07:01 +08:00
Mr Chen 95845663f4 Merge pull request #609 from midoks/dev
计划任务优化
2024-06-28 20:13:54 +08:00
Mr Chen d1991b5c0d Update config_api.py 2024-06-28 20:11:53 +08:00
Mr Chen 5448ba4611 Update crontab_api.py 2024-06-28 19:55:51 +08:00
Mr Chen 11b59cdc41 Update crontab_api.py 2024-06-28 19:52:03 +08:00
Mr Chen 05234cba77 Update logs_backup.py 2024-06-28 19:46:29 +08:00
Mr Chen f17c7f3d13 Update logs_backup.py 2024-06-28 19:35:06 +08:00
Mr Chen 546792b733 update 2024-06-28 19:34:31 +08:00
Mr Chen 4e38909ef2 Update logs_backup.py 2024-06-28 19:32:49 +08:00
Mr Chen d411439734 update 2024-06-28 19:23:29 +08:00
Mr Chen 599d3ca8fc Update config_api.py 2024-06-28 19:19:59 +08:00
Mr Chen 5a2bb0ca5c Update crontab.js 2024-06-28 19:18:53 +08:00
Mr Chen a1492d4f3e Merge pull request #608 from midoks/dev
mysql-apt debian12 安装优化
2024-06-28 15:43:11 +08:00
Mr Chen aee881b302 Update install.sh 2024-06-28 15:39:38 +08:00
Mr Chen 6287dc523d Update install.sh 2024-06-28 15:39:00 +08:00
Mr Chen a9a48aef39 update 2024-06-28 14:30:20 +08:00
Mr Chen ef861ef28e Update install.sh 2024-06-28 14:29:11 +08:00
Mr Chen 9af9908ab2 Update index.py 2024-06-27 00:41:39 +08:00
Mr Chen 29fd76fc91 Update index.py 2024-06-27 00:38:20 +08:00
Mr Chen b69f978371 Merge pull request #607 from midoks/dev
sphinx 自动加入计划任务
2024-06-26 19:41:46 +08:00
Mr Chen 89cea53d92 Update index.py 2024-06-26 19:27:13 +08:00
Mr Chen 2a08d91021 Update index.py 2024-06-26 19:26:14 +08:00
Mr Chen c726bc48a9 Update index.py 2024-06-26 19:24:35 +08:00
Mr Chen 69272110fb Update tool_cron.py 2024-06-26 19:20:23 +08:00
Mr Chen 682502ff2b Update tool_cron.py 2024-06-26 19:19:00 +08:00
Mr Chen 345eff8a0b Update tool_cron.py 2024-06-26 19:17:12 +08:00
Mr Chen dec8135478 Update index.py 2024-06-26 19:12:19 +08:00
Mr Chen 60f37fa586 Update tool_cron.py 2024-06-26 19:06:38 +08:00
Mr Chen 61849bb14e Update tool_cron.py 2024-06-26 19:05:08 +08:00
Mr Chen f32a40b53f Update index.py 2024-06-26 19:03:51 +08:00
Mr Chen 4e2921f3b9 Update index.py 2024-06-26 19:01:30 +08:00
Mr Chen 8652f3b2d8 Update index.py 2024-06-26 18:56:15 +08:00
Mr Chen d4f75fa0f1 Update index.py 2024-06-26 18:55:22 +08:00
Mr Chen 93accf9ff3 Update index.py 2024-06-26 18:52:30 +08:00
Mr Chen 22b06b36f9 Update index.py 2024-06-26 18:48:40 +08:00
Mr Chen b0a763f972 Update index.py 2024-06-26 18:48:35 +08:00
Mr Chen 44e4dfb0bd Update index.py 2024-06-26 18:46:31 +08:00
Mr Chen 80fe60211f update 2024-06-26 18:06:22 +08:00
Mr Chen 0a1e47da4d Update index.py 2024-06-26 17:52:41 +08:00
Mr Chen a6acecb8c2 update 2024-06-26 17:49:26 +08:00
Mr Chen 33cb0149f2 Update tool_cron.py 2024-06-26 17:46:37 +08:00
Mr Chen ff873d2e2d Update debian.sh 2024-06-26 17:33:12 +08:00
Mr Chen bc184f03cc update 2024-06-26 17:32:22 +08:00
Mr Chen b3147b9a2c Update sphinx.js 2024-06-26 16:37:20 +08:00
Mr Chen 8a4e64a079 Update ftp_client.py 2024-06-22 13:21:56 +08:00
Mr Chen 24bb36e320 Merge pull request #604 from midoks/dev
优化2
2024-06-15 23:26:37 +08:00
Mr Chen 285aa45de8 Update debian.sh 2024-06-15 23:25:10 +08:00
Mr Chen b9eee76b6e Update ubuntu.sh 2024-06-15 23:24:36 +08:00
Mr Chen e3bb8e6463 Update lib.sh 2024-06-15 23:22:12 +08:00
Mr Chen e72f33b201 Update lib.sh 2024-06-15 23:21:59 +08:00
Mr Chen 22fe247707 Update install_dev.sh 2024-06-15 23:19:11 +08:00
Mr Chen a3a44e1494 Update install_dev.sh 2024-06-15 23:14:37 +08:00
Mr Chen 9c3dcaf2ec Update debian.sh 2024-06-15 22:51:04 +08:00
Mr Chen 2a088241da Update ubuntu.sh 2024-06-15 22:43:46 +08:00
Mr Chen ed8af0728b Update ubuntu.sh 2024-06-15 22:43:35 +08:00
Mr Chen cc01c5cbc1 Update debian.sh 2024-06-15 22:41:29 +08:00
Mr Chen 828a079184 Update task_manager_index.py 2024-06-15 22:31:36 +08:00
Mr Chen 189f73e522 Update plugins_api.py 2024-06-15 22:18:09 +08:00
Mr Chen 692f51fe44 update 2024-06-15 22:11:51 +08:00
Mr Chen ddacecec9a Update plugins_api.py 2024-06-15 22:07:27 +08:00
Mr Chen af629be9e0 Update task_manager_index.py 2024-06-15 21:27:30 +08:00
Mr Chen dc76d41369 Update ubuntu.sh 2024-06-15 21:21:36 +08:00
Mr Chen cc65840a1f Merge pull request #603 from midoks/dev
优化
2024-06-15 21:01:24 +08:00
Mr Chen dad72a1fe2 update 2024-06-15 20:53:04 +08:00
Mr Chen e43eff325b Update install_dev.sh 2024-06-15 20:32:11 +08:00
Mr Chen 1a41f2d248 update 2024-06-15 20:28:11 +08:00
Mr Chen 58274ba9dc Merge pull request #602 from midoks/dev
php-apt,php-yum优化2
2024-06-14 17:18:34 +08:00
Mr Chen aa22501aac Update debian.sh 2024-06-14 17:15:56 +08:00
Mr Chen b74e733252 Update debian.sh 2024-06-14 17:15:11 +08:00
Mr Chen 2cc714abf0 Update debian.sh 2024-06-14 17:14:35 +08:00
Mr Chen d86e6dd5c4 Update install.sh 2024-06-14 17:10:32 +08:00
Mr Chen 31f7269ba5 Update opcache.sh 2024-06-14 17:05:10 +08:00
Mr Chen f335f08c27 Update common.sh 2024-06-14 17:02:50 +08:00
Mr Chen 7a16486105 Update common.sh 2024-06-14 17:00:03 +08:00
Mr Chen 4a05152adc Update opcache.sh 2024-06-14 16:59:13 +08:00
Mr Chen 379478b2c2 Update ioncube.sh 2024-06-14 16:33:19 +08:00
Mr Chen c2b3d4113a Update ioncube.sh 2024-06-14 16:30:11 +08:00
Mr Chen 4655867db0 Update ioncube.sh 2024-06-14 16:29:51 +08:00
Mr Chen 5daf371c65 Update ioncube.sh 2024-06-14 16:26:42 +08:00
Mr Chen 8488f73d7f Update ioncube.sh 2024-06-14 16:24:51 +08:00
Mr Chen 2788d76c00 Update ioncube.sh 2024-06-14 16:23:16 +08:00
Mr Chen d55a89766e Update ioncube.sh 2024-06-14 16:20:48 +08:00
Mr Chen df64e00a27 update 2024-06-14 16:18:51 +08:00
Mr Chen 4569c20f58 Update files.js 2024-06-14 16:10:41 +08:00
Mr Chen d0cdbf48d2 Update opcache.sh 2024-06-14 16:02:36 +08:00
Mr Chen 24b45afe6f Update opcache.sh 2024-06-14 16:02:23 +08:00
Mr Chen a577235ccc Update opcache.sh 2024-06-14 15:58:13 +08:00
Mr Chen cc98b3322a update 2024-06-14 15:56:31 +08:00
Mr Chen 214d784413 Update opcache.sh 2024-06-14 15:40:26 +08:00
Mr Chen c2c02f9c62 Update opcache.sh 2024-06-14 15:34:03 +08:00
Mr Chen c4ce555f91 Update opcache.sh 2024-06-14 15:33:52 +08:00
Mr Chen 5901b1bd33 Update opcache.sh 2024-06-14 15:30:02 +08:00
Mr Chen 2c65fc65dd Update install.sh 2024-06-14 15:28:22 +08:00
Mr Chen 322141b927 Update opcache.sh 2024-06-14 15:19:43 +08:00
Mr Chen 9d94b1571a Update common.sh 2024-06-14 15:16:29 +08:00
Mr Chen ff64f3a70f Update common.sh 2024-06-14 15:16:11 +08:00
Mr Chen dc0bfd25c8 Update opcache.sh 2024-06-14 15:07:28 +08:00
Mr Chen 10ccbc0dc2 Update opcache.sh 2024-06-14 14:58:15 +08:00
Mr Chen 45e46b6826 Update opcache.sh 2024-06-14 14:56:02 +08:00
Mr Chen 7d20b9e9a2 Update opcache.sh 2024-06-14 14:48:52 +08:00
Mr Chen 086765090a Update opcache.sh 2024-06-14 14:47:21 +08:00
Mr Chen 1c49000ec2 Update opcache.sh 2024-06-14 14:47:06 +08:00
Mr Chen e9261a1e19 Update opcache.sh 2024-06-14 14:26:59 +08:00
Mr Chen 796afbdf1d Update opcache.sh 2024-06-14 14:22:32 +08:00
Mr Chen 3dfe8d2829 Update opcache.sh 2024-06-14 13:59:29 +08:00
Mr Chen 77368f9908 Update opcache.sh 2024-06-14 13:59:06 +08:00
Mr Chen 2acad0fa01 Update opcache.sh 2024-06-14 13:49:49 +08:00
Mr Chen e0ccb81014 Update opcache.sh 2024-06-14 13:47:28 +08:00
Mr Chen 93cedaaa41 Update opcache.sh 2024-06-14 13:36:59 +08:00
Mr Chen d306bb4f36 update 2024-06-14 13:36:37 +08:00
Mr Chen 4c66354c6a Merge pull request #601 from midoks/dev
php-apt,php-yum优化
2024-06-14 00:15:31 +08:00
Mr Chen 35ecb54a26 Update php-fpm.conf 2024-06-14 00:09:13 +08:00
Mr Chen e2780ecbdf Update index.py 2024-06-13 23:59:33 +08:00
Mr Chen 4e4cfb24d6 Update index.py 2024-06-13 23:52:33 +08:00
Mr Chen 89307534df Update index.py 2024-06-13 23:47:41 +08:00
Mr Chen d0e126118d Update index.py 2024-06-13 23:44:44 +08:00
Mr Chen 7e424691fd Update index.py 2024-06-13 23:42:12 +08:00
Mr Chen 12fb0067d1 Update index.py 2024-06-13 23:41:05 +08:00
Mr Chen f0fd643ef0 Update index.py 2024-06-13 23:39:06 +08:00
Mr Chen cd48a580af Update php-fpm.conf 2024-06-13 23:36:59 +08:00
Mr Chen a08ebed065 Update php-fpm.conf 2024-06-13 23:36:03 +08:00
Mr Chen 0784b9092d Update index.py 2024-06-13 23:30:27 +08:00
Mr Chen 6954bb947e update 2024-06-13 23:29:25 +08:00
Mr Chen eafa053e21 update 2024-06-13 23:19:05 +08:00
Mr Chen 90900b1589 Update php.js 2024-06-13 23:15:54 +08:00
Mr Chen 40397e6aaa Update php-fpm.conf 2024-06-13 22:27:02 +08:00
Mr Chen 2196c5c70e Update index.py 2024-06-13 22:25:46 +08:00
Mr Chen c4d9f13380 update 2024-06-13 22:23:59 +08:00
Mr Chen 27fbc15469 Update install.sh 2024-06-13 21:57:39 +08:00
Mr Chen c96bb414fe Update index.py 2024-06-13 21:47:22 +08:00
Mr Chen d428d0ff03 Update index.py 2024-06-13 21:45:40 +08:00
Mr Chen d80216ff31 Update index.py 2024-06-13 21:38:36 +08:00
Mr Chen adcb4e74fa Update index.py 2024-06-13 21:27:45 +08:00
Mr Chen 4df1555179 update 2024-06-13 21:22:35 +08:00
Mr Chen 4bd78541fc update 2024-06-13 20:37:45 +08:00
Mr Chen 2f2a4722f9 Update php.js 2024-06-13 20:34:40 +08:00
Mr Chen 7ad235bba1 update 2024-06-13 20:33:08 +08:00
Mr Chen c7faaeff62 Merge pull request #600 from midoks/dev
mysql 二进制日志 设置优化
2024-06-13 20:23:32 +08:00
Mr Chen 525bcc909f update 2024-06-13 20:21:43 +08:00
Mr Chen aecd605df9 Merge pull request #599 from midoks/dev
php-apt ubuntu细节优化
2024-06-11 19:12:27 +08:00
Mr Chen f1eac4f309 Update install.sh 2024-06-11 19:06:14 +08:00
Mr Chen 562ab87771 Update install.sh 2024-06-11 19:05:02 +08:00
Mr Chen 26d7aeb401 Update install.sh 2024-06-11 19:03:26 +08:00
Mr Chen 3798ac5e09 update 2024-06-11 18:57:09 +08:00
Mr Chen a2ee74c700 Update install.sh 2024-06-11 18:55:12 +08:00
Mr Chen 1a3aaad591 Merge pull request #598 from midoks/dev
php-yum,php-apt优化
2024-06-11 18:29:40 +08:00
Mr Chen 4a5196a5cb Update install.sh 2024-06-11 18:21:50 +08:00
Mr Chen 207062cf1a Update install.sh 2024-06-11 18:17:54 +08:00
Mr Chen d6291dbcb0 Update lib.sh 2024-06-11 18:07:54 +08:00
Mr Chen 7b8737006c Update lib.sh 2024-06-11 18:03:55 +08:00
Mr Chen 75818ebb0a Update install.sh 2024-06-11 17:56:46 +08:00
Mr Chen 37f26e0f1b Update index.py 2024-06-11 17:23:30 +08:00
Mr Chen 3250fc2620 Update index.py 2024-06-11 17:04:21 +08:00
Mr Chen cf44358190 Update index.py 2024-06-11 16:38:58 +08:00
Mr Chen 87a5685fec Update index.py 2024-06-11 16:34:37 +08:00
Mr Chen 8b6c761812 Update phplib.conf 2024-06-11 16:28:35 +08:00
Mr Chen 21d86bf57a Update rhel.sh 2024-06-11 16:27:48 +08:00
Mr Chen 7d892fe298 Update phplib.conf 2024-06-11 16:21:42 +08:00
Mr Chen 0b16f3541d Update mysql-apt.js 2024-06-11 16:14:36 +08:00
Mr Chen cd1947a445 Update mysql-yum.js 2024-06-11 16:14:08 +08:00
Mr Chen 1929e19647 Update index.py 2024-06-11 16:06:52 +08:00
Mr Chen 31e3c4442f Update install.sh 2024-06-11 16:04:36 +08:00
Mr Chen c1459377a1 Update all_test.sh 2024-06-11 16:03:04 +08:00
Mr Chen 2f30f37b7c update 2024-06-11 15:57:39 +08:00
Mr Chen b31924f316 Update install.sh 2024-06-11 15:56:42 +08:00
Mr Chen efb10c477c Update phplib.conf 2024-06-11 15:21:53 +08:00
Mr Chen 7adfd7a589 Update install.sh 2024-06-11 15:16:20 +08:00
Mr Chen 87ec027cdb Update install.sh 2024-06-11 15:15:43 +08:00
Mr Chen d171e28e49 Update common.sh 2024-06-11 14:57:42 +08:00
Mr Chen 9169502512 Update common.sh 2024-06-11 14:57:34 +08:00
Mr Chen 92d42ec297 Update common.sh 2024-06-11 14:56:59 +08:00
Mr Chen e6457ac82e Update install.sh 2024-06-11 14:20:04 +08:00
Mr Chen 7eb85fc0c3 Update common.sh 2024-06-11 14:17:43 +08:00
Mr Chen a97de38574 Update lib.sh 2024-06-11 12:43:54 +08:00
Mr Chen b426b66f9e Update install.sh 2024-06-11 12:41:40 +08:00
Mr Chen d9d66fa6b4 Update install.sh 2024-06-11 12:41:18 +08:00
Mr Chen ade2809a72 update 2024-06-11 12:39:04 +08:00
Mr Chen 0c0f20a75d update 2024-06-11 12:29:34 +08:00
Mr Chen a8b531b08e Update my8.4.cnf 2024-06-11 10:44:29 +08:00
Mr Chen 40ce57ba37 Merge pull request #597 from midoks/dev
mysql-apt,mysql-yum功能同步
2024-06-10 22:16:29 +08:00
Mr Chen 3488dce7ad Update install.sh 2024-06-10 21:31:11 +08:00
Mr Chen 0af71b83cb Update install.sh 2024-06-10 21:29:17 +08:00
Mr Chen 39a92a56d1 Update info.json 2024-06-10 21:25:24 +08:00
Mr Chen e4943fe60a update 2024-06-10 21:09:16 +08:00
Mr Chen 1d0c965ff0 Update index.py 2024-06-10 20:56:55 +08:00
Mr Chen 6d5b5efafa Update index.py 2024-06-10 20:55:31 +08:00
Mr Chen 665e7454bb Update index.py 2024-06-10 20:52:01 +08:00
Mr Chen 63056b2d91 Update my8.4.cnf 2024-06-10 20:49:28 +08:00
Mr Chen c995488e68 update 2024-06-10 20:48:46 +08:00
Mr Chen f4f7d7795e Update install.sh 2024-06-10 20:40:00 +08:00
Mr Chen ddad227ae9 Update index.py 2024-06-10 20:32:52 +08:00
Mr Chen 0af1308b7d Update index.py 2024-06-10 20:30:29 +08:00
Mr Chen e2afed1dc4 Update index.py 2024-06-10 20:07:37 +08:00
Mr Chen 47de48806f Update index.py 2024-06-10 19:55:28 +08:00
Mr Chen 7886066fd4 Update my8.0.cnf 2024-06-10 19:39:57 +08:00
Mr Chen db27f0b8b7 update 2024-06-10 19:32:23 +08:00
Mr Chen 1d28c83807 update 2024-06-10 19:29:21 +08:00
Mr Chen 9f13b4ec5a Update index.py 2024-06-10 19:20:30 +08:00
Mr Chen 133f8fd9f3 update 2024-06-10 19:19:26 +08:00
Mr Chen 757e20c75c Update index.py 2024-06-10 18:57:08 +08:00
Mr Chen 6b75914c91 Update index.py 2024-06-10 18:26:30 +08:00
Mr Chen ae6af8d777 Create my8.4.cnf 2024-06-10 18:21:17 +08:00
Mr Chen 770718ba95 Create install.sh 2024-06-10 18:20:34 +08:00
Mr Chen da4a9f7088 update 2024-06-10 18:14:34 +08:00
Mr Chen bea62f6d3c Update index.py 2024-06-10 18:07:44 +08:00
Mr Chen ef960f945e update 2024-06-10 17:20:34 +08:00
Mr Chen 9fd8ac426c Update index.py 2024-06-10 17:08:42 +08:00
Mr Chen a68a5e6c8b update 2024-06-10 17:08:18 +08:00
Mr Chen f78296c1b0 Update index.py 2024-06-10 17:05:38 +08:00
Mr Chen 91a3b0d659 update 2024-06-10 17:04:31 +08:00
Mr Chen 6fdba85d04 Update my8.4.cnf 2024-06-10 16:57:20 +08:00
Mr Chen c0fd42d5c4 Update my8.4.cnf 2024-06-10 16:57:08 +08:00
Mr Chen 4095263c72 Update index.py 2024-06-10 16:56:20 +08:00
Mr Chen 57558d7241 Update index.py 2024-06-10 16:43:53 +08:00
Mr Chen 28b64b3819 Update index.py 2024-06-10 16:36:00 +08:00
Mr Chen 08a0b5e186 Update my8.0.cnf 2024-06-10 16:33:15 +08:00
Mr Chen 7d8d34b15e Update install.sh 2024-06-10 16:31:09 +08:00
Mr Chen d93a1d92f3 Update my8.0.cnf 2024-06-10 16:29:13 +08:00
Mr Chen 6a5b63c359 update 2024-06-10 16:25:44 +08:00
Mr Chen 5d10c45501 Update install.sh 2024-06-10 16:25:11 +08:00
Mr Chen 28449b5dfd Update my8.0.cnf 2024-06-10 16:23:45 +08:00
Mr Chen e1ea19b54d Update index.py 2024-06-10 16:13:45 +08:00
Mr Chen 87a18b54ad Update index.py 2024-06-10 15:53:48 +08:00
Mr Chen 1d36b669b0 update 2024-06-10 15:53:37 +08:00
Mr Chen 0d67c6a3ca Update my8.4.cnf 2024-06-10 15:30:23 +08:00
Mr Chen 9e2919dc35 Update my8.4.cnf 2024-06-10 15:30:15 +08:00
Mr Chen 88219e7802 update 2024-06-10 15:23:34 +08:00
Mr Chen dee06ecf45 Update index.py 2024-06-10 15:09:30 +08:00
Mr Chen cc6e4d07b0 update 2024-06-10 15:05:07 +08:00
Mr Chen f824293c96 update 2024-06-10 14:57:49 +08:00
Mr Chen 92e48f44dc Update mysql-yum.js 2024-06-10 14:55:37 +08:00
Mr Chen 02402eb5dc Update mysql-apt.js 2024-06-10 14:54:30 +08:00
Mr Chen 9e9e0d8f35 Update mysql-apt.js 2024-06-10 14:52:35 +08:00
Mr Chen 3a955ce107 Update index.py 2024-06-10 14:49:40 +08:00
Mr Chen 1d22d64558 Update my8.4.cnf 2024-06-10 14:40:02 +08:00
Mr Chen e59f29badf update 2024-06-10 14:32:08 +08:00
Mr Chen 8cfb038a0c update 2024-06-10 14:27:56 +08:00
Mr Chen 5ba48d965c Create mysql8.4.service.tpl 2024-06-10 14:24:49 +08:00
Mr Chen d72a7c4bf8 Update info.json 2024-06-10 14:20:29 +08:00
Mr Chen fb20289a80 Update index.py 2024-06-10 14:20:11 +08:00
Mr Chen 21df235fd5 update 2024-06-10 14:18:25 +08:00
Mr Chen e001e9eb0d update 2024-06-10 14:16:26 +08:00
Mr Chen 7ebe575132 Create mysql8.4.service.tpl 2024-06-10 14:10:08 +08:00
Mr Chen 34951d1058 Update install.sh 2024-06-10 14:07:40 +08:00
Mr Chen 2ccb45bfcb Update index.py 2024-06-10 13:58:40 +08:00
Mr Chen 0a7945806e Update index.py 2024-06-10 13:43:11 +08:00
Mr Chen e3fe8aff79 update 2024-06-10 13:40:47 +08:00
Mr Chen 12fdc90536 Create my8.4.cnf 2024-06-10 13:39:40 +08:00
Mr Chen 870ee26b60 update 2024-06-10 13:38:29 +08:00
Mr Chen 7b84624e81 Update install.sh 2024-06-10 13:34:48 +08:00
Mr Chen 43d7f918a5 update 2024-06-10 13:33:00 +08:00
Mr Chen 78e61a7718 update 2024-06-10 13:31:55 +08:00
Mr Chen 3e3e3db323 update 2024-06-10 13:31:13 +08:00
Mr Chen 335073102e Update index.py 2024-06-10 12:56:42 +08:00
Mr Chen c749154fb3 Update rhel.sh 2024-06-10 12:55:08 +08:00
Mr Chen 752152fb56 Update rhel.sh 2024-06-10 12:54:38 +08:00
Mr Chen cb2883646d Update rhel.sh 2024-06-10 12:53:20 +08:00
Mr Chen bc6370ad8e Update rhel.sh 2024-06-10 12:53:03 +08:00
Mr Chen 15ceaa1dbb Update rhel.sh 2024-06-10 12:45:17 +08:00
Mr Chen 66dfd39757 Update rhel.sh 2024-06-10 12:43:17 +08:00
Mr Chen b7b82da73f Update index.py 2024-06-10 12:39:55 +08:00
Mr Chen f95946a11b update 2024-06-10 03:59:47 +08:00
Mr Chen 1609f189dd Update info.json 2024-06-10 03:57:17 +08:00
Mr Chen 26de27fc85 Update info.json 2024-06-10 03:57:11 +08:00
Mr Chen 41a3771efe Update info.json 2024-06-10 03:55:44 +08:00
Mr Chen d0ac69832f update 2024-06-10 03:54:44 +08:00
Mr Chen df6c2687af update 2024-06-10 03:46:39 +08:00
Mr Chen 8783a619c9 Update install_dev.sh 2024-06-10 03:45:10 +08:00
Mr Chen 573cc3fc47 Update rhel.sh 2024-06-10 03:37:12 +08:00
Mr Chen 4d1ac42057 Update install.sh 2024-06-10 03:29:34 +08:00
Mr Chen 12dc740f56 Update info.json 2024-06-10 03:25:51 +08:00
Mr Chen 7b61f433a0 Update my8.3.cnf 2024-06-10 03:20:19 +08:00
Mr Chen 0e25a1e87b Update my8.2.cnf 2024-06-10 03:20:12 +08:00
Mr Chen e9ff3b72e1 Update my8.2.cnf 2024-06-10 03:18:10 +08:00
Mr Chen 623ec17c29 Update my8.2.cnf 2024-06-10 03:15:58 +08:00
Mr Chen cc1a665f7a Update my8.3.cnf 2024-06-10 03:12:04 +08:00
Mr Chen f092846ece Update my8.3.cnf 2024-06-10 03:09:15 +08:00
Mr Chen b547fef1b9 Create my8.3.cnf 2024-06-10 03:07:28 +08:00
Mr Chen 665bc9f8d1 Update install.sh 2024-06-10 03:03:49 +08:00
Mr Chen c961921be8 Update info.json 2024-06-10 03:02:17 +08:00
Mr Chen 3f65a92446 Update index.py 2024-06-10 02:59:49 +08:00
Mr Chen bfe82cc95d Update index.py 2024-06-10 02:59:00 +08:00
Mr Chen 85ededc849 Update index.py 2024-06-10 02:58:03 +08:00
Mr Chen 7efe37c35c update 2024-06-10 02:53:36 +08:00
Mr Chen d394a70f46 Update index.py 2024-06-10 02:52:04 +08:00
Mr Chen 1db88e3343 Update index.py 2024-06-10 02:46:11 +08:00
Mr Chen b9e1e33dc8 Update index.py 2024-06-10 02:44:54 +08:00
Mr Chen 8af80459a1 update 2024-06-10 02:41:27 +08:00
Mr Chen c2b46f77b7 Update mysql-yum.js 2024-06-10 02:37:03 +08:00
Mr Chen 5f5955d51b Update mysql-apt.js 2024-06-10 02:36:36 +08:00
Mr Chen e29d632a78 Update mysql-yum.js 2024-06-10 02:33:06 +08:00
Mr Chen b5845d3881 update 2024-06-10 02:31:05 +08:00
Mr Chen f75c42690b update 2024-06-10 02:28:55 +08:00
Mr Chen 18f9ac498b Update index.py 2024-06-10 02:22:51 +08:00
Mr Chen 865c71ab96 update 2024-06-10 02:10:08 +08:00
Mr Chen 2d40e2d84b Update index.py 2024-06-10 02:00:27 +08:00
Mr Chen e7e160c8e1 update 2024-06-10 01:58:11 +08:00
Mr Chen a542c95433 Update index.py 2024-06-10 01:40:04 +08:00
Mr Chen 83a3e0ca24 Update mysql-apt.js 2024-06-10 01:35:18 +08:00
Mr Chen 7eeb7c97d2 Update mysql-apt.js 2024-06-10 01:33:31 +08:00
Mr Chen 8629224f2f Update ubuntu.sh 2024-06-10 01:27:42 +08:00
Mr Chen 76866a46f0 update 2024-06-10 01:15:44 +08:00
Mr Chen 3f96854d9a update 2024-06-10 01:13:13 +08:00
Mr Chen 92001aadfe update 2024-06-10 00:52:46 +08:00
Mr Chen 3473645798 Update mysql-apt.js 2024-06-10 00:46:10 +08:00
Mr Chen 47834ea34e Update index.py 2024-06-10 00:44:48 +08:00
Mr Chen 1329a87a06 Update index.py 2024-06-10 00:42:16 +08:00
Mr Chen 38217e7571 Update index.py 2024-06-10 00:40:17 +08:00
Mr Chen fff22ede33 update 2024-06-10 00:26:41 +08:00
Mr Chen ab3c395f2f Update index.py 2024-06-10 00:19:09 +08:00
Mr Chen 4a4502a33c Update index.py 2024-06-10 00:17:11 +08:00
Mr Chen 07b2dcbba0 update 2024-06-10 00:13:02 +08:00
Mr Chen c582d520b7 update 2024-06-10 00:09:59 +08:00
Mr Chen 22fcff77c2 update 2024-06-10 00:05:55 +08:00
Mr Chen 4b49ca9194 Create install.sh 2024-06-09 23:54:44 +08:00
Mr Chen 95a500f09d Update .gitignore 2024-06-09 23:38:26 +08:00
Mr Chen 5f186e0bf2 Merge pull request #595 from midoks/dev
backup_ftp插件-目录备份修复2
2024-06-09 14:14:18 +08:00
Mr Chen 64ac1b2188 backup_ftp插件-目录备份修复2 2024-06-09 14:13:38 +08:00
Mr Chen e60f0b2cf7 Merge pull request #594 from midoks/dev
ftp插件-目录备份修复
2024-06-09 13:42:39 +08:00
Mr Chen aeb79cfe57 Update index.py 2024-06-09 13:39:05 +08:00
Mr Chen 05e74503c5 Update index.py 2024-06-09 13:00:15 +08:00
Mr Chen ef34b4b3f1 Merge pull request #593 from midoks/dev
mysql同步提示优化
2024-06-09 01:07:10 +08:00
Mr Chen dc22fc81e7 update 2024-06-09 00:13:17 +08:00
Mr Chen 2ce73aefad Update index.py 2024-06-09 00:07:25 +08:00
Mr Chen a8b37fb5ba Update all_mac.sh 2024-06-08 21:45:34 +08:00
Mr Chen ee1d3dec38 Update all_test.sh 2024-06-08 21:45:26 +08:00
Mr Chen dbdea53fc3 update 2024-06-07 21:08:29 +08:00
Mr Chen cc770cd61b Merge pull request #592 from midoks/dev
细节优化
2024-06-07 20:51:33 +08:00
Mr Chen 5c3f71c2e4 Update task.py 2024-06-07 20:06:20 +08:00
Mr Chen 6b61fa6136 Update public.js 2024-06-07 20:04:30 +08:00
Mr Chen 5509a7b3ae Update mw.py 2024-06-07 19:45:07 +08:00
Mr Chen 9d24d7024f Update public.js 2024-06-07 19:42:44 +08:00
Mr Chen 17405babae Update public.js 2024-06-07 19:41:57 +08:00
Mr Chen a61c636455 Update public.js 2024-06-07 19:39:38 +08:00
Mr Chen c17f6a3956 Merge pull request #591 from midoks/dev
安装脚本优化
2024-06-07 18:55:03 +08:00
Mr Chen 0042b12ad5 Update ubuntu.sh 2024-06-07 18:53:48 +08:00
Mr Chen bbbf670ec9 Merge branch 'master' into dev 2024-06-07 18:53:08 +08:00
Mr Chen 986685169a Update debian.sh 2024-06-07 18:52:19 +08:00
Mr Chen 4d160967bc Update opensuse.sh 2024-06-07 16:05:36 +08:00
Mr Chen 0163c9b728 Merge branch 'master' into dev 2024-06-07 15:12:26 +08:00
Mr Chen b6b7fa1021 Merge pull request #590 from midoks/dev
webssh 优化
2024-06-07 15:10:41 +08:00
Mr Chen 6d9d5024a0 Update ssh_terminal.py 2024-06-07 15:08:54 +08:00
Mr Chen fbe9937782 Merge pull request #589 from midoks/dev
Update webssh.js
2024-06-07 14:51:47 +08:00
Mr Chen 6b60315036 Update webssh.js 2024-06-07 14:48:25 +08:00
Mr Chen 64f15e77bc Merge pull request #588 from midoks/dev
docker相关功能优化
2024-06-07 13:51:18 +08:00
Mr Chen efc4fb9cb2 docker 优化 2024-06-07 13:49:59 +08:00
Mr Chen f1f0a0f1a5 Update mw.py 2024-06-07 13:33:07 +08:00
Mr Chen 7f696862ef Merge pull request #587 from midoks/dev
日志清理 - 优化
2024-06-06 19:35:39 +08:00
Mr Chen 4cf00c1a6b Update index.py 2024-06-06 19:34:26 +08:00
Mr Chen 2908ffc1c8 Update index.py 2024-06-06 19:32:55 +08:00
Mr Chen 761cd1f064 Update index.py 2024-06-06 19:31:06 +08:00
Mr Chen b2026ce74f Update index.py 2024-06-06 19:29:57 +08:00
Mr Chen ee565b22db Update index.py 2024-06-06 19:26:20 +08:00
Mr Chen ba34b851e4 Update index.py 2024-06-06 19:25:08 +08:00
Mr Chen aadfe8a6e8 Update index.html 2024-06-06 19:20:32 +08:00
Mr Chen 736677fdc6 Update index.py 2024-06-06 19:18:57 +08:00
Mr Chen 6870dbf711 update 2024-06-06 19:18:44 +08:00
Mr Chen 679a112a2c Update index.py 2024-06-06 18:56:09 +08:00
Mr Chen 391ca28f46 Merge branch 'master' into dev 2024-06-05 19:39:04 +08:00
Mr Chen f3e897b6c5 Merge branch 'master' into dev 2024-06-05 19:19:10 +08:00
269 changed files with 14864 additions and 1584 deletions
+1
View File
@@ -180,3 +180,4 @@ plugins/frp
plugins/file_search
plugins/proxysql
plugins/tidb
plugins/gorse
+9 -6
View File
@@ -30,7 +30,7 @@
- 吹水组 - https://t.me/mdserver_web
- 交流论坛 - https://bbs.midoks.icu
- discord - https://discord.gg/3zXk4mES
```
如果出现问题,最好私给我面板信息。不要让我猜。如果不提供,不要提出问题,自行解决。 — 座右铭
Talk is cheap, show me the code. -- linus
@@ -42,7 +42,7 @@ Talk is cheap, show me the code. -- linus
### 主要插件介绍
* OpenResty - 轻量级,占有内存少,并发能力强。
* PHP[53-83] - PHP是世界上最好的编程语言。
* PHP[53-84] - PHP是世界上最好的编程语言。
* MySQL - 一种关系数据库管理系统。
* MariaDB - 是MySQL的一个重要分支。
* MySQL[APT/YUM] - 一种关系数据库管理系统。
@@ -75,10 +75,10 @@ Talk is cheap, show me the code. -- linus
```
phpMyAdmin[4.4.15]支持MySQL[5.5-5.7]
phpMyAdmin[5.2.0]支持MySQL[8.0]
phpMyAdmin[5.2.1]支持MySQL[8.0+]
PHP[53-72]支持phpMyAdmin[4.4.15]
PHP[72-83]支持phpMyAdmin[5.2.0]
PHP[72-84]支持phpMyAdmin[5.2.1]
```
# 郑重声明
@@ -110,9 +110,12 @@ docker run -itd --name mw-server --privileged=true -p 7200:7200 -p 80:80 -p 443:
```
### 版本更新 0.17.1
### 版本更新 0.17.2
- 任务管理器-插件。
- MySQL9.0。
- zabbix,zabbix-agent测试。
- 正则匹配修复(兼容)。
- 常规更新。
### JSDelivr安装地址
+9 -10
View File
@@ -377,7 +377,7 @@ fi
return response
except Exception as ex:
# self.getError()
raise Exception("requestsPost: {}".format(self.getError(str(ex))))
raise Exception("异常: {}".format(self.getError(str(ex))))
def getRequestJson(self, response):
try:
@@ -1279,7 +1279,7 @@ fullchain.pem 粘贴到证书输入框
file = self.getHostConf(siteName)
if os.path.exists(file):
conf = mw.readFile(file)
rep = '\s*root\s*(.+);'
rep = r'\s*root\s*(.+);'
path = re.search(rep, conf).groups()[0]
return path
return ''
@@ -1391,7 +1391,8 @@ fullchain.pem 粘贴到证书输入框
raise Exception("指定订单号不存在,无法续签!")
order_index.append(index)
else:
start_time = time.time() + (30 * 86400)
# 测试一天过期
now_time = time.time()
# print(self.__config)
if not 'orders' in self.__config:
self.__config['orders'] = {}
@@ -1402,16 +1403,14 @@ fullchain.pem 粘贴到证书输入框
continue
if 'cert' in self.__config['orders'][i]:
self.__config['orders'][i]['cert_timeout'] = self.__config[
'orders'][i]['cert']['cert_timeout']
self.__config['orders'][i]['cert_timeout'] = self.__config['orders'][i]['cert']['cert_timeout']
if not 'cert_timeout' in self.__config['orders'][i]:
self.__config['orders'][i][
'cert_timeout'] = int(time.time())
self.__config['orders'][i]['cert_timeout'] = int(time.time())
if self.__config['orders'][i]['cert_timeout'] > start_time:
msg = "|-本次跳过域名: {},未过期!".format(
self.__config['orders'][i]['domains'][0])
# print(self.__config['orders'][i]['domains'][0], (self.__config['orders'][i]['cert_timeout'] - now_time)/86400, now_time)
if self.__config['orders'][i]['cert_timeout'] - now_time > 83*86400:
msg = "|-本次跳过域名: {},未过期!".format(self.__config['orders'][i]['domains'][0])
writeLog(msg)
continue
+1 -1
View File
@@ -28,7 +28,7 @@ from flask import request
class config_api:
__version = '0.17.1'
__version = '0.17.2'
__api_addr = 'data/api.json'
# 统一默认配置文件
+5 -1
View File
@@ -539,6 +539,10 @@ fi''' % (mw.getRunDir(),)
head = head + start_head + source_bin_activate + "\n"
log = '.log'
#所有
if param['sname'] == 'ALL':
log = ''
script_dir = mw.getRunDir() + "/scripts"
source_stype = 'database'
if stype.find('database_') > -1:
@@ -575,7 +579,7 @@ fi''' % (mw.getRunDir(),)
else:
shell = head + param['sbody'].replace("\r\n", "\n")
shell += '''
shell += '''
echo "----------------------------------------------------------------------------"
endDate=`date +"%Y-%m-%d %H:%M:%S"`
END_MW_SHELL_TIME=`date +"%s"`
+2 -2
View File
@@ -61,8 +61,8 @@ class Sql():
self.__DB_FILE = 'data/' + name + '.db'
return self
def dbPos(self, path, name):
self.__DB_FILE = path + '/' + name + '.db'
def dbPos(self, path, name, suffix_name = 'db'):
self.__DB_FILE = path + '/' + name + '.' + suffix_name
return self
def table(self, table):
+11 -11
View File
@@ -50,7 +50,7 @@ class firewall_api:
port = request.form.get('port', '').strip()
ps = request.form.get('ps', '').strip()
rep = "^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}(\/\d{1,2})?$"
rep = r"^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}(\/\d{1,2})?$"
if not re.search(rep, port):
return mw.returnJson(False, '您输入的IP地址不合法!')
address = port
@@ -97,7 +97,7 @@ class firewall_api:
if not self.getFwStatus():
self.setFw(0)
rep = "^\d{1,5}(:\d{1,5})?$"
rep = r"^\d{1,5}(:\d{1,5})?$"
if not re.search(rep, port):
return mw.returnData(False, '端口范围不正确!')
@@ -217,7 +217,7 @@ class firewall_api:
file = '/etc/ssh/sshd_config'
conf = mw.readFile(file)
rep = "#*Port\s+([0-9]+)\s*\n"
rep = r"#*Port\s+([0-9]+)\s*\n"
port = re.search(rep, conf).groups(0)[0]
isPing = True
@@ -227,7 +227,7 @@ class firewall_api:
else:
file = '/etc/sysctl.conf'
sys_conf = mw.readFile(file)
rep = "#*net\.ipv4\.icmp_echo_ignore_all\s*=\s*([0-9]+)"
rep = r"#*net\.ipv4\.icmp_echo_ignore_all\s*=\s*([0-9]+)"
tmp = re.search(rep, sys_conf).groups(0)[0]
if tmp == '1':
isPing = False
@@ -248,7 +248,7 @@ class firewall_api:
data['pass_prohibit_status'] = False
# 密码登陆配置检查
pass_rep = "PasswordAuthentication\s+(\w*)\s*\n"
pass_rep = r"PasswordAuthentication\s+(\w*)\s*\n"
pass_status = re.search(pass_rep, conf)
if pass_status:
if pass_status and pass_status.groups(0)[0].strip() == 'no':
@@ -277,7 +277,7 @@ class firewall_api:
file = '/etc/ssh/sshd_config'
conf = mw.readFile(file)
rep = "#*Port\s+([0-9]+)\s*\n"
rep = r"#*Port\s+([0-9]+)\s*\n"
conf = re.sub(rep, "Port " + port + "\n", conf)
mw.writeFile(file, conf)
@@ -330,17 +330,17 @@ class firewall_api:
conf = mw.readFile(file)
pass_rep = "PasswordAuthentication\s+(\w*)\s*\n"
pass_rep = r"PasswordAuthentication\s+(\w*)\s*\n"
pass_status = re.search(pass_rep, conf)
if not pass_status:
rep = "(#)?PasswordAuthentication\s+(\w*)\s*\n"
rep = r"(#)?PasswordAuthentication\s+(\w*)\s*\n"
conf = re.sub(rep, "PasswordAuthentication yes\n", conf)
if status == '1':
rep = "PasswordAuthentication\s+(\w*)\s*\n"
rep = r"PasswordAuthentication\s+(\w*)\s*\n"
conf = re.sub(rep, "PasswordAuthentication yes\n", conf)
else:
rep = "PasswordAuthentication\s+(\w*)\s*\n"
rep = r"PasswordAuthentication\s+(\w*)\s*\n"
conf = re.sub(rep, "PasswordAuthentication no\n", conf)
mw.writeFile(file, conf)
mw.execShell("systemctl restart sshd.service")
@@ -355,7 +355,7 @@ class firewall_api:
filename = '/etc/sysctl.conf'
conf = mw.readFile(filename)
if conf.find('net.ipv4.icmp_echo') != -1:
rep = u"net\.ipv4\.icmp_echo.*"
rep = r"net\.ipv4\.icmp_echo.*"
conf = re.sub(rep, 'net.ipv4.icmp_echo_ignore_all=' + status, conf)
else:
conf += "\nnet.ipv4.icmp_echo_ignore_all=" + status
+4 -1
View File
@@ -124,10 +124,13 @@ class logs_api:
if log_suffix[0] in ['gz', 'xz', 'bz2', 'asl']:
continue
if log_file in ['.', '..', 'faillog', 'fontconfig.log', 'unattended-upgrades', 'tallylog']:
if log_file in ['.', '..']:
continue
filename = os.path.join(log_dir, log_file)
if not os.path.exists(filename):
continue
if os.path.isfile(filename):
file_size = os.path.getsize(filename)
if not file_size:
+20 -1
View File
@@ -199,11 +199,27 @@ def getFileSuffix(file):
return ext
def isAppleSystem():
if getOs() == 'darwin':
return True
return False
def isDocker():
return os.path.exists('/.dockerenv')
def isSupportSystemctl():
if isAppleSystem():
return False
if isDocker():
return False
current_os = getOs()
if current_os.startswith("freebsd"):
return False
return True
def isDebugMode():
if isAppleSystem():
@@ -1289,7 +1305,10 @@ def getClientIp():
def checkDomainPanel():
tmp = getHost()
domain = readFile('data/bind_domain.pl')
port = readFile('data/port.pl').strip()
port = 7200
if os.path.exists('data/port.pl'):
port = readFile('data/port.pl').strip()
scheme = 'http'
+9 -3
View File
@@ -480,7 +480,7 @@ class plugins_api:
plugin_path = mw.getPluginDir() + '/' + plugin_name
if not os.path.exists(plugin_path):
print(mw.execShell('mkdir -p ' + plugin_path))
mw.execShell("\cp -rf " + tmp_path + '/* ' + plugin_path + '/')
mw.execShell("cp -rf " + tmp_path + '/* ' + plugin_path + '/')
mw.execShell('chmod -R 755 ' + plugin_path)
p_info = mw.readFile(plugin_path + '/info.json')
if p_info:
@@ -1090,9 +1090,15 @@ class plugins_api:
if not os.path.exists(package):
return (False, "插件不存在!")
sys.path.append(package)
if not package in sys.path:
sys.path.append(package)
eval_str = "__import__('" + script + "')." + func + '(' + args + ')'
newRet = eval(eval_str)
newRet = None
try:
newRet = eval(eval_str)
except Exception as e:
print(mw.getTracebackInfo())
if mw.isDebugMode():
print('callback', eval_str)
+8 -8
View File
@@ -2533,7 +2533,9 @@ location ^~ {from} {\n\
def getPhpVersion(self):
phpVersions = ('00', '52', '53', '54', '55',
'56', '70', '71', '72', '73', '74', '80', '81', '82', '83')
'56', '70', '71', '72', '73',
'74', '80', '81', '82', '83',
'84')
data = []
for val in phpVersions:
tmp = {}
@@ -2667,10 +2669,8 @@ location ^~ {from} {\n\
return mw.returnJson(False, '不要以网站根目录创建站点!')
siteMenu = json.loads(webname)
self.siteName = self.toPunycode(
siteMenu['domain'].strip().split(':')[0]).strip()
self.sitePath = self.toPunycodePath(
self.getPath(path.replace(' ', '')))
self.siteName = self.toPunycode(siteMenu['domain'].strip().split(':')[0]).strip()
self.sitePath = self.toPunycodePath(self.getPath(path.replace(' ', '')))
self.sitePort = port.strip().replace(' ', '')
self.phpVersion = version
@@ -2802,7 +2802,7 @@ location ^~ {from} {\n\
add_header Strict-Transport-Security "max-age=63072000";
add_header Alt-Svc 'h3=":443";ma=86400';
"""
if version != '1.25.3.1':
if not version.startswith('1.25'):
http3Header = '';
sslStr = """#error_page 404/404.html;
@@ -2820,12 +2820,12 @@ location ^~ {from} {\n\
conf = conf.replace('#error_page 404/404.html;', sslStr)
rep = "listen\s+([0-9]+)\s*[default_server]*;"
rep = "listen\s+([0-9]+)\s*[default_server|reuseport]*;"
tmp = re.findall(rep, conf)
if not mw.inArray(tmp, '443'):
listen = re.search(rep, conf).group()
if version == '1.25.3.1':
if version.startswith('1.25'):
http_ssl = "\n\tlisten 443 ssl;"
http_ssl = http_ssl + "\n\tlisten [::]:443 ssl;"
http_ssl = http_ssl + "\n\tlisten 443 quic;"
+1 -1
View File
@@ -331,7 +331,7 @@ class ssh_terminal(object):
def getSshInfo(self, file):
rdata = mw.readFile(file)
destr = mw.enDoubleCrypt('mdserver-web', rdata)
destr = mw.deDoubleCrypt('mdserver-web', rdata)
return json.loads(destr)
def setAttr(self, sid, info):
+1 -1
View File
@@ -23,7 +23,7 @@ class ORM:
__DB_CHARSET = "utf8"
def __Conn(self):
# print(self.__DB_HOST, self.__DB_USER)
# print(self.__DB_HOST, self.__DB_USER, self.__DB_PASS, self.__DB_SOCKET)
'''连接数据库'''
try:
+1 -1
View File
@@ -58,7 +58,7 @@ class FtpPSClient:
default_backup_path = "/backup/"
config_file = "cfg.json"
def __init__(self, load_config=True, timeout=10):
def __init__(self, load_config=True, timeout=600):
self.timeout = timeout
if load_config:
data = self.get_config()
+16 -2
View File
@@ -173,6 +173,15 @@ def deleteFile():
return mw.returnJson(True, "删除成功")
return mw.returnJson(False, "删除失败")
def findPathName(path, filename):
f = os.scandir(path)
l = []
for ff in f:
t = {}
if ff.name.find(filename) > -1:
t['filename'] = path + '/' + ff.name
l.append(t)
return l
def backupAllFunc(stype):
os.chdir(mw.getRunDir())
@@ -202,6 +211,7 @@ def backupAllFunc(stype):
backups = sql.table('backup').where(
'type=? and pid=?', ('1', pid)).field('id,filename').select()
if stype == 'path':
backup_dir = mw.getBackupDir()
backup_path = backup_dir + '/path'
_name = 'path_{}'.format(os.path.basename(name))
backups = findPathName(backup_path, _name)
@@ -237,6 +247,10 @@ def backupAllFunc(stype):
bk_name = stype
find_path = mw.getBackupDir() + '/' + bk_name + '/' + bk_prefix + '_' + name
if stype == 'path':
_name = 'path_{}'.format(os.path.basename(name))
find_path = mw.getBackupDir() + '/path/'+_name
find_new_file = "ls " + find_path + \
"_* | grep '.gz' | cut -d \ -f 1 | awk 'END {print}'"
@@ -245,7 +259,7 @@ def backupAllFunc(stype):
mw.echoInfo("not find upload file!")
return ''
print("|-准备上传文件 {}".format(filename))
mw.echoInfo("准备上传文件 {}".format(filename))
ftp = FtpPSClient()
ftp.uploadFile(filename, stype)
@@ -259,7 +273,7 @@ def backupAllFunc(stype):
fn = os.path.basename(backup['filename'])
object_name = ftp.buildDirName(stype, fn)
ftp.deleteFile(object_name)
mw.echoInfo("---已清理远程过期备份文件:" + object_name)
mw.echoInfo("已清理远程过期备份文件:" + object_name)
sep -= 1
if sep < 0:
break
+46
View File
@@ -3,6 +3,7 @@
<div class="bt-w-menu">
<p class="bgw" onclick="pluginService('clean');">服务</p>
<p onclick="pluginConfig('clean');">配置修改</p>
<p onclick="commonFunc();">常用功能</p>
<p onclick="pluginLogs('clean',null,'run_log');">运行日志</p>
<p onclick="pRead()">说明</p>
</div>
@@ -12,8 +13,53 @@
</div>
</div>
<script type="text/javascript">
pluginService('clean');
function cleanPost(method, version, args, callback){
var loadT = layer.msg('正在获取...', { icon: 16, time: 0, shade: 0.3 });
var req_data = {};
req_data['name'] = 'clean';
req_data['func'] = method;
req_data['version'] = version;
if (typeof(args) == 'string'){
req_data['args'] = JSON.stringify(toArrayObject(args));
} else {
req_data['args'] = JSON.stringify(args);
}
$.post('/plugins/run', req_data, function(data) {
layer.close(loadT);
if (!data.status){
layer.msg(data.msg,{icon:0,time:2000,shade: [10, '#000']});
return;
}
if(typeof(callback) == 'function'){
callback(data);
}
},'json');
}
function cleanRun(){
cleanPost('clean_run', '', {}, function(rdata){
// var rdata = $.parseJSON(rdata.data);
// layer.msg(rdata.msg, { icon: rdata.status ? 1 : 2 });
});
layer.msg("执行成功!", { icon: 1});
}
function commonFunc(){
con = '<hr/><p class="conf_p" style="text-align:center;">\
<button class="btn btn-default btn-sm" onclick="cleanRun()">手动执行</button> \
</p>';
$(".soft-man-con").html(con);
}
function pRead(){
var readme = '<ul class="help-info-text c7">';
+38 -1
View File
@@ -74,7 +74,6 @@ def initConf():
content = ""
clog = [
"/var/spool/clientmqueue/*",
"/var/log/cron-*",
"/var/log/maillog-*",
"/var/log/secure-*",
@@ -82,9 +81,36 @@ def initConf():
"/var/log/yum.log-*",
"/var/log/messages-*",
"/var/log/btmp-*",
"/var/log/auth.*",
"/var/log/messages.*",
"/var/log/debug.*",
"/var/log/syslog.*",
"/var/log/btmp.*",
"/var/log/sa/sa*",
"/var/log/sysstat/sa*",
"/var/log/atop/atop*",
"/var/log/anaconda/*.log",
"/var/log/dpkg.log.*",
"/var/log/alternatives.log.*",
"/var/log/user.log.*",
"/var/log/kern.log.*",
"/var/log/daemon.log.*",
"/var/log/*.gz",
"/var/log/*.xz",
"/var/log/*.log.*",
"/var/log/audit/audit.log.*",
"/var/log/hawkey.log-*",
"/var/log/apt/*.gz",
"/var/log/apt/*.xz",
"/var/log/rhsm/rhsm.log-*",
"/var/log/rhsm/rhsmcertd.log-*",
"/var/log/exim4/*.gz",
"/var/log/journal/*",
"/var/spool/clientmqueue/*",
"/tmp/yum_save_*",
"/tmp/tmp.*",
]
@@ -99,6 +125,7 @@ def initConf():
"/var/log/secure",
"/var/log/lastlog",
"/var/log/cron",
"/www/wwwlogs",
"/www/server/rsyncd",
"/www/server/sphinx/index",
"/www/server/mongodb/logs",
@@ -201,6 +228,13 @@ def cleanDirLog(path):
cleanDirLog(abspath)
def cleanRun():
plugin_dir = getPluginDir()
log_file = getServerDir()+'/clean.log'
cmd = 'python3 '+plugin_dir+'/index.py clean > '+log_file
os.system(cmd)
return mw.returnJson(True, '执行成功!')
def cleanLog():
conf = getConf()
clist = mw.readFile(conf).strip()
@@ -225,6 +259,7 @@ def cleanLog():
cleanDirLog(abspath)
continue
if __name__ == "__main__":
func = sys.argv[1]
if func == 'status':
@@ -243,5 +278,7 @@ if __name__ == "__main__":
print(runLog())
elif func == 'clean':
cleanLog()
elif func == 'clean_run':
print(cleanRun())
else:
print('error')
+1 -1
View File
@@ -115,7 +115,7 @@ def removeBgTask():
data = api.delete(cfg["task_id"])
if data[0]:
cfg["task_id"] = -1
mw.writeFile(getTaskConf(), json.loads(cfg))
mw.writeFile(getTaskConf(), json.dumps(cfg))
return True
return False
+21
View File
@@ -17,6 +17,27 @@ if [ -f ${rootPath}/bin/activate ];then
source ${rootPath}/bin/activate
fi
# {
# "registry-mirrors": [
# "http://hub-mirror.c.163.com",
# "https://docker.mirrors.ustc.edu.cn",
# "https://registry.docker-cn.com"
# ]
# }
# sudo mkdir -p /etc/docker
# sudo tee /etc/docker/daemon.json <<-'EOF'
# {
# "registry-mirrors": [
# "http://hub-mirror.c.163.com",
# "https://docker.mirrors.ustc.edu.cn",
# "https://registry.docker-cn.com"
# ]
# }
# EOF
# sudo systemctl daemon-reload
# sudo systemctl restart docker
Install_Docker()
{
# which docker
@@ -9,3 +9,14 @@ serverPath=$(dirname "$rootPath")
install_tmp=${rootPath}/tmp/mw_install.pl
SYS_ARCH=`arch`
# export GOPROXY=https://goproxy.io
# export GO111MODULE=on
apt -y install build-essential git make libelf-dev strace tar bpfcc-tools libbpf-dev
# clang -v
apt -y install clang llvm
apt -y install golang
+6 -6
View File
@@ -170,12 +170,12 @@ def initDreplace():
def getRootUrl():
content = mw.readFile(getConf())
rep = 'ROOT_URL\s*=\s*(.*)'
rep = r'ROOT_URL\s*=\s*(.*)'
tmp = re.search(rep, content)
if tmp:
return tmp.groups()[0]
rep = 'EXTERNAL_URL\s*=\s*(.*)'
rep = r'EXTERNAL_URL\s*=\s*(.*)'
tmp = re.search(rep, content)
if tmp:
return tmp.groups()[0]
@@ -184,7 +184,7 @@ def getRootUrl():
def getSshPort():
content = mw.readFile(getConf())
rep = 'SSH_PORT\s*=\s*(.*)'
rep = r'SSH_PORT\s*=\s*(.*)'
tmp = re.search(rep, content)
if not tmp:
return ''
@@ -193,7 +193,7 @@ def getSshPort():
def getHttpPort():
content = mw.readFile(getConf())
rep = 'HTTP_PORT\s*=\s*(.*)'
rep = r'HTTP_PORT\s*=\s*(.*)'
tmp = re.search(rep, content)
if not tmp:
return ''
@@ -202,7 +202,7 @@ def getHttpPort():
def getRootPath():
content = mw.readFile(getConf())
rep = 'ROOT\s*=\s*(.*)'
rep = r'ROOT\s*=\s*(.*)'
tmp = re.search(rep, content)
if not tmp:
return ''
@@ -215,7 +215,7 @@ def getDbConfValue():
return {}
content = mw.readFile(conf)
rep_scope = "\[database\](.*?)\["
rep_scope = r"\[database\](.*?)\["
tmp = re.findall(rep_scope, content, re.S)
rep = '(\w*)\s*=\s*(.*)'
+7 -7
View File
@@ -173,12 +173,12 @@ def initDreplace():
def getRootUrl():
content = mw.readFile(getConf())
rep = 'ROOT_URL\s*=\s*(.*)'
rep = r'ROOT_URL\s*=\s*(.*)'
tmp = re.search(rep, content)
if tmp:
return tmp.groups()[0]
rep = 'EXTERNAL_URL\s*=\s*(.*)'
rep = r'EXTERNAL_URL\s*=\s*(.*)'
tmp = re.search(rep, content)
if tmp:
return tmp.groups()[0]
@@ -187,7 +187,7 @@ def getRootUrl():
def getSshPort():
content = mw.readFile(getConf())
rep = 'SSH_PORT\s*=\s*(.*)'
rep = r'SSH_PORT\s*=\s*(.*)'
tmp = re.search(rep, content)
if not tmp:
return ''
@@ -196,7 +196,7 @@ def getSshPort():
def getHttpPort():
content = mw.readFile(getConf())
rep = 'HTTP_PORT\s*=\s*(.*)'
rep = r'HTTP_PORT\s*=\s*(.*)'
tmp = re.search(rep, content)
if not tmp:
return ''
@@ -205,7 +205,7 @@ def getHttpPort():
def getRootPath():
content = mw.readFile(getConf())
rep = 'ROOT\s*=\s*(.*)'
rep = r'ROOT\s*=\s*(.*)'
tmp = re.search(rep, content)
if not tmp:
return ''
@@ -218,10 +218,10 @@ def getDbConfValue():
return {}
content = mw.readFile(conf)
rep_scope = "\[database\](.*?)\["
rep_scope = r"\[database\](.*?)\["
tmp = re.findall(rep_scope, content, re.S)
rep = '(\w*)\s*=\s*(.*)'
rep = r'(\w*)\s*=\s*(.*)'
tmp = re.findall(rep, tmp[0])
r = {}
for x in range(len(tmp)):
+1 -1
View File
@@ -253,7 +253,7 @@ def getPort():
conf = getServerDir() + '/keepalived.conf'
content = mw.readFile(conf)
rep = "^(" + 'port' + ')\s*([.0-9A-Za-z_& ~]+)'
rep = r"^(" + 'port' + r')\s*([.0-9A-Za-z_& ~]+)'
tmp = re.search(rep, content, re.M)
if tmp:
return tmp.groups()[1]
+1
View File
@@ -50,6 +50,7 @@ CREATE TABLE IF NOT EXISTS `slave_sync_user` (
`pass` TEXT,
`mode` TEXT,
`cmd` TEXT,
`db` TEXT,
`addtime` TEXT
);
+1 -1
View File
@@ -38,7 +38,7 @@ max_connections = 500
max_connect_errors = 100
open_files_limit = 65535
skip-name-resolve = on
skip-name-resolve = 1
#skip-networking
#skip-external-locking
#loose-skip-innodb
+177 -26
View File
@@ -86,21 +86,21 @@ def getConf():
def getDataDir():
file = getConf()
content = mw.readFile(file)
rep = 'datadir\s*=\s*(.*)'
rep = r'datadir\s*=\s*(.*)'
tmp = re.search(rep, content)
return tmp.groups()[0].strip()
def getLogBinName():
file = getConf()
content = mw.readFile(file)
rep = 'log-bin\s*=\s*(.*)'
rep = r'log-bin\s*=\s*(.*)'
tmp = re.search(rep, content)
return tmp.groups()[0].strip()
def getPidFile():
file = getConf()
content = mw.readFile(file)
rep = 'pid-file\s*=\s*(.*)'
rep = r'pid-file\s*=\s*(.*)'
tmp = re.search(rep, content)
return tmp.groups()[0].strip()
@@ -108,7 +108,7 @@ def getPidFile():
def getDbPort():
file = getConf()
content = mw.readFile(file)
rep = 'port\s*=\s*(.*)'
rep = r'port\s*=\s*(.*)'
tmp = re.search(rep, content)
return tmp.groups()[0].strip()
@@ -116,7 +116,7 @@ def getDbPort():
def getDbServerId():
file = getConf()
content = mw.readFile(file)
rep = 'server-id\s*=\s*(.*)'
rep = r'server-id\s*=\s*(.*)'
tmp = re.search(rep, content)
return tmp.groups()[0].strip()
@@ -124,7 +124,7 @@ def getDbServerId():
def getSocketFile():
file = getConf()
content = mw.readFile(file)
rep = 'socket\s*=\s*(.*)'
rep = r'socket\s*=\s*(.*)'
tmp = re.search(rep, content)
return tmp.groups()[0].strip()
@@ -378,7 +378,7 @@ def getErrorLog():
def getShowLogFile():
file = getConf()
content = mw.readFile(file)
rep = 'slow-query-log-file\s*=\s*(.*)'
rep = r'slow-query-log-file\s*=\s*(.*)'
tmp = re.search(rep, content)
return tmp.groups()[0].strip()
@@ -547,7 +547,7 @@ def initdUinstall():
def getMyDbPos():
file = getConf()
content = mw.readFile(file)
rep = 'datadir\s*=\s*(.*)'
rep = r'datadir\s*=\s*(.*)'
tmp = re.search(rep, content)
return tmp.groups()[0].strip()
@@ -597,7 +597,7 @@ def setMyDbPos():
def getMyPort():
file = getConf()
content = mw.readFile(file)
rep = 'port\s*=\s*(.*)'
rep = r'port\s*=\s*(.*)'
tmp = re.search(rep, content)
return tmp.groups()[0].strip()
@@ -611,7 +611,7 @@ def setMyPort():
port = args['port']
file = getConf()
content = mw.readFile(file)
rep = "port\s*=\s*([0-9]+)\s*\n"
rep = r"port\s*=\s*([0-9]+)\s*\n"
content = re.sub(rep, 'port = ' + port + '\n', content)
mw.writeFile(file, content)
restart()
@@ -688,7 +688,7 @@ def setDbStatus():
s = 'K'
if g in emptys:
s = ''
rep = '\s*' + g + '\s*=\s*\d+(M|K|k|m|G)?\n'
rep = r'\s*' + g + r'\s*=\s*\d+(M|K|k|m|G)?\n'
c = g + ' = ' + args[g] + s + '\n'
if content.find(g) != -1:
content = re.sub(rep, '\n' + c, content, 1)
@@ -867,6 +867,81 @@ def importDbExternal():
return mw.returnJson(True, 'ok')
def importDbExternalProgress():
args = getArgs()
data = checkArgs(args, ['file', 'name'])
if not data[0]:
return data[1]
file = args['file']
name = args['name']
cmd = 'cd '+mw.getServerDir()+'/mdserver-web && source bin/activate && '
cmd += 'python3 '+mw.getServerDir()+'/mdserver-web/plugins/mariadb/index.py import_db_external_progress_bar {"file":"'+file+'","name":"'+name+'"}'
return mw.returnJson(True, 'ok',cmd)
def importDbExternalProgressBar():
args = getArgs()
data = checkArgs(args, ['file', 'name'])
if not data[0]:
return data[1]
file = args['file']
name = args['name']
import_dir = mw.getRootDir() + '/backup/import/'
file_path = import_dir + file
if not os.path.exists(file_path):
return mw.returnJson(False, '文件突然消失?')
exts = ['sql', 'gz', 'zip']
ext = mw.getFileSuffix(file)
if ext not in exts:
return mw.returnJson(False, '导入数据库格式不对!')
tmp = file.split('/')
tmpFile = tmp[len(tmp) - 1]
tmpFile = tmpFile.replace('.sql.' + ext, '.sql')
tmpFile = tmpFile.replace('.' + ext, '.sql')
tmpFile = tmpFile.replace('tar.', '')
# print(tmpFile)
import_sql = ""
if file.find("sql.gz") > -1:
cmd = 'cd ' + import_dir + ' && gzip -dc ' + \
file + " > " + import_dir + tmpFile
info = mw.execShell(cmd)
if info[1] == "":
import_sql = import_dir + tmpFile
if file.find(".zip") > -1:
cmd = 'cd ' + import_dir + ' && unzip -o ' + file
mw.execShell(cmd)
import_sql = import_dir + tmpFile
if file.find("tar.gz") > -1:
cmd = 'cd ' + import_dir + ' && tar -zxvf ' + file
mw.execShell(cmd)
import_sql = import_dir + tmpFile
if file.find(".sql") > -1 and file.find(".sql.gz") == -1:
import_sql = import_dir + file
if import_sql == "":
return mw.returnJson(False, '未找SQL文件')
pwd = pSqliteDb('config').where('id=?', (1,)).getField('mysql_root')
sock = getSocketFile()
my_cnf = getConf()
mysql_cmd = getServerDir() + '/bin/mariadb --defaults-file=' + my_cnf + \
' -uroot -p"' + pwd + '" -f ' + name
mysql_cmd_progress_bar = "pv -t -p " + import_sql + '|'+ mysql_cmd
print(mysql_cmd_progress_bar)
rdata = os.system(mysql_cmd_progress_bar)
return ""
def deleteDbBackup():
args = getArgs()
@@ -1205,7 +1280,7 @@ def addDb():
dataAccess = args['dataAccess'].strip()
ps = args['ps'].strip()
reg = "^[\w\.-]+$"
reg = r"^[\w\.-]+$"
if not re.match(reg, args['name']):
return mw.returnJson(False, '数据库名称不能带有特殊符号!')
checks = ['root', 'mysql', 'test', 'sys', 'panel_logs']
@@ -1771,8 +1846,7 @@ def setDbMaster(version):
if not isHas:
prefix = '#binlog-do-db'
con = con.replace(
prefix, prefix + "\nbinlog-do-db=" + args['name'])
con = con.replace(prefix, prefix + "\nbinlog-do-db=" + args['name'])
mw.writeFile(conf, con)
restart(version)
@@ -1801,8 +1875,7 @@ def setDbSlave(version):
if not isHas:
prefix = '#replicate-do-db'
con = con.replace(
prefix, prefix + "\nreplicate-do-db=" + args['name'])
con = con.replace(prefix, prefix + "\nreplicate-do-db=" + args['name'])
mw.writeFile(conf, con)
restart(version)
@@ -1922,7 +1995,7 @@ def addMasterRepSlaveUser(version=''):
# address = args['address'].strip()
# dataAccess = args['dataAccess'].strip()
reg = "^[\w-]+$"
reg = r"^[\w-]+$"
if not re.match(reg, username):
return mw.returnJson(False, '用户名不能带有特殊符号!')
checks = ['root', 'mysql', 'test', 'sys', 'panel_logs']
@@ -1958,6 +2031,64 @@ def addMasterRepSlaveUser(version=''):
return mw.returnJson(True, '添加成功!')
def getMasterRepSlaveUserCmdSsh(version):
args = getArgs()
data = checkArgs(args, ['username', 'db'])
if not data[0]:
return data[1]
psdb = pSqliteDb('master_replication_user')
f = 'username,password'
username = args['username']
if username == '':
count = psdb.count()
if count == 0:
return mw.returnJson(False, '请添加同步账户!')
clist = psdb.field(f).limit('1').order('id desc').select()
else:
clist = psdb.field(f).where("username=?", (username,)).limit(
'1').order('id desc').select()
if len(clist) == 0:
return mw.returnJson(False, '错误同步账户!')
ip = mw.getLocalIp()
port = getMyPort()
db = pMysqlDb()
mstatus = db.query('show master status')
if len(mstatus) == 0:
return mw.returnJson(False, '未开启!')
mode = recognizeDbMode()
# 查找同步点
# SELECT BINLOG_GTID_POS('master1-bin.000002', 561866201);
sid = getDbServerId()
connection_name = ""
if sid != '':
connection_name = "'r{}' ".format(sid)
# MASTER_USE_GTID={current_pos|slave_pos|no}
# current_pos 依赖-> select @@global.gtid_current_pos;
# slave_pos 依赖-> select @@global.gtid_slave_pos;
# no -> 啥都不依赖,保证多主同步成功。同步出现问题,根据日志查找问题。
base_sql = "CHANGE MASTER " + connection_name + "TO MASTER_HOST='" + ip + "', MASTER_PORT=" + port + ", MASTER_USER='" + \
clist[0]['username'] + "', MASTER_PASSWORD='" + \
clist[0]['password'];
sql = ''
sql += base_sql + "', MASTER_LOG_FILE='" + mstatus[0]["File"] + \
"',MASTER_LOG_POS=" + str(mstatus[0]["Position"])
data = {}
data['cmd'] = sql
data["info"] = clist[0]
data['mode'] = mode
return mw.returnJson(True, 'ok!', data)
def getMasterRepSlaveUserCmd(version):
args = getArgs()
@@ -2004,16 +2135,15 @@ def getMasterRepSlaveUserCmd(version):
# slave_pos 依赖-> select @@global.gtid_slave_pos;
# no -> 啥都不依赖,保证多主同步成功。同步出现问题,根据日志查找问题。
if mode == "gtid":
sql = "CHANGE MASTER " + connection_name + "TO MASTER_HOST='" + ip + "', MASTER_PORT=" + port + ", MASTER_USER='" + \
clist[0]['username'] + "', MASTER_PASSWORD='" + \
clist[0]['password'] + "',MASTER_USE_GTID=no,MASTER_CONNECT_RETRY=10;"
else:
sql = "CHANGE MASTER " + connection_name + "TO MASTER_HOST='" + ip + "', MASTER_PORT=" + port + ", MASTER_USER='" + \
base_sql = "CHANGE MASTER " + connection_name + "TO MASTER_HOST='" + ip + "', MASTER_PORT=" + port + ", MASTER_USER='" + \
clist[0]['username'] + "', MASTER_PASSWORD='" + \
clist[0]['password'] + \
"', MASTER_LOG_FILE='" + mstatus[0]["File"] + \
clist[0]['password'];
sql = ''
sql += base_sql + "', MASTER_LOG_FILE='" + mstatus[0]["File"] + \
"',MASTER_LOG_POS=" + str(mstatus[0]["Position"])
sql += "<br/><hr/>";
sql += base_sql + "',MASTER_USE_GTID=slave_pos,MASTER_CONNECT_RETRY=10;";
sql += "<br/>";
data = {}
data['cmd'] = sql
@@ -2469,7 +2599,7 @@ def initSlaveStatusSSH(version=''):
username='root', pkey=key)
db_user = data['db_user']
cmd = 'cd /www/server/mdserver-web && source bin/activate && python3 plugins/mariadb/index.py get_master_rep_slave_user_cmd {"username":"' + db_user + '","db":""}'
cmd = 'cd /www/server/mdserver-web && source bin/activate && python3 plugins/mariadb/index.py get_master_rep_slave_user_cmd_ssh {"username":"' + db_user + '","db":""}'
stdin, stdout, stderr = ssh.exec_command(cmd)
result = stdout.read()
result = result.decode('utf-8')
@@ -2920,6 +3050,19 @@ def fullSync(version=''):
return json.dumps({'code': 0, 'msg': '点击开始,开始同步!', 'progress': 0})
def fullSyncCmd():
time_all_s = time.time()
args = getArgs()
data = checkArgs(args, ['db', 'sign'])
if not data[0]:
return data[1]
db = args['db']
sign = args['sign']
cmd = 'cd '+mw.getServerDir()+'/mdserver-web && source bin/activate && python3 plugins/mariadb/index.py do_full_sync {"db":"'+db+'","sign":"'+sign+'"}'
return mw.returnJson(True,'ok',cmd)
# python3 plugins/mariadb/index.py do_full_sync {"db":"demo1","sign":"","beigin":"1"}
def doFullSync(version=''):
mode_file = getSyncModeFile()
@@ -3258,6 +3401,10 @@ if __name__ == "__main__":
print(importDbBackup())
elif func == 'import_db_external':
print(importDbExternal())
elif func == 'import_db_external_progress':
print(importDbExternalProgress())
elif func == 'import_db_external_progress_bar':
print(importDbExternalProgressBar())
elif func == 'delete_db_backup':
print(deleteDbBackup())
elif func == 'get_db_backup_list':
@@ -3322,6 +3469,8 @@ if __name__ == "__main__":
print(delMasterRepSlaveUser(version))
elif func == 'update_master_rep_slave_user':
print(updateMasterRepSlaveUser(version))
elif func == 'get_master_rep_slave_user_cmd_ssh':
print(getMasterRepSlaveUserCmdSsh(version))
elif func == 'get_master_rep_slave_user_cmd':
print(getMasterRepSlaveUserCmd(version))
elif func == 'get_slave_list':
@@ -3362,6 +3511,8 @@ if __name__ == "__main__":
print(fullSync(version))
elif func == 'do_full_sync':
print(doFullSync(version))
elif func == 'full_sync_cmd':
print(fullSyncCmd())
elif func == 'dump_mysql_data':
print(dumpMysqlData(version))
elif func == 'sync_database_repair':
+1 -1
View File
@@ -8,7 +8,7 @@
"uninstall_pre_inspection":true,
"checks": "server/mariadb",
"path": "server/mariadb",
"versions":["10.6","10.7","10.8","10.9","10.11","11.0","11.1","11.2","11.3"],
"versions":["10.6","10.7","10.8","10.9","10.11","11.0","11.1","11.2","11.3","11.4"],
"shell":"install.sh",
"checks":"server/mariadb",
"path":"server/mariadb",
+10 -2
View File
@@ -20,13 +20,21 @@ install_tmp=${rootPath}/tmp/mw_install.pl
action=$1
type=$2
if id mysql &> /dev/null ;then
echo "mysql UID is `id -u mysql`"
echo "mysql Shell is `grep "^mysql:" /etc/passwd |cut -d':' -f7 `"
else
groupadd mysql
useradd -g mysql -s /usr/sbin/nologin mysql
fi
if [ "${2}" == "" ];then
echo '缺少安装脚本...' > $install_tmp
echo '缺少安装脚本...'
exit 0
fi
if [ ! -d $curPath/versions/$2 ];then
echo '缺少安装脚本2...' > $install_tmp
echo '缺少安装脚本2...'
exit 0
fi
+70 -13
View File
@@ -938,6 +938,31 @@ function importDbExternal(file,name){
});
}
function importDbExternalProgress(file,name){
myPost('import_db_external_progress',{file:file,name:name}, function(data){
var rdata = $.parseJSON(data.data);
layer.open({
title: "手动导入命令CMD【显示进度】",
area: ['600px', '180px'],
type:1,
closeBtn: 1,
shadeClose: false,
btn:["复制","取消"],
content: '<div class="pd15">\
<div class="divtable">\
<pre class="layui-code">'+rdata.data+'</pre>\
</div>\
</div>',
success:function(){
copyText(rdata.data);
},
yes:function(){
copyText(rdata.data);
}
});
});
}
function setLocalImport(db_name){
//上传文件
@@ -993,6 +1018,7 @@ function setLocalImport(db_name){
<td><span> ' + file_list[i]['time'] + '</span></td>\
<td style="text-align: right;">\
<a class="btlink" onclick="importDbExternal(\'' + file_list[i]['name'] + '\',\'' +db_name+ '\')">导入</a> | \
<a class="btlink" onclick="importDbExternalProgress(\'' + file_list[i]['name'] + '\',\'' +db_name+ '\')">导入进度</a> | \
<a class="btlink del" index="'+i+'">删除</a>\
</td>\
</tr>';
@@ -1016,7 +1042,7 @@ function setLocalImport(db_name){
var layerIndex = layer.open({
type: 1,
title: "从文件导入数据",
area: ['600px', '380px'],
area: ['700px', '380px'],
closeBtn: 1,
shadeClose: false,
content: '<div class="pd15">\
@@ -1655,7 +1681,7 @@ function addMasterRepSlaveUser(){
function updateMasterRepSlaveUser(username){
function updateMasterRepSlaveUser(username, password){
var index = layer.open({
type: 1,
@@ -1668,7 +1694,7 @@ function updateMasterRepSlaveUser(username){
<div class='line'><span class='tname'>用户名</span><div class='info-r'><input name='username' readonly='readonly' class='bt-input-text mr5' placeholder='用户名' type='text' style='width:330px;' value='"+username+"'></div></div>\
<div class='line'>\
<span class='tname'>密码</span>\
<div class='info-r'><input class='bt-input-text mr5' type='text' name='password' id='MyPassword' style='width:330px' value='"+(randomStrPwd(16))+"' /><span title='随机密码' class='glyphicon glyphicon-repeat cursor' onclick='repeatPwd(16)'></span></div>\
<div class='info-r'><input class='bt-input-text mr5' type='text' name='password' id='MyPassword' style='width:330px' value='"+password+"' /><span title='随机密码' class='glyphicon glyphicon-repeat cursor' onclick='repeatPwd(16)'></span></div>\
</div>\
<input type='hidden' name='ps' value='' />\
<div class='bt-form-submit-btn'>\
@@ -1710,17 +1736,12 @@ function getMasterRepSlaveUserCmd(username, db=''){
area: '500px',
content:"<form class='bt-form pd20 pb70' id='add_master'>\
<div class='line' style='word-wrap: break-word;word-break: normal;'>"+cmd+"</div>\
<div class='bt-form-submit-btn'>\
<button type='button' class='btn btn-success btn-sm btn-title class-copy-cmd'>复制</button>\
<div class='bt-form-submit-btn' style='text-align:center;'>\
<button type='button' class='btn btn-success btn-sm btn-title'>选择其中一个复制</button>\
</div>\
</form>",
});
copyPass(cmd);
$('.class-copy-cmd').click(function(){
copyPass(cmd);
});
});
}
@@ -1844,10 +1865,11 @@ function getMasterRepSlaveList(){
for (i in user_list) {
// console.log(i);
var name = user_list[i]['username'];
var password = user_list[i]['password'];
list += '<tr><td>'+name+'</td>\
<td>'+user_list[i]['password']+'</td>\
<td>'+password+'</td>\
<td>\
<a class="btlink" onclick="updateMasterRepSlaveUser(\''+name+'\');">修改</a> | \
<a class="btlink" onclick="updateMasterRepSlaveUser(\''+name+'\',\''+password+'\');">修改</a> | \
<a class="btlink" onclick="delMasterRepSlaveUser(\''+name+'\');">删除</a> | \
<a class="btlink" onclick="setDbMasterAccess(\''+name+'\');">权限</a> | \
<a class="btlink" onclick="getMasterRepSlaveUserCmd(\''+name+'\');">从库同步命令</a>\
@@ -1935,6 +1957,7 @@ function getFullSyncStatus(db){
</div>\
<div class='table_toolbar' style='left:0px;'>\
<span data-status='init' class='sync btn btn-default btn-sm' id='begin_full_sync'>开始</span>\
<span data-status='init' class='btn btn-default btn-sm' id='full_sync_cmd'>手动命令</span>\
</div>\
</div>",
cancel: function(){
@@ -1957,6 +1980,31 @@ function getFullSyncStatus(db){
layer.msg("正在同步中..",{icon:0});
}
});
$('#full_sync_cmd').click(function(){
myPostN('full_sync_cmd', {'db':db,'sign':''}, function(rdata){
var rdata = $.parseJSON(rdata.data);
layer.open({
title: "手动执行命令CMD",
area: ['600px', '180px'],
type:1,
closeBtn: 1,
shadeClose: false,
btn:["复制","取消"],
content: '<div class="pd15">\
<div class="divtable">\
<pre class="layui-code">'+rdata.data+'</pre>\
</div>\
</div>',
success:function(){
copyText(rdata.data);
},
yes:function(){
copyText(rdata.data);
}
});
});
});
}
});
});
@@ -2210,7 +2258,7 @@ function addSlaveSyncUser(ip=''){
var index = layer.open({
type: 1,
area: ['500px','470px'],
area: ['500px','510px'],
title: '同步账户',
closeBtn: 1,
shift: 5,
@@ -2221,6 +2269,15 @@ function addSlaveSyncUser(ip=''){
<div class='line'><span class='tname'>端口</span><div class='info-r'><input name='port' class='bt-input-text mr5' type='number' style='width:330px;' value='"+port+"'></div></div>\
<div class='line'><span class='tname'>同步账户</span><div class='info-r'><input name='user' class='bt-input-text mr5' type='text' style='width:330px;' value='"+user+"'></div></div>\
<div class='line'><span class='tname'>同步密码</span><div class='info-r'><input name='pass' class='bt-input-text mr5' type='text' style='width:330px;' value='"+pass+"'></div></div>\
<div class='line'>\
<span class='tname'>同步模式</span>\
<div class='info-r'>\
<select class='bt-input-text mr5' name='mode'>\
<option value='0' "+( mode == '0' ? 'selected="selected"' : '')+">经典</option>\
<option value='1' "+( mode == '1' ? 'selected="selected"' : '')+">GTID</option>\
</select>\
</div>\
</div>\
<div class='line'>\
<span class='tname'>CMD[必填]</span>\
<div class='info-r'><textarea class='bt-input-text mr5' row='20' cols='30' name='cmd' style='width:330px;height:150px;'></textarea></div>\
+1 -9
View File
@@ -14,21 +14,13 @@ sysName=`uname`
install_tmp=${rootPath}/tmp/mw_install.pl
mariadbDir=${serverPath}/source/mariadb
MY_VER=10.11.7
MY_VER=10.11.8
Install_app()
{
mkdir -p ${mariadbDir}
echo '正在安装脚本文件...' > $install_tmp
if id mysql &> /dev/null ;then
echo "mysql uid is `id -u www`"
echo "mysql shell is `grep "^www:" /etc/passwd |cut -d':' -f7 `"
else
groupadd mysql
useradd -g mysql mysql
fi
if [ "$sysName" != "Darwin" ];then
mkdir -p /var/log/mariadb
touch /var/log/mariadb/mariadb.log
+1 -9
View File
@@ -13,21 +13,13 @@ sysName=`uname`
install_tmp=${rootPath}/tmp/mw_install.pl
mariadbDir=${serverPath}/source/mariadb
MY_VER=10.6.17
MY_VER=10.6.18
Install_app()
{
mkdir -p ${mariadbDir}
echo '正在安装脚本文件...' > $install_tmp
if id mysql &> /dev/null ;then
echo "mysql uid is `id -u www`"
echo "mysql shell is `grep "^www:" /etc/passwd |cut -d':' -f7 `"
else
groupadd mysql
useradd -g mysql mysql
fi
if [ "$sysName" != "Darwin" ];then
mkdir -p /var/log/mariadb
touch /var/log/mariadb/mariadb.log
-8
View File
@@ -21,14 +21,6 @@ Install_app()
mkdir -p ${mariadbDir}
echo '正在安装脚本文件...' > $install_tmp
if id mysql &> /dev/null ;then
echo "mysql uid is `id -u www`"
echo "mysql shell is `grep "^www:" /etc/passwd |cut -d':' -f7 `"
else
groupadd mysql
useradd -g mysql mysql
fi
if [ "$sysName" != "Darwin" ];then
mkdir -p /var/log/mariadb
touch /var/log/mariadb/mariadb.log
-8
View File
@@ -21,14 +21,6 @@ Install_app()
mkdir -p ${mariadbDir}
echo '正在安装脚本文件...' > $install_tmp
if id mysql &> /dev/null ;then
echo "mysql uid is `id -u www`"
echo "mysql shell is `grep "^www:" /etc/passwd |cut -d':' -f7 `"
else
groupadd mysql
useradd -g mysql mysql
fi
if [ "$sysName" != "Darwin" ];then
mkdir -p /var/log/mariadb
touch /var/log/mariadb/mariadb.log
-8
View File
@@ -21,14 +21,6 @@ Install_app()
mkdir -p ${mariadbDir}
echo '正在安装脚本文件...' > $install_tmp
if id mysql &> /dev/null ;then
echo "mysql uid is `id -u www`"
echo "mysql shell is `grep "^www:" /etc/passwd |cut -d':' -f7 `"
else
groupadd mysql
useradd -g mysql mysql
fi
if [ "$sysName" != "Darwin" ];then
mkdir -p /var/log/mariadb
touch /var/log/mariadb/mariadb.log
-8
View File
@@ -21,14 +21,6 @@ Install_app()
mkdir -p ${mariadbDir}
echo '正在安装脚本文件...' > $install_tmp
if id mysql &> /dev/null ;then
echo "mysql uid is `id -u www`"
echo "mysql shell is `grep "^www:" /etc/passwd |cut -d':' -f7 `"
else
groupadd mysql
useradd -g mysql mysql
fi
if [ "$sysName" != "Darwin" ];then
mkdir -p /var/log/mariadb
touch /var/log/mariadb/mariadb.log
-8
View File
@@ -21,14 +21,6 @@ Install_app()
mkdir -p ${mariadbDir}
echo '正在安装脚本文件...' > $install_tmp
if id mysql &> /dev/null ;then
echo "mysql uid is `id -u www`"
echo "mysql shell is `grep "^www:" /etc/passwd |cut -d':' -f7 `"
else
groupadd mysql
useradd -g mysql mysql
fi
if [ "$sysName" != "Darwin" ];then
mkdir -p /var/log/mariadb
touch /var/log/mariadb/mariadb.log
+1 -9
View File
@@ -14,21 +14,13 @@ sysName=`uname`
install_tmp=${rootPath}/tmp/mw_install.pl
mariadbDir=${serverPath}/source/mariadb
MY_VER=11.2.3
MY_VER=11.2.4
Install_app()
{
mkdir -p ${mariadbDir}
echo '正在安装脚本文件...' > $install_tmp
if id mysql &> /dev/null ;then
echo "mysql uid is `id -u www`"
echo "mysql shell is `grep "^www:" /etc/passwd |cut -d':' -f7 `"
else
groupadd mysql
useradd -g mysql mysql
fi
if [ "$sysName" != "Darwin" ];then
mkdir -p /var/log/mariadb
touch /var/log/mariadb/mariadb.log
-8
View File
@@ -21,14 +21,6 @@ Install_app()
mkdir -p ${mariadbDir}
echo '正在安装脚本文件...' > $install_tmp
if id mysql &> /dev/null ;then
echo "mysql uid is `id -u www`"
echo "mysql shell is `grep "^www:" /etc/passwd |cut -d':' -f7 `"
else
groupadd mysql
useradd -g mysql mysql
fi
if [ "$sysName" != "Darwin" ];then
mkdir -p /var/log/mariadb
touch /var/log/mariadb/mariadb.log
+121
View File
@@ -0,0 +1,121 @@
#!/bin/bash
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin:/opt/homebrew/bin
export PATH
#https://dev.mysql.com/downloads/mysql/5.5.html#downloads
#https://dev.mysql.com/downloads/file/?id=480541
curPath=`pwd`
rootPath=$(dirname "$curPath")
rootPath=$(dirname "$rootPath")
serverPath=$(dirname "$rootPath")
sysName=`uname`
install_tmp=${rootPath}/tmp/mw_install.pl
mariadbDir=${serverPath}/source/mariadb
MY_VER=11.4.2
Install_app()
{
mkdir -p ${mariadbDir}
echo '正在安装脚本文件...' > $install_tmp
if [ "$sysName" != "Darwin" ];then
mkdir -p /var/log/mariadb
touch /var/log/mariadb/mariadb.log
fi
# ----- cpu start ------
if [ -z "${cpuCore}" ]; then
cpuCore="1"
fi
if [ -f /proc/cpuinfo ];then
cpuCore=`cat /proc/cpuinfo | grep "processor" | wc -l`
fi
MEM_INFO=$(free -m|grep Mem|awk '{printf("%.f",($2)/1024)}')
if [ "${cpuCore}" != "1" ] && [ "${MEM_INFO}" != "0" ];then
if [ "${cpuCore}" -gt "${MEM_INFO}" ];then
cpuCore="${MEM_INFO}"
fi
else
cpuCore="1"
fi
if [ "$cpuCore" -gt "2" ];then
cpuCore=`echo "$cpuCore" | awk '{printf("%.f",($1)*0.8)}'`
else
cpuCore="1"
fi
# ----- cpu end ------
# if [ ! -f ${mariadbDir}/mariadb-${MY_VER}.tar.gz ];then
# wget --no-check-certificate -O ${mariadbDir}/mariadb-${MY_VER}.tar.gz --tries=3 https://mirrors.aliyun.com/mariadb/mariadb-${MY_VER}/source/mariadb-${MY_VER}.tar.gz
# fi
# https://downloads.mariadb.org/interstitial/mariadb-10.9.1/source/mariadb-10.9.1.tar.gz
if [ ! -f ${mariadbDir}/mariadb-${MY_VER}.tar.gz ];then
wget --no-check-certificate -O ${mariadbDir}/mariadb-${MY_VER}.tar.gz --tries=3 https://archive.mariadb.org/mariadb-${MY_VER}/source/mariadb-${MY_VER}.tar.gz
fi
if [ ! -d ${mariadbDir}/mariadb-${MY_VER} ];then
cd ${mariadbDir} && tar -zxvf ${mariadbDir}/mariadb-${MY_VER}.tar.gz
fi
INSTALL_CMD=cmake
# check cmake version
CMAKE_VERSION=`cmake -version | grep version | awk '{print $3}' | awk -F '.' '{print $1}'`
if [ "$CMAKE_VERSION" -eq "2" ];then
mkdir -p /var/log/mariadb
touch /var/log/mariadb/mariadb.log
INSTALL_CMD=cmake3
fi
if [ ! -d $serverPath/mariadb ];then
cd ${mariadbDir}/mariadb-${MY_VER} && ${INSTALL_CMD} \
-DCMAKE_INSTALL_PREFIX=$serverPath/mariadb \
-DMYSQL_DATADIR=$serverPath/mariadb/data/ \
-DMYSQL_USER=mysql \
-DMYSQL_UNIX_ADDR=$serverPath/mariadb/mysql.sock \
-DWITH_MYISAM_STORAGE_ENGINE=1 \
-DWITH_INNOBASE_STORAGE_ENGINE=1 \
-DWITH_MEMORY_STORAGE_ENGINE=1 \
-DENABLED_LOCAL_INFILE=1 \
-DWITH_PARTITION_STORAGE_ENGINE=1 \
-DEXTRA_CHARSETS=all \
-DDEFAULT_CHARSET=utf8mb4 \
-DDEFAULT_COLLATION=utf8mb4_general_ci \
-DCMAKE_C_COMPILER=/usr/bin/gcc \
-DCMAKE_CXX_COMPILER=/usr/bin/g++
make -j${cpuCore} && make install && make clean
if [ -d $serverPath/mariadb ];then
echo '11.4' > $serverPath/mariadb/version.pl
echo '安装完成'
else
echo '安装失败'
echo 'install fail'>&2
exit 1
fi
fi
if [ -d ${mariadbDir}/mariadb-${MY_VER} ];then
rm -rf ${mariadbDir}/mariadb-${MY_VER}
fi
}
Uninstall_app()
{
rm -rf $serverPath/mariadb
echo '卸载完成' > $install_tmp
}
action=$1
if [ "${1}" == 'install' ];then
Install_app
else
Uninstall_app
fi
+1 -1
View File
@@ -59,7 +59,7 @@ def getConfTpl():
def getMemPort():
path = getServerDir() + '/memcached.env'
content = mw.readFile(path)
rep = 'PORT\s*=\s*(\d*)'
rep = r'PORT\s*=\s*(\d*)'
tmp = re.search(rep, content)
return tmp.groups()[0]
+1 -1
View File
@@ -9,7 +9,7 @@ serverPath=$(dirname "$rootPath")
install_tmp=${rootPath}/tmp/mw_install.pl
sys_os=`uname`
VERSION=1.6.22
VERSION=1.6.29
echo $sys_os
+1 -6
View File
@@ -17,7 +17,6 @@ socket = {$SERVER_APP_PATH}/mysql.sock
datadir = {$SERVER_APP_PATH}/data
log-error = {$SERVER_APP_PATH}/data/error.log
server-id = {$SERVER_ID}
sql-mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES
default_storage_engine = InnoDB
@@ -45,7 +44,6 @@ max_allowed_packet = 128M
#skip-name-resolve
log-bin=mysql-bin
binlog_format=mixed
slow_query_log=1
slow-query-log-file={$SERVER_APP_PATH}/data/mysql-slow.log
long_query_time=3
@@ -66,15 +64,12 @@ binlog-ignore-db = performance_schema
#slave
log_replica_updates
#replicate-do-db
slave_skip_errors=1062,1396
replica_skip_errors=1062,1396
replicate-ignore-db = information_schema
replicate-ignore-db = performance_schema
replicate-ignore-db = mysql
replicate-ignore-db = test
master_info_repository = table
relay_log_info_repository = table
default_storage_engine = InnoDB
innodb_data_home_dir = {$SERVER_APP_PATH}/data
innodb_data_file_path = ibdata1:10M:autoextend
+2 -7
View File
@@ -8,7 +8,7 @@ default-character-set = UTF8MB4
[mysqld]
!include {$SERVER_APP_PATH}/etc/mode/classic.cnf
authentication_policy=mysql_native_password
authentication_policy=caching_sha2_password
pid-file = {$SERVER_APP_PATH}/data/mysql.pid
user = mysql
port = 33206
@@ -17,7 +17,6 @@ socket = {$SERVER_APP_PATH}/mysql.sock
datadir = {$SERVER_APP_PATH}/data
log-error = {$SERVER_APP_PATH}/data/error.log
server-id = {$SERVER_ID}
sql-mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES
default_storage_engine = InnoDB
@@ -45,7 +44,6 @@ max_allowed_packet = 128M
#skip-name-resolve
log-bin=mysql-bin
binlog_format=mixed
slow_query_log=1
slow-query-log-file={$SERVER_APP_PATH}/data/mysql-slow.log
long_query_time=3
@@ -66,15 +64,12 @@ binlog-ignore-db = performance_schema
#slave
log_replica_updates
#replicate-do-db
slave_skip_errors=1062,1396
replica_skip_errors=1062,1396
replicate-ignore-db = information_schema
replicate-ignore-db = performance_schema
replicate-ignore-db = mysql
replicate-ignore-db = test
master_info_repository = table
relay_log_info_repository = table
default_storage_engine = InnoDB
innodb_data_home_dir = {$SERVER_APP_PATH}/data
innodb_data_file_path = ibdata1:10M:autoextend
+103
View File
@@ -0,0 +1,103 @@
[client]
user = root
#password = your_password
port = 33206
socket = {$SERVER_APP_PATH}/mysql.sock
default-character-set = UTF8MB4
[mysqld]
!include {$SERVER_APP_PATH}/etc/mode/classic.cnf
authentication_policy=caching_sha2_password
pid-file = {$SERVER_APP_PATH}/data/mysql.pid
user = mysql
port = 33206
mysqlx_port = 33260
socket = {$SERVER_APP_PATH}/mysql.sock
datadir = {$SERVER_APP_PATH}/data
log-error = {$SERVER_APP_PATH}/data/error.log
server-id = {$SERVER_ID}
default_storage_engine = InnoDB
key_buffer_size = 8M
table_open_cache = 32
sort_buffer_size = 256K
net_buffer_length = 4K
read_buffer_size = 128K
read_rnd_buffer_size = 256K
myisam_sort_buffer_size = 4M
thread_cache_size = 4
lower_case_table_names=1
tmp_table_size = 8M
character-set-server = UTF8MB4
max_connections = 500
max_connect_errors = 100
open_files_limit = 2560
max_allowed_packet = 128M
#skip-external-locking
#skip-grant-tables
#loose-skip-innodb
#skip-networking
#skip-name-resolve
log-bin=mysql-bin
slow_query_log=1
slow-query-log-file={$SERVER_APP_PATH}/data/mysql-slow.log
long_query_time=3
#log_queries_not_using_indexes=on
relay-log=mdserver
relay-log-index=mdserver
#master
#sync_binlog=1
#binlog-do-db
binlog-ignore-db = test
binlog-ignore-db = mysql
binlog-ignore-db = information_schema
binlog-ignore-db = performance_schema
#slave
log_replica_updates
#replicate-do-db
replica_skip_errors=1062,1396
replicate-ignore-db = information_schema
replicate-ignore-db = performance_schema
replicate-ignore-db = mysql
replicate-ignore-db = test
default_storage_engine = InnoDB
innodb_data_home_dir = {$SERVER_APP_PATH}/data
innodb_data_file_path = ibdata1:10M:autoextend
innodb_log_group_home_dir = {$SERVER_APP_PATH}/data
innodb_buffer_pool_size = 16M
innodb_redo_log_capacity=10485760
innodb_log_buffer_size = 8M
innodb_flush_log_at_trx_commit = 1
innodb_lock_wait_timeout = 120
innodb_max_dirty_pages_pct = 90
innodb_read_io_threads = 1
innodb_write_io_threads = 1
innodb_file_per_table=1
binlog_expire_logs_seconds=2592000
secure-file-priv={$SERVER_APP_PATH}/tmp
[mysqldump]
quick
[mysql]
no-auto-rehash
[myisamchk]
key_buffer_size = 20M
sort_buffer_size = 20M
read_buffer = 2M
write_buffer = 2M
[mysqlhotcopy]
interactive-timeout
+103
View File
@@ -0,0 +1,103 @@
[client]
user = root
#password = your_password
port = 33206
socket = {$SERVER_APP_PATH}/mysql.sock
default-character-set = UTF8MB4
[mysqld]
!include {$SERVER_APP_PATH}/etc/mode/classic.cnf
authentication_policy=caching_sha2_password
pid-file = {$SERVER_APP_PATH}/data/mysql.pid
user = mysql
port = 33206
mysqlx_port = 33260
socket = {$SERVER_APP_PATH}/mysql.sock
datadir = {$SERVER_APP_PATH}/data
log-error = {$SERVER_APP_PATH}/data/error.log
server-id = {$SERVER_ID}
default_storage_engine = InnoDB
key_buffer_size = 8M
table_open_cache = 32
sort_buffer_size = 256K
net_buffer_length = 4K
read_buffer_size = 128K
read_rnd_buffer_size = 256K
myisam_sort_buffer_size = 4M
thread_cache_size = 4
lower_case_table_names=1
tmp_table_size = 8M
character-set-server = UTF8MB4
max_connections = 500
max_connect_errors = 100
open_files_limit = 2560
max_allowed_packet = 128M
#skip-external-locking
#skip-grant-tables
#loose-skip-innodb
#skip-networking
#skip-name-resolve
log-bin=mysql-bin
slow_query_log=1
slow-query-log-file={$SERVER_APP_PATH}/data/mysql-slow.log
long_query_time=3
#log_queries_not_using_indexes=on
relay-log=mdserver
relay-log-index=mdserver
#master
#sync_binlog=1
#binlog-do-db
binlog-ignore-db = test
binlog-ignore-db = mysql
binlog-ignore-db = information_schema
binlog-ignore-db = performance_schema
#slave
log_replica_updates
#replicate-do-db
replica_skip_errors=1062,1396
replicate-ignore-db = information_schema
replicate-ignore-db = performance_schema
replicate-ignore-db = mysql
replicate-ignore-db = test
default_storage_engine = InnoDB
innodb_data_home_dir = {$SERVER_APP_PATH}/data
innodb_data_file_path = ibdata1:10M:autoextend
innodb_log_group_home_dir = {$SERVER_APP_PATH}/data
innodb_buffer_pool_size = 16M
innodb_redo_log_capacity=10485760
innodb_log_buffer_size = 8M
innodb_flush_log_at_trx_commit = 1
innodb_lock_wait_timeout = 120
innodb_max_dirty_pages_pct = 90
innodb_read_io_threads = 1
innodb_write_io_threads = 1
innodb_file_per_table=1
binlog_expire_logs_seconds=2592000
secure-file-priv={$SERVER_APP_PATH}/tmp
[mysqldump]
quick
[mysql]
no-auto-rehash
[myisamchk]
key_buffer_size = 20M
sort_buffer_size = 20M
read_buffer = 2M
write_buffer = 2M
[mysqlhotcopy]
interactive-timeout
+103
View File
@@ -0,0 +1,103 @@
[client]
user = root
#password = your_password
port = 33206
socket = {$SERVER_APP_PATH}/mysql.sock
default-character-set = UTF8MB4
[mysqld]
!include {$SERVER_APP_PATH}/etc/mode/classic.cnf
authentication_policy=caching_sha2_password
pid-file = {$SERVER_APP_PATH}/data/mysql.pid
user = mysql
port = 33206
mysqlx_port = 33260
socket = {$SERVER_APP_PATH}/mysql.sock
datadir = {$SERVER_APP_PATH}/data
log-error = {$SERVER_APP_PATH}/data/error.log
server-id = {$SERVER_ID}
default_storage_engine = InnoDB
key_buffer_size = 8M
table_open_cache = 32
sort_buffer_size = 256K
net_buffer_length = 4K
read_buffer_size = 128K
read_rnd_buffer_size = 256K
myisam_sort_buffer_size = 4M
thread_cache_size = 4
lower_case_table_names=1
tmp_table_size = 8M
character-set-server = UTF8MB4
max_connections = 500
max_connect_errors = 100
open_files_limit = 2560
max_allowed_packet = 128M
#skip-external-locking
#skip-grant-tables
#loose-skip-innodb
#skip-networking
#skip-name-resolve
log-bin=mysql-bin
slow_query_log=1
slow-query-log-file={$SERVER_APP_PATH}/data/mysql-slow.log
long_query_time=3
#log_queries_not_using_indexes=on
relay-log=mdserver
relay-log-index=mdserver
#master
#sync_binlog=1
#binlog-do-db
binlog-ignore-db = test
binlog-ignore-db = mysql
binlog-ignore-db = information_schema
binlog-ignore-db = performance_schema
#slave
log_replica_updates
#replicate-do-db
replica_skip_errors=1062,1396
replicate-ignore-db = information_schema
replicate-ignore-db = performance_schema
replicate-ignore-db = mysql
replicate-ignore-db = test
default_storage_engine = InnoDB
innodb_data_home_dir = {$SERVER_APP_PATH}/data
innodb_data_file_path = ibdata1:10M:autoextend
innodb_log_group_home_dir = {$SERVER_APP_PATH}/data
innodb_buffer_pool_size = 16M
innodb_redo_log_capacity=10485760
innodb_log_buffer_size = 8M
innodb_flush_log_at_trx_commit = 1
innodb_lock_wait_timeout = 120
innodb_max_dirty_pages_pct = 90
innodb_read_io_threads = 1
innodb_write_io_threads = 1
innodb_file_per_table=1
binlog_expire_logs_seconds=2592000
secure-file-priv={$SERVER_APP_PATH}/tmp
[mysqldump]
quick
[mysql]
no-auto-rehash
[myisamchk]
key_buffer_size = 20M
sort_buffer_size = 20M
read_buffer = 2M
write_buffer = 2M
[mysqlhotcopy]
interactive-timeout
+2
View File
@@ -50,7 +50,9 @@ CREATE TABLE IF NOT EXISTS `slave_sync_user` (
`pass` TEXT,
`mode` TEXT,
`cmd` TEXT,
`db` TEXT,
`addtime` TEXT
);
ALTER TABLE `slave_sync_user` ADD COLUMN `db` TEXT DEFAULT '';
+1 -1
View File
@@ -2,7 +2,7 @@
<div class='plugin_version'></div>
<div class="bt-w-main">
<div class="bt-w-menu">
<script type="text/javascript">console.log($('.plugin_version').attr('version'));</script>
<!-- <script type="text/javascript">console.log($('.plugin_version').attr('version'));</script> -->
<p class="bgw" onclick="pluginService('mysql-apt', $('.plugin_version').attr('version'));">服务</p>
<p onclick="pluginInitD('mysql-apt', $('.plugin_version').attr('version'));">自启动</p>
<p onclick="pluginConfig('mysql-apt', $('.plugin_version').attr('version'));">配置文件</p>
File diff suppressed because it is too large Load Diff
+2 -1
View File
@@ -6,9 +6,10 @@
"type":"运行环境",
"ps":"一种关系数据库管理系统[debian,ubuntu](极速安装)",
"todo_versions":["5.7","8.0"],
"versions":["5.7","8.0","8.2"],
"versions":["5.7","8.0","8.2","8.3","8.4","9.0"],
"shell":"install.sh",
"install_pre_inspection":true,
"uninstall_pre_inspection":true,
"checks":"server/mysql-apt",
"path":"server/mysql-apt",
"author":"mysql",
@@ -0,0 +1,50 @@
# Copyright (c) 2015, 2022, Oracle and/or its affiliates.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License, version 2.0,
# as published by the Free Software Foundation.
#
# This program is also distributed with certain software (including
# but not limited to OpenSSL) that is licensed under separate terms,
# as designated in a particular file or component or in included license
# documentation. The authors of MySQL hereby grant you an additional
# permission to link the program and your derivative works with the
# separately licensed software that they have included with MySQL.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License, version 2.0, for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
# MySQL systemd service file
[Unit]
Description=MySQL Community Server
Documentation=man:mysqld(8)
Documentation=http://dev.mysql.com/doc/refman/en/using-systemd.html
After=network.target
[Install]
WantedBy=multi-user.target
[Service]
User=mysql
Group=mysql
Type=notify
#ExecStartPre=+/usr/share/mysql-8.0/mysql-systemd-start pre
ExecStart={$SERVER_PATH}/mysql-apt/bin/usr/sbin/mysqld --defaults-file={$SERVER_PATH}/mysql-apt/etc/my.cnf
TimeoutSec=0
LimitNOFILE = 10000
Restart=on-failure
RestartPreventExitStatus=1
# Always restart when mysqld exits with exit code of 16. This special exit code
# is used by mysqld for RESTART SQL.
RestartForceExitStatus=16
# Set enviroment variable MYSQLD_PARENT_PID. This is required for restart.
Environment=MYSQLD_PARENT_PID=1
@@ -0,0 +1,50 @@
# Copyright (c) 2015, 2022, Oracle and/or its affiliates.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License, version 2.0,
# as published by the Free Software Foundation.
#
# This program is also distributed with certain software (including
# but not limited to OpenSSL) that is licensed under separate terms,
# as designated in a particular file or component or in included license
# documentation. The authors of MySQL hereby grant you an additional
# permission to link the program and your derivative works with the
# separately licensed software that they have included with MySQL.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License, version 2.0, for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
# MySQL systemd service file
[Unit]
Description=MySQL Community Server
Documentation=man:mysqld(8)
Documentation=http://dev.mysql.com/doc/refman/en/using-systemd.html
After=network.target
[Install]
WantedBy=multi-user.target
[Service]
User=mysql
Group=mysql
Type=notify
#ExecStartPre=+/usr/share/mysql-8.0/mysql-systemd-start pre
ExecStart={$SERVER_PATH}/mysql-apt/bin/usr/sbin/mysqld --defaults-file={$SERVER_PATH}/mysql-apt/etc/my.cnf
TimeoutSec=0
LimitNOFILE = 10000
Restart=on-failure
RestartPreventExitStatus=1
# Always restart when mysqld exits with exit code of 16. This special exit code
# is used by mysqld for RESTART SQL.
RestartForceExitStatus=16
# Set enviroment variable MYSQLD_PARENT_PID. This is required for restart.
Environment=MYSQLD_PARENT_PID=1
@@ -0,0 +1,50 @@
# Copyright (c) 2015, 2022, Oracle and/or its affiliates.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License, version 2.0,
# as published by the Free Software Foundation.
#
# This program is also distributed with certain software (including
# but not limited to OpenSSL) that is licensed under separate terms,
# as designated in a particular file or component or in included license
# documentation. The authors of MySQL hereby grant you an additional
# permission to link the program and your derivative works with the
# separately licensed software that they have included with MySQL.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License, version 2.0, for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
# MySQL systemd service file
[Unit]
Description=MySQL Community Server
Documentation=man:mysqld(8)
Documentation=http://dev.mysql.com/doc/refman/en/using-systemd.html
After=network.target
[Install]
WantedBy=multi-user.target
[Service]
User=mysql
Group=mysql
Type=notify
#ExecStartPre=+/usr/share/mysql-8.0/mysql-systemd-start pre
ExecStart={$SERVER_PATH}/mysql-apt/bin/usr/sbin/mysqld --defaults-file={$SERVER_PATH}/mysql-apt/etc/my.cnf
TimeoutSec=0
LimitNOFILE = 10000
Restart=on-failure
RestartPreventExitStatus=1
# Always restart when mysqld exits with exit code of 16. This special exit code
# is used by mysqld for RESTART SQL.
RestartForceExitStatus=16
# Set enviroment variable MYSQLD_PARENT_PID. This is required for restart.
Environment=MYSQLD_PARENT_PID=1
@@ -0,0 +1,49 @@
# Copyright (c) 2015, 2022, Oracle and/or its affiliates.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License, version 2.0,
# as published by the Free Software Foundation.
#
# This program is also distributed with certain software (including
# but not limited to OpenSSL) that is licensed under separate terms,
# as designated in a particular file or component or in included license
# documentation. The authors of MySQL hereby grant you an additional
# permission to link the program and your derivative works with the
# separately licensed software that they have included with MySQL.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License, version 2.0, for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
# MySQL systemd service file
[Unit]
Description=MySQL Community Server
Documentation=man:mysqld(8)
Documentation=http://dev.mysql.com/doc/refman/en/using-systemd.html
After=network.target
[Install]
WantedBy=multi-user.target
[Service]
User=mysql
Group=mysql
Type=notify
ExecStart={$SERVER_PATH}/mysql-apt/bin/usr/sbin/mysqld --defaults-file={$SERVER_PATH}/mysql-apt/etc/my.cnf
TimeoutSec=0
LimitNOFILE = 10000
Restart=on-failure
RestartPreventExitStatus=1
# Always restart when mysqld exits with exit code of 16. This special exit code
# is used by mysqld for RESTART SQL.
RestartForceExitStatus=16
# Set enviroment variable MYSQLD_PARENT_PID. This is required for restart.
Environment=MYSQLD_PARENT_PID=1
@@ -0,0 +1,49 @@
# Copyright (c) 2015, 2022, Oracle and/or its affiliates.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License, version 2.0,
# as published by the Free Software Foundation.
#
# This program is also distributed with certain software (including
# but not limited to OpenSSL) that is licensed under separate terms,
# as designated in a particular file or component or in included license
# documentation. The authors of MySQL hereby grant you an additional
# permission to link the program and your derivative works with the
# separately licensed software that they have included with MySQL.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License, version 2.0, for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
# MySQL systemd service file
[Unit]
Description=MySQL Community Server
Documentation=man:mysqld(8)
Documentation=http://dev.mysql.com/doc/refman/en/using-systemd.html
After=network.target
[Install]
WantedBy=multi-user.target
[Service]
User=mysql
Group=mysql
Type=notify
ExecStart={$SERVER_PATH}/mysql-apt/bin/usr/sbin/mysqld --defaults-file={$SERVER_PATH}/mysql-apt/etc/my.cnf
TimeoutSec=0
LimitNOFILE = 10000
Restart=on-failure
RestartPreventExitStatus=1
# Always restart when mysqld exits with exit code of 16. This special exit code
# is used by mysqld for RESTART SQL.
RestartForceExitStatus=16
# Set enviroment variable MYSQLD_PARENT_PID. This is required for restart.
Environment=MYSQLD_PARENT_PID=1
+12 -3
View File
@@ -11,8 +11,9 @@ serverPath=$(dirname "$rootPath")
# cd /www/server/mdserver-web/plugins/mysql-apt && bash install.sh install 8.0
# cd /www/server/mdserver-web/plugins/mysql-apt && bash install.sh uninstall 8.0
# cd /www/server/mdserver-web && python3 /www/server/mdserver-web/plugins/mysql-apt/index.py start 8.0
# cd /www/server/mdserver-web && python3 /www/server/mdserver-web/plugins/mysql-apt/index.py start 5.7
# cd /www/server/mdserver-web && python3 /www/server/mdserver-web/plugins/mysql-apt/index.py fix_db_access
# cd /www/server/mdserver-web && source bin/activate && python3 plugins/mysql/index.py do_full_sync {"db":"xxx","sign":"","begin":1}
install_tmp=${rootPath}/tmp/mw_install.pl
@@ -20,14 +21,22 @@ install_tmp=${rootPath}/tmp/mw_install.pl
action=$1
type=$2
if id mysql &> /dev/null ;then
echo "mysql UID is `id -u mysql`"
echo "mysql Shell is `grep "^mysql:" /etc/passwd |cut -d':' -f7 `"
else
groupadd mysql
useradd -g mysql -s /usr/sbin/nologin mysql
fi
if [ "${2}" == "" ];then
echo '缺少安装脚本...' > $install_tmp
echo '缺少安装脚本...'
exit 0
fi
if [ ! -d $curPath/versions/$2 ];then
echo '缺少安装脚本2...' > $install_tmp
echo '缺少安装脚本2...'
exit 0
fi
+236 -46
View File
@@ -59,11 +59,12 @@ function myAsyncPost(method,args){
return syncPost('/plugins/run', {name:'mysql-apt', func:method, args:_args});
}
function myPostCallbak(method, version, args,callback){
var loadT = layer.msg('正在获取...', { icon: 16, time: 0, shade: 0.3 });
var req_data = {};
req_data['name'] = 'mysql';
req_data['name'] = 'mysql-apt';
req_data['func'] = method;
req_data['script']='index_mysql_apt';
args['version'] = version;
@@ -91,7 +92,7 @@ function myPostCallbak(method, version, args,callback){
function myPostCallbakN(method, version, args,callback){
var req_data = {};
req_data['name'] = 'mysql';
req_data['name'] = 'mysql-apt';
req_data['func'] = method;
req_data['script']='index_mysql_apt';
args['version'] = version;
@@ -160,7 +161,7 @@ function runInfo(){
<tr><th>活动/峰值连接数</th><td>' + rdata.Threads_running + '/' + rdata.Max_used_connections + '</td><td colspan="2">若值过大,增加max_connections</td></tr>\
<tr><th>线程缓存命中率</th><td>' + ((1 - rdata.Threads_created / rdata.Connections) * 100).toFixed(2) + '%</td><td colspan="2">若过低,增加thread_cache_size</td></tr>\
<tr><th>索引命中率</th><td>' + ((1 - rdata.Key_reads / rdata.Key_read_requests) * 100).toFixed(2) + '%</td><td colspan="2">若过低,增加key_buffer_size</td></tr>\
<tr><th>Innodb索引命中率</th><td>' + ((1 - rdata.Innodb_buffer_pool_reads / rdata.Innodb_buffer_pool_read_requests) * 100).toFixed(2) + '%</td><td colspan="2">若过低,增加innodb_buffer_pool_size</td></tr>\
<tr><th>Innodb索引命中率</th><td>' + (rdata.Innodb_buffer_pool_read_requests / (rdata.Innodb_buffer_pool_read_requests+rdata.Innodb_buffer_pool_reads)).toFixed(2) + '%</td><td colspan="2">若过低,增加innodb_buffer_pool_size</td></tr>\
<tr><th>查询缓存命中率</th><td>' + cache_size + '</td><td colspan="2">' + lan.soft.mysql_status_ps5 + '</td></tr>\
<tr><th>创建临时表到磁盘</th><td>' + ((rdata.Created_tmp_disk_tables / rdata.Created_tmp_tables) * 100).toFixed(2) + '%</td><td colspan="2">若过大,尝试增加tmp_table_size</td></tr>\
<tr><th>已打开的表</th><td>' + rdata.Open_tables + '</td><td colspan="2">若过大,增加table_cache_size</td></tr>\
@@ -199,7 +200,7 @@ function myPort(){
myPost('my_port','',function(data){
var con = '<div class="line ">\
<div class="info-r ml0">\
<input name="port" class="bt-input-text mr5 port" type="text" style="width:100px" value="'+data.data+'">\
<input name="port" class="bt-input-text mr5 port" type="number" style="width:100px" value="'+data.data+'">\
<button id="btn_change_port" name="btn_change_port" class="btn btn-success btn-sm mr5 ml5 btn_change_port">修改</button>\
</div></div>';
$(".soft-man-con").html(con);
@@ -700,7 +701,7 @@ function setDbPass(id, username, password){
<span title='随机密码' class='glyphicon glyphicon-repeat cursor' onclick='repeatPwd(16)'></span></div>\
</div>\
<input type='hidden' name='id' value='"+id+"'>\
</form>",
</form>",
yes:function(index){
// var data = $("#mod_pwd").serialize();
var data = {};
@@ -794,7 +795,7 @@ function addDatabase(type){
function delDb(id, name){
safeMessage('删除['+name+']','您真的要删除['+name+']吗?',function(){
var data='id='+id+'&name='+name
var data='id='+id+'&name='+name;
myPost('del_db', data, function(data){
var rdata = $.parseJSON(data.data);
showMsg(rdata.msg,function(){
@@ -870,7 +871,7 @@ function openPhpmyadmin(name,username,password){
}
if (rdata.data['cfg']['choose'] != 'mysql-apt'){
layer.msg('当前为['+rdata.choose+']模式,若要使用请修改phpMyAdmin访问切换.',{icon:2,shade: [0.3, '#000']});
layer.msg('当前为['+rdata.data['cfg']['choose'] + ']模式,若要使用请修改phpMyAdmin访问切换.',{icon:2,shade: [0.3, '#000']});
return;
}
var home_page = rdata.data['home_page'];
@@ -928,6 +929,31 @@ function importBackup(file,name){
});
}
function importBackupProgress(file,name){
myPost('import_db_backup_progress',{file:file,name:name}, function(data){
var rdata = $.parseJSON(data.data);
layer.open({
title: "手动导入命令CMD【显示进度】",
area: ['600px', '180px'],
type:1,
closeBtn: 1,
shadeClose: false,
btn:["复制","取消"],
content: '<div class="pd15">\
<div class="divtable">\
<pre class="layui-code">'+rdata.data+'</pre>\
</div>\
</div>',
success:function(){
copyText(rdata.data);
},
yes:function(){
copyText(rdata.data);
}
});
});
}
function importDbExternal(file,name){
myPost('import_db_external',{file:file,name:name}, function(data){
@@ -935,6 +961,31 @@ function importDbExternal(file,name){
});
}
function importDbExternalProgress(file,name){
myPost('import_db_external_progress',{file:file,name:name}, function(data){
var rdata = $.parseJSON(data.data);
layer.open({
title: "手动导入命令CMD【显示进度】",
area: ['600px', '180px'],
type:1,
closeBtn: 1,
shadeClose: false,
btn:["复制","取消"],
content: '<div class="pd15">\
<div class="divtable">\
<pre class="layui-code">'+rdata.data+'</pre>\
</div>\
</div>',
success:function(){
copyText(rdata.data);
},
yes:function(){
copyText(rdata.data);
}
});
});
}
function setLocalImport(db_name){
//上传文件
@@ -990,6 +1041,7 @@ function setLocalImport(db_name){
<td><span> ' + file_list[i]['time'] + '</span></td>\
<td style="text-align: right;">\
<a class="btlink" onclick="importDbExternal(\'' + file_list[i]['name'] + '\',\'' +db_name+ '\')">导入</a> | \
<a class="btlink" onclick="importDbExternalProgress(\'' + file_list[i]['name'] + '\',\'' +db_name+ '\')">导入进度</a> | \
<a class="btlink del" index="'+i+'">删除</a>\
</td>\
</tr>';
@@ -1013,7 +1065,7 @@ function setLocalImport(db_name){
var layerIndex = layer.open({
type: 1,
title: "从文件导入数据",
area: ['600px', '380px'],
area: ['700px', '380px'],
closeBtn: 1,
shadeClose: false,
content: '<div class="pd15">\
@@ -1059,7 +1111,7 @@ function setBackup(db_name){
var layerIndex = layer.open({
type: 1,
title: "数据库备份详情",
area: ['600px', '280px'],
area: ['700px', '280px'],
closeBtn: 1,
shadeClose: false,
content: '<div class="pd15">\
@@ -1113,6 +1165,7 @@ function setBackupReq(db_name, obj){
<td><span> ' + rdata.data[i]['time'] + '</span></td>\
<td style="text-align: right;">\
<a class="btlink" onclick="importBackup(\'' + rdata.data[i]['name'] + '\',\'' +db_name+ '\')">导入</a> | \
<a class="btlink" onclick="importBackupProgress(\'' + rdata.data[i]['name'] + '\',\'' +db_name+ '\')">导入进度</a> | \
<a class="btlink" onclick="downloadBackup(\'' + rdata.data[i]['file'] + '\')">下载</a> | \
<a class="btlink" onclick="delBackup(\'' + rdata.data[i]['name'] + '\',\'' +db_name+ '\')">删除</a>\
</td>\
@@ -1230,6 +1283,7 @@ function dbList(page, search){
});
}
function myBinRollingLogs(_name, func, _args, line){
var file_line = 100;
@@ -1653,7 +1707,7 @@ function addMasterRepSlaveUser(){
function updateMasterRepSlaveUser(username){
function updateMasterRepSlaveUser(username, password){
var index = layer.open({
type: 1,
@@ -1666,7 +1720,7 @@ function updateMasterRepSlaveUser(username){
<div class='line'><span class='tname'>用户名</span><div class='info-r'><input name='username' readonly='readonly' class='bt-input-text mr5' placeholder='用户名' type='text' style='width:330px;' value='"+username+"'></div></div>\
<div class='line'>\
<span class='tname'>密码</span>\
<div class='info-r'><input class='bt-input-text mr5' type='text' name='password' id='MyPassword' style='width:330px' value='"+(randomStrPwd(16))+"' /><span title='随机密码' class='glyphicon glyphicon-repeat cursor' onclick='repeatPwd(16)'></span></div>\
<div class='info-r'><input class='bt-input-text mr5' type='text' name='password' id='MyPassword' style='width:330px' value='"+password+"' /><span title='随机密码' class='glyphicon glyphicon-repeat cursor' onclick='repeatPwd(16)'></span></div>\
</div>\
<input type='hidden' name='ps' value='' />\
<div class='bt-form-submit-btn'>\
@@ -1708,17 +1762,11 @@ function getMasterRepSlaveUserCmd(username, db=''){
area: '500px',
content:"<form class='bt-form pd20 pb70' id='add_master'>\
<div class='line'>"+cmd+"</div>\
<div class='bt-form-submit-btn'>\
<button type='button' class='btn btn-success btn-sm btn-title class-copy-cmd'>复制</button>\
<div class='bt-form-submit-btn' style='text-align:center;'>\
<button type='button' class='btn btn-success btn-sm btn-title'>选择其中一个复制</button>\
</div>\
</form>",
});
copyPass(cmd);
$('.class-copy-cmd').click(function(){
copyPass(cmd);
});
});
}
@@ -1809,6 +1857,7 @@ function setDbMasterAccess(username){
});
}
function resetMaster(){
myPost('reset_master', '', function(data){
var rdata = $.parseJSON(data.data);
@@ -1839,10 +1888,11 @@ function getMasterRepSlaveList(){
for (i in user_list) {
// console.log(i);
var name = user_list[i]['username'];
var password = user_list[i]['password'];
list += '<tr><td>'+name+'</td>\
<td>'+user_list[i]['password']+'</td>\
<td>'+password+'</td>\
<td>\
<a class="btlink" onclick="updateMasterRepSlaveUser(\''+name+'\');">修改</a> | \
<a class="btlink" onclick="updateMasterRepSlaveUser(\''+name+'\',\''+password+'\');">修改</a> | \
<a class="btlink" onclick="delMasterRepSlaveUser(\''+name+'\');">删除</a> | \
<a class="btlink" onclick="setDbMasterAccess(\''+name+'\');">权限</a> | \
<a class="btlink" onclick="getMasterRepSlaveUserCmd(\''+name+'\');">从库同步命令</a>\
@@ -1930,6 +1980,7 @@ function getFullSyncStatus(db){
</div>\
<div class='table_toolbar' style='left:0px;'>\
<span data-status='init' class='sync btn btn-default btn-sm' id='begin_full_sync'>开始</span>\
<span data-status='init' class='btn btn-default btn-sm' id='full_sync_cmd'>手动命令</span>\
</div>\
</div>",
cancel: function(){
@@ -1948,10 +1999,36 @@ function getFullSyncStatus(db){
fullSync(db,sign,0);
}, 1000);
$(this).data('status','starting');
$('#begin_full_sync').text("同步中");
} else {
layer.msg("正在同步中..",{icon:0});
}
});
$('#full_sync_cmd').click(function(){
myPostN('full_sync_cmd', {'db':db,'sign':''}, function(rdata){
var rdata = $.parseJSON(rdata.data);
layer.open({
title: "手动执行命令CMD",
area: ['600px', '180px'],
type:1,
closeBtn: 1,
shadeClose: false,
btn:["复制","取消"],
content: '<div class="pd15">\
<div class="divtable">\
<pre class="layui-code">'+rdata.data+'</pre>\
</div>\
</div>',
success:function(){
copyText(rdata.data);
},
yes:function(){
copyText(rdata.data);
}
});
});
});
}
});
});
@@ -1967,12 +2044,91 @@ function getFullSyncStatus(db){
if (rdata['code']==6 ||rdata['code']<0){
layer.msg(rdata['msg']);
clearInterval(timeId);
$("#begin_full_sync").data('data','init');
$('#begin_full_sync').text("同步结束,再次同步?");
$("#begin_full_sync").attr('data-status','init');
}
});
}
}
function dataSyncVerify(db){
var reqTimer = null;
function requestLogs(layerIndex){
myPostN('sync_database_repair_log', {db:db, sign:'',op:'get'}, function(rdata){
var rdata = $.parseJSON(rdata.data);
if(!rdata.status) {
layer.close(layerIndex);
layer.msg(rdata.msg,{icon:2, time:2000});
clearInterval(reqTimer);
return;
};
if (rdata.msg == ''){
rdata.msg = '暂无数据!';
}
$("#data_verify_log").html(rdata.msg);
//滚动到最低
var ob = document.getElementById('data_verify_log');
ob.scrollTop = ob.scrollHeight;
});
}
layer.open({
type: 1,
title: '同步数据库['+db+']数据校验',
area: '500px',
btn:[ "开始","取消","手动"],
content:"<div class='bt-form'>\
"+'<pre id="data_verify_log" style="overflow: auto; border: 0px none; line-height:23px;padding: 5px; margin: 0px; white-space: pre-wrap; height: 395px; background-color: rgb(51,51,51);color:#f1f1f1;border-radius:0px;font-family:"></pre>'+"\
</div>",
cancel: function(){
if (reqTimer){
clearInterval(reqTimer);
}
},
yes:function(index,layer_index){
myPostN('sync_database_repair_log', {db:db, sign:'',op:'do'}, function(data){});
layer.msg("执行成功");
requestLogs(layer_index);
reqTimer = setInterval(function(){
requestLogs(layer_index);
},3000);
},
success:function(){
},
btn3: function(){
myPostN('sync_database_repair_log', {db:db, sign:'',op:'cmd'}, function(rdata){
var rdata = $.parseJSON(rdata.data);
layer.open({
title: "手动执行命令CMD",
area: ['600px', '180px'],
type:1,
closeBtn: 1,
shadeClose: false,
btn:["复制","取消"],
content: '<div class="pd15">\
<div class="divtable">\
<pre class="layui-code">'+rdata.data+'</pre>\
</div>\
</div>',
success:function(){
copyText(rdata.data);
},
yes:function(){
copyText(rdata.data);
}
});
});
return false;
}
});
}
function addSlaveSSH(ip=''){
myPost('get_slave_ssh_by_ip', {ip:ip}, function(rdata){
@@ -2128,7 +2284,7 @@ function addSlaveSyncUser(ip=''){
var index = layer.open({
type: 1,
area: ['500px','470px'],
area: ['500px','510px'],
title: '同步账户',
closeBtn: 1,
shift: 5,
@@ -2140,7 +2296,16 @@ function addSlaveSyncUser(ip=''){
<div class='line'><span class='tname'>同步账户</span><div class='info-r'><input name='user' class='bt-input-text mr5' type='text' style='width:330px;' value='"+user+"'></div></div>\
<div class='line'><span class='tname'>同步密码</span><div class='info-r'><input name='pass' class='bt-input-text mr5' type='text' style='width:330px;' value='"+pass+"'></div></div>\
<div class='line'>\
<span class='tname'>CMD[必须填写]</span>\
<span class='tname'>同步模式</span>\
<div class='info-r'>\
<select class='bt-input-text mr5' name='mode'>\
<option value='0' "+( mode == '0' ? 'selected="selected"' : '')+">经典</option>\
<option value='1' "+( mode == '1' ? 'selected="selected"' : '')+">GTID</option>\
</select>\
</div>\
</div>\
<div class='line'>\
<span class='tname'>CMD[必填]</span>\
<div class='info-r'><textarea class='bt-input-text mr5' row='20' cols='30' name='cmd' style='width:330px;height:150px;'></textarea></div>\
</div>\
<input type='hidden' name='mode' value='"+mode+"' />\
@@ -2149,6 +2314,7 @@ function addSlaveSyncUser(ip=''){
$('textarea[name="cmd"]').html(cmd);
$('textarea[name="cmd"]').change(function(){
var val = $(this).val();
val = val.replace(';','');
var a = {};
if (val.toLowerCase().indexOf('for')>0){
cmd_tmp = val.split('for');
@@ -2171,15 +2337,18 @@ function addSlaveSyncUser(ip=''){
a[kv[0]] = kv[1].replace("'",'').replace("'",'');
}
$('input[name="ip"]').val(a['MASTER_HOST']);
$('input[name="port"]').val(a['MASTER_PORT']);
$('input[name="user"]').val(a['MASTER_USER']);
$('input[name="pass"]').val(a['MASTER_PASSWORD']);
console.log(a['MASTER_AUTO_POSITION'],typeof(a['MASTER_AUTO_POSITION']));
if (typeof(a['MASTER_AUTO_POSITION']) != 'undefined' ){
$('input[name="mode"]').val('1');
if ('MASTER_HOST' in a){
$('input[name="ip"]').val(a['MASTER_HOST']);
$('input[name="port"]').val(a['MASTER_PORT']);
$('input[name="user"]').val(a['MASTER_USER']);
$('input[name="pass"]').val(a['MASTER_PASSWORD']);
} else {
$('input[name="ip"]').val(a['SOURCE_HOST']);
$('input[name="port"]').val(a['SOURCE_PORT']);
$('input[name="user"]').val(a['SOURCE_USER']);
$('input[name="pass"]').val(a['SOURCE_PASSWORD']);
}
});
},
yes:function(index){
@@ -2188,7 +2357,7 @@ function addSlaveSyncUser(ip=''){
var user = $('input[name="user"]').val();
var pass = $('input[name="pass"]').val();
var cmd = $('textarea[name="cmd"]').val();
var mode = $('input[name="mode"]').val();
var mode = $('select[name="mode"]').val();
var data = {ip:ip,port:port,cmd:cmd,user:user,pass:pass,mode:mode};
myPost('add_slave_sync_user', data, function(ret_data){
@@ -2458,6 +2627,8 @@ function masterOrSlaveConf(version=''){
_data['page'] = page;
_data['page_size'] = 10;
var mdb_ver = $('.plugin_version').attr('version');
myPost('get_slave_list', _data, function(data){
var rdata = $.parseJSON(data.data);
var list = '';
@@ -2466,22 +2637,39 @@ function masterOrSlaveConf(version=''){
for(i in rdata.data){
var v = rdata.data[i];
if ('Channel_Name' in v){
if ('Channel_Name' in v && v['Channel_Name'] !=''){
isHasSign = true;
}
var status = "<a data-id="+i+" class='btlink db_error'>异常</>";
if (v['Slave_SQL_Running'] == 'Yes' && v['Slave_IO_Running'] == 'Yes'){
status = "正常";
}
if (mdb_ver >= 8){
list += '<tr>';
list += '<td>' + rdata.data[i]['Master_Host'] +'</td>';
list += '<td>' + rdata.data[i]['Master_Port'] +'</td>';
list += '<td>' + rdata.data[i]['Master_User'] +'</td>';
list += '<td>' + rdata.data[i]['Master_Log_File'] +'</td>';
list += '<td>' + rdata.data[i]['Slave_IO_Running'] +'</td>';
list += '<td>' + rdata.data[i]['Slave_SQL_Running'] +'</td>';
if (v['Replica_SQL_Running'] == 'Yes' && v['Replica_IO_Running'] == 'Yes'){
status = "正常";
}
list += '<tr>';
list += '<td>' + rdata.data[i]['Source_Host'] +'</td>';
list += '<td>' + rdata.data[i]['Source_Port'] +'</td>';
list += '<td>' + rdata.data[i]['Source_User'] +'</td>';
list += '<td>' + rdata.data[i]['Relay_Source_Log_File'] +'</td>';
list += '<td>' + rdata.data[i]['Replica_IO_Running'] +'</td>';
list += '<td>' + rdata.data[i]['Replica_SQL_Running'] +'</td>';
} else {
if (v['Slave_SQL_Running'] == 'Yes' && v['Slave_IO_Running'] == 'Yes'){
status = "正常";
}
list += '<tr>';
list += '<td>' + rdata.data[i]['Master_Host'] +'</td>';
list += '<td>' + rdata.data[i]['Master_Port'] +'</td>';
list += '<td>' + rdata.data[i]['Master_User'] +'</td>';
list += '<td>' + rdata.data[i]['Master_Log_File'] +'</td>';
list += '<td>' + rdata.data[i]['Slave_IO_Running'] +'</td>';
list += '<td>' + rdata.data[i]['Slave_SQL_Running'] +'</td>';
}
if (isHasSign){
list += '<td>' + v['Channel_Name'] +'</td>';
@@ -2553,6 +2741,7 @@ function masterOrSlaveConf(version=''){
<td>"+(info['Slave_SQL_Running_State'] == '' ? '无':info['Slave_SQL_Running_State']) +"</td>\
</tr>";
var btn_list = ['复制错误',"取消"];
if (info['Last_IO_Error'].search(/1236/i)>0){
btn_list = ['复制错误',"取消","尝试修复"];
@@ -2636,7 +2825,8 @@ function masterOrSlaveConf(version=''){
list += '<td>' + rdata.data[i]['name'] +'</td>';
list += '<td style="text-align:right">' +
'<a href="javascript:;" class="btlink" onclick="setDbSlave(\''+rdata.data[i]['name']+'\')" title="加入|退出">'+(rdata.data[i]['slave']?'退出':'加入')+'</a> | ' +
'<a href="javascript:;" class="btlink" onclick="getFullSyncStatus(\''+rdata.data[i]['name']+'\')" title="同步">同步</a>' +
'<a href="javascript:;" class="btlink" onclick="getFullSyncStatus(\''+rdata.data[i]['name']+'\')" title="同步">同步</a> | ' +
'<a href="javascript:;" class="btlink" onclick="dataSyncVerify(\''+rdata.data[i]['name']+'\')" title="数据校验">数据校验</a>' +
'</td>';
list += '</tr>';
}
@@ -2684,7 +2874,7 @@ function masterOrSlaveConf(version=''){
<p class="conf_p">\
<span class="f14 c6 mr20">Master[主]配置</span><span class="f14 c6 mr20"></span>\
<button class="btn '+(!rdata.status ? 'btn-danger' : 'btn-success')+' btn-xs btn-master">'+(!rdata.status ? '未开启' : '已开启') +'</button>\
<button class="btn btn-success btn-xs" onclick="resetMaster()" >重置</button>\
<button class="btn btn-success btn-xs" onclick="resetMaster()">重置</button>\
</p>\
<hr/>\
<!-- master list -->\
+1 -1
View File
@@ -63,7 +63,7 @@ class backupTools:
if len(mycnf) > 100:
mw.writeFile(db_path + '/etc/my.cnf', mycnf)
cmd = db_path + "/bin/usr/bin/mysqldump --defaults-file=" + my_conf_path + " --single-transaction -q --default-character-set=utf8 " + \
cmd = db_path + "/bin/usr/bin/mysqldump --defaults-file=" + my_conf_path + " --single-transaction -q --default-character-set=utf8mb4 " + \
name + " | gzip > " + filename
mw.execShell(cmd)
@@ -96,14 +96,6 @@ rm -rf $myDir
Install_mysql()
{
echo '正在安装脚本文件...' > $install_tmp
if id mysql &> /dev/null ;then
echo "mysql uid is `id -u mysql`"
echo "mysql shell is `grep "^mysql:" /etc/passwd |cut -d':' -f7 `"
else
groupadd mysql
useradd -g mysql mysql
fi
isApt=`which apt`
if [ "$isApt" != "" ];then
+9 -12
View File
@@ -23,10 +23,10 @@ VERSION_ID=`cat /etc/*-release | grep VERSION_ID | awk -F = '{print $2}' | awk -
# cd /www/server/mdserver-web/plugins/mysql-apt && bash install.sh install 8.0
# 暂时debian12没有标准版,先用11使用
if [ "$OSNAME" == 'debian' ] && [ "$VERSION_ID" == '12' ] ;then
echo "暂时不支持该${OSNAME}${VERSION_ID}" > $install_tmp
exit 1
fi
# if [ "$OSNAME" == 'debian' ] && [ "$VERSION_ID" == '12' ] ;then
# echo "暂时不支持该${OSNAME}${VERSION_ID}" > $install_tmp
# exit 1
# fi
ARCH="amd64"
@@ -45,7 +45,7 @@ if [ "$ARCH" != "amd64" ];then
fi
MYSQL_VER=8.0.33
MYSQL_VER=8.0.36
SUFFIX_NAME=${MYSQL_VER}-1${OSNAME}${VERSION_ID}_${ARCH}
@@ -58,6 +58,10 @@ APT_INSTALL()
mkdir -p $myDir
mkdir -p $serverPath/mysql-apt/bin
mkdir -p /var/run/mysqld
chown mysql -R /var/run/mysqld
wget --no-check-certificate -O ${myDir}/mysql-server_${SUFFIX_NAME}.deb-bundle.tar https://cdn.mysql.com/archives/mysql-8.0/mysql-server_${SUFFIX_NAME}.deb-bundle.tar
chmod +x ${myDir}/mysql-server_${SUFFIX_NAME}.deb-bundle.tar
cd ${myDir} && tar vxf ${myDir}/mysql-server_${SUFFIX_NAME}.deb-bundle.tar
@@ -97,13 +101,6 @@ rm -rf $myDir
Install_mysql()
{
echo '正在安装脚本文件...' > $install_tmp
if id mysql &> /dev/null ;then
echo "mysql uid is `id -u mysql`"
echo "mysql shell is `grep "^mysql:" /etc/passwd |cut -d':' -f7 `"
else
groupadd mysql
useradd -g mysql mysql
fi
isApt=`which apt`
if [ "$isApt" != "" ];then
+9 -11
View File
@@ -1,3 +1,4 @@
# -*- coding: utf-8 -*-
#!/bin/bash
@@ -21,12 +22,13 @@ OSNAME=`cat ${rootPath}/data/osname.pl`
VERSION_ID=`cat /etc/*-release | grep VERSION_ID | awk -F = '{print $2}' | awk -F "\"" '{print $2}'`
# cd /www/server/mdserver-web/plugins/mysql-apt && bash install.sh install 8.0
# cd /www/server/mdserver-web && source bin/activate && python3 plugins/mysql-apt/index.py start
# 暂时debian12没有标准版,先用11使用
if [ "$OSNAME" == 'debian' ] && [ "$VERSION_ID" == '12' ] ;then
echo "暂时不支持该${OSNAME}${VERSION_ID}" > $install_tmp
exit 1
fi
# if [ "$OSNAME" == 'debian' ] && [ "$VERSION_ID" == '12' ] ;then
# echo "暂时不支持该${OSNAME}${VERSION_ID}" > $install_tmp
# exit 1
# fi
ARCH="amd64"
@@ -58,6 +60,9 @@ APT_INSTALL()
mkdir -p $myDir
mkdir -p $serverPath/mysql-apt/bin
mkdir -p /var/run/mysqld
chown mysql -R /var/run/mysqld
wget --no-check-certificate -O ${myDir}/mysql-server_${SUFFIX_NAME}.deb-bundle.tar https://cdn.mysql.com/archives/mysql-8.2/mysql-server_${SUFFIX_NAME}.deb-bundle.tar
chmod +x ${myDir}/mysql-server_${SUFFIX_NAME}.deb-bundle.tar
cd ${myDir} && tar vxf ${myDir}/mysql-server_${SUFFIX_NAME}.deb-bundle.tar
@@ -97,13 +102,6 @@ rm -rf $myDir
Install_mysql()
{
echo '正在安装脚本文件...' > $install_tmp
if id mysql &> /dev/null ;then
echo "mysql uid is `id -u mysql`"
echo "mysql shell is `grep "^mysql:" /etc/passwd |cut -d':' -f7 `"
else
groupadd mysql
useradd -g mysql mysql
fi
isApt=`which apt`
if [ "$isApt" != "" ];then
+136
View File
@@ -0,0 +1,136 @@
# -*- coding: utf-8 -*-
#!/bin/bash
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
export PATH
export DEBIAN_FRONTEND=noninteractive
# https://downloads.mysql.com/archives/community/
curPath=`pwd`
rootPath=$(dirname "$curPath")
rootPath=$(dirname "$rootPath")
serverPath=$(dirname "$rootPath")
sysName=`uname`
install_tmp=${rootPath}/tmp/mw_install.pl
myDir=${serverPath}/source/mysql-apt
bash ${rootPath}/scripts/getos.sh
OSNAME=`cat ${rootPath}/data/osname.pl`
VERSION_ID=`cat /etc/*-release | grep VERSION_ID | awk -F = '{print $2}' | awk -F "\"" '{print $2}'`
# cd /www/server/mdserver-web/plugins/mysql-apt && bash install.sh install 8.0
# 暂时debian12没有标准版,先用11使用
# if [ "$OSNAME" == 'debian' ] && [ "$VERSION_ID" == '12' ] ;then
# echo "暂时不支持该${OSNAME}${VERSION_ID}" > $install_tmp
# exit 1
# fi
ARCH="amd64"
TMP_ARCH=`arch`
if [ "$TMP_ARCH" == "x86_64" ];then
ARCH="amd64"
elif [ "$TMP_ARCH" == "aarch64" ];then
ARCH="arm64"
else
ARCH="amd64"
fi
if [ "$ARCH" != "amd64" ];then
echo "暂时不支持该${ARCH}" > $install_tmp
exit 1
fi
MYSQL_VER=8.3.0
SUFFIX_NAME=${MYSQL_VER}-1${OSNAME}${VERSION_ID}_${ARCH}
# /lib/systemd/system/mysql.service
# /etc/mysql/my.cnf
APT_INSTALL()
{
########
mkdir -p $myDir
mkdir -p $serverPath/mysql-apt/bin
mkdir -p /var/run/mysqld
chown mysql -R /var/run/mysqld
wget --no-check-certificate -O ${myDir}/mysql-server_${SUFFIX_NAME}.deb-bundle.tar https://cdn.mysql.com/archives/mysql-8.3/mysql-server_${SUFFIX_NAME}.deb-bundle.tar
chmod +x ${myDir}/mysql-server_${SUFFIX_NAME}.deb-bundle.tar
cd ${myDir} && tar vxf ${myDir}/mysql-server_${SUFFIX_NAME}.deb-bundle.tar
apt update -y
apt install -y libnuma1 libaio1 libmecab2
# 安装
dpkg -X mysql-common_${SUFFIX_NAME}.deb $serverPath/mysql-apt/bin
dpkg -X mysql-community-client-plugins_${SUFFIX_NAME}.deb $serverPath/mysql-apt/bin
dpkg -X mysql-community-client-core_${SUFFIX_NAME}.deb $serverPath/mysql-apt/bin
dpkg -X mysql-community-client_${SUFFIX_NAME}.deb $serverPath/mysql-apt/bin
dpkg -X mysql-client_${SUFFIX_NAME}.deb $serverPath/mysql-apt/bin
dpkg -X mysql-community-server-core_${SUFFIX_NAME}.deb $serverPath/mysql-apt/bin
dpkg -X mysql-community-server_${SUFFIX_NAME}.deb $serverPath/mysql-apt/bin
dpkg -X mysql-server_${SUFFIX_NAME}.deb $serverPath/mysql-apt/bin
# 测试时可关闭
rm -rf $myDir
#######
}
APT_UNINSTALL()
{
###
rm -rf $myDir
# apt remove -y mysql-server
###
}
Install_mysql()
{
echo '正在安装脚本文件...' > $install_tmp
isApt=`which apt`
if [ "$isApt" != "" ];then
APT_INSTALL
fi
if [ "$?" == "0" ];then
mkdir -p $serverPath/mysql-apt
echo '8.3' > $serverPath/mysql-apt/version.pl
echo '安装完成' > $install_tmp
else
echo '8.3' > $serverPath/mysql-apt/version.pl
echo "暂时不支持该系统" > $install_tmp
fi
}
Uninstall_mysql()
{
isApt=`which apt`
if [ "$isApt" != "" ];then
APT_UNINSTALL
fi
rm -rf $serverPath/mysql-apt
echo '卸载完成' > $install_tmp
}
action=$1
if [ "${1}" == 'install' ];then
Install_mysql
else
Uninstall_mysql
fi
+139
View File
@@ -0,0 +1,139 @@
# -*- coding: utf-8 -*-
#!/bin/bash
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
export PATH
export DEBIAN_FRONTEND=noninteractive
# https://downloads.mysql.com/archives/community/
curPath=`pwd`
rootPath=$(dirname "$curPath")
rootPath=$(dirname "$rootPath")
serverPath=$(dirname "$rootPath")
sysName=`uname`
install_tmp=${rootPath}/tmp/mw_install.pl
myDir=${serverPath}/source/mysql-apt
bash ${rootPath}/scripts/getos.sh
OSNAME=`cat ${rootPath}/data/osname.pl`
VERSION_ID=`cat /etc/*-release | grep VERSION_ID | awk -F = '{print $2}' | awk -F "\"" '{print $2}'`
# cd /www/server/mdserver-web/plugins/mysql-apt && bash install.sh install 8.0
# 暂时debian12没有标准版,先用11使用
# if [ "$OSNAME" == 'debian' ] && [ "$VERSION_ID" == '12' ] ;then
# echo "暂时不支持该${OSNAME}${VERSION_ID}" > $install_tmp
# exit 1
# fi
ARCH="amd64"
TMP_ARCH=`arch`
if [ "$TMP_ARCH" == "x86_64" ];then
ARCH="amd64"
elif [ "$TMP_ARCH" == "aarch64" ];then
ARCH="arm64"
else
ARCH="amd64"
fi
if [ "$ARCH" != "amd64" ];then
echo "暂时不支持该${ARCH}" > $install_tmp
exit 1
fi
MYSQL_VER=8.4.2
SUFFIX_NAME=${MYSQL_VER}-1${OSNAME}${VERSION_ID}_${ARCH}
# /lib/systemd/system/mysql.service
# /etc/mysql/my.cnf
APT_INSTALL()
{
########
mkdir -p $myDir
mkdir -p $serverPath/mysql-apt/bin
mkdir -p /var/run/mysqld
chown mysql -R /var/run/mysqld
# https://cdn.mysql.com/archives/mysql-8.4/mysql-server_${SUFFIX_NAME}.deb-bundle.tar
# https://dev.mysql.com/get/Downloads/MySQL-8.4/mysql-server_${SUFFIX_NAME}.deb-bundle.tar
wget --no-check-certificate -O ${myDir}/mysql-server_${SUFFIX_NAME}.deb-bundle.tar https://dev.mysql.com/get/Downloads/MySQL-8.4/mysql-server_${SUFFIX_NAME}.deb-bundle.tar
chmod +x ${myDir}/mysql-server_${SUFFIX_NAME}.deb-bundle.tar
cd ${myDir} && tar vxf ${myDir}/mysql-server_${SUFFIX_NAME}.deb-bundle.tar
apt update -y
apt install -y libnuma1 libaio1 libmecab2
# 安装
dpkg -X mysql-common_${SUFFIX_NAME}.deb $serverPath/mysql-apt/bin
dpkg -X mysql-community-client-plugins_${SUFFIX_NAME}.deb $serverPath/mysql-apt/bin
dpkg -X mysql-community-client-core_${SUFFIX_NAME}.deb $serverPath/mysql-apt/bin
dpkg -X mysql-community-client_${SUFFIX_NAME}.deb $serverPath/mysql-apt/bin
dpkg -X mysql-client_${SUFFIX_NAME}.deb $serverPath/mysql-apt/bin
dpkg -X mysql-community-server-core_${SUFFIX_NAME}.deb $serverPath/mysql-apt/bin
dpkg -X mysql-community-server_${SUFFIX_NAME}.deb $serverPath/mysql-apt/bin
dpkg -X mysql-server_${SUFFIX_NAME}.deb $serverPath/mysql-apt/bin
# 测试时可关闭
rm -rf $myDir
#######
}
APT_UNINSTALL()
{
###
rm -rf $myDir
# apt remove -y mysql-server
###
}
Install_mysql()
{
echo '正在安装脚本文件...' > $install_tmp
isApt=`which apt`
if [ "$isApt" != "" ];then
APT_INSTALL
fi
if [ "$?" == "0" ];then
mkdir -p $serverPath/mysql-apt
echo '8.4' > $serverPath/mysql-apt/version.pl
echo '安装完成' >
else
echo '8.4' > $serverPath/mysql-apt/version.pl
echo "暂时不支持该系统"
fi
}
Uninstall_mysql()
{
isApt=`which apt`
if [ "$isApt" != "" ];then
APT_UNINSTALL
fi
rm -rf $serverPath/mysql-apt
echo '卸载完成' > $install_tmp
}
action=$1
if [ "${1}" == 'install' ];then
Install_mysql
else
Uninstall_mysql
fi
+139
View File
@@ -0,0 +1,139 @@
# -*- coding: utf-8 -*-
#!/bin/bash
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
export PATH
export DEBIAN_FRONTEND=noninteractive
# https://downloads.mysql.com/archives/community/
curPath=`pwd`
rootPath=$(dirname "$curPath")
rootPath=$(dirname "$rootPath")
serverPath=$(dirname "$rootPath")
sysName=`uname`
install_tmp=${rootPath}/tmp/mw_install.pl
myDir=${serverPath}/source/mysql-apt
bash ${rootPath}/scripts/getos.sh
OSNAME=`cat ${rootPath}/data/osname.pl`
VERSION_ID=`cat /etc/*-release | grep VERSION_ID | awk -F = '{print $2}' | awk -F "\"" '{print $2}'`
# cd /www/server/mdserver-web/plugins/mysql-apt && bash install.sh install 9.0
# 暂时debian12没有标准版,先用11使用
# if [ "$OSNAME" == 'debian' ] && [ "$VERSION_ID" == '12' ] ;then
# echo "暂时不支持该${OSNAME}${VERSION_ID}" > $install_tmp
# exit 1
# fi
ARCH="amd64"
TMP_ARCH=`arch`
if [ "$TMP_ARCH" == "x86_64" ];then
ARCH="amd64"
elif [ "$TMP_ARCH" == "aarch64" ];then
ARCH="arm64"
else
ARCH="amd64"
fi
if [ "$ARCH" != "amd64" ];then
echo "暂时不支持该${ARCH}" > $install_tmp
exit 1
fi
MYSQL_VER=9.0.1
SUFFIX_NAME=${MYSQL_VER}-1${OSNAME}${VERSION_ID}_${ARCH}
# /lib/systemd/system/mysql.service
# /etc/mysql/my.cnf
APT_INSTALL()
{
########
mkdir -p $myDir
mkdir -p $serverPath/mysql-apt/bin
mkdir -p /var/run/mysqld
chown mysql -R /var/run/mysqld
# https://cdn.mysql.com/archives/mysql-8.4/mysql-server_${SUFFIX_NAME}.deb-bundle.tar
# https://dev.mysql.com/get/Downloads/MySQL-8.4/mysql-server_${SUFFIX_NAME}.deb-bundle.tar
wget --no-check-certificate -O ${myDir}/mysql-server_${SUFFIX_NAME}.deb-bundle.tar https://dev.mysql.com/get/Downloads/MySQL-8.4/mysql-server_${SUFFIX_NAME}.deb-bundle.tar
chmod +x ${myDir}/mysql-server_${SUFFIX_NAME}.deb-bundle.tar
cd ${myDir} && tar vxf ${myDir}/mysql-server_${SUFFIX_NAME}.deb-bundle.tar
apt update -y
apt install -y libnuma1 libaio1 libmecab2
# 安装
dpkg -X mysql-common_${SUFFIX_NAME}.deb $serverPath/mysql-apt/bin
dpkg -X mysql-community-client-plugins_${SUFFIX_NAME}.deb $serverPath/mysql-apt/bin
dpkg -X mysql-community-client-core_${SUFFIX_NAME}.deb $serverPath/mysql-apt/bin
dpkg -X mysql-community-client_${SUFFIX_NAME}.deb $serverPath/mysql-apt/bin
dpkg -X mysql-client_${SUFFIX_NAME}.deb $serverPath/mysql-apt/bin
dpkg -X mysql-community-server-core_${SUFFIX_NAME}.deb $serverPath/mysql-apt/bin
dpkg -X mysql-community-server_${SUFFIX_NAME}.deb $serverPath/mysql-apt/bin
dpkg -X mysql-server_${SUFFIX_NAME}.deb $serverPath/mysql-apt/bin
# 测试时可关闭
rm -rf $myDir
#######
}
APT_UNINSTALL()
{
###
rm -rf $myDir
# apt remove -y mysql-server
###
}
Install_mysql()
{
echo '正在安装脚本文件...' > $install_tmp
isApt=`which apt`
if [ "$isApt" != "" ];then
APT_INSTALL
fi
if [ "$?" == "0" ];then
mkdir -p $serverPath/mysql-apt
echo '9.0' > $serverPath/mysql-apt/version.pl
echo '安装完成'
else
echo '9.0' > $serverPath/mysql-apt/version.pl
echo "暂时不支持该系统"
fi
}
Uninstall_mysql()
{
isApt=`which apt`
if [ "$isApt" != "" ];then
APT_UNINSTALL
fi
rm -rf $serverPath/mysql-apt
echo '卸载完成'
}
action=$1
if [ "${1}" == 'install' ];then
Install_mysql
else
Uninstall_mysql
fi
+1 -6
View File
@@ -17,7 +17,6 @@ socket = {$SERVER_APP_PATH}/mysql.sock
datadir = {$SERVER_APP_PATH}/data
log-error = {$SERVER_APP_PATH}/data/error.log
server-id = {$SERVER_ID}
sql-mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES
default_storage_engine = InnoDB
@@ -45,7 +44,6 @@ max_allowed_packet = 128M
#skip-name-resolve
log-bin=mysql-bin
binlog_format=mixed
slow_query_log=1
slow-query-log-file={$SERVER_APP_PATH}/data/mysql-slow.log
long_query_time=3
@@ -66,15 +64,12 @@ binlog-ignore-db = performance_schema
#slave
log_replica_updates
#replicate-do-db
slave_skip_errors=1062,1396
replica_skip_errors=1062,1396
replicate-ignore-db = information_schema
replicate-ignore-db = performance_schema
replicate-ignore-db = mysql
replicate-ignore-db = test
master_info_repository = table
relay_log_info_repository = table
default_storage_engine = InnoDB
innodb_data_home_dir = {$SERVER_APP_PATH}/data
innodb_data_file_path = ibdata1:10M:autoextend
+105
View File
@@ -0,0 +1,105 @@
[client]
user = root
#password = your_password
port = 33206
socket = {$SERVER_APP_PATH}/mysql.sock
default-character-set = UTF8MB4
[mysqld]
!include {$SERVER_APP_PATH}/etc/mode/classic.cnf
authentication_policy=caching_sha2_password
pid-file = {$SERVER_APP_PATH}/data/mysql.pid
user = mysql
port = 33206
mysqlx_port = 33260
socket = {$SERVER_APP_PATH}/mysql.sock
datadir = {$SERVER_APP_PATH}/data
log-error = {$SERVER_APP_PATH}/data/error.log
server-id = {$SERVER_ID}
sql-mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES
default_storage_engine = InnoDB
key_buffer_size = 8M
table_open_cache = 32
sort_buffer_size = 256K
net_buffer_length = 4K
read_buffer_size = 128K
read_rnd_buffer_size = 256K
myisam_sort_buffer_size = 4M
thread_cache_size = 4
lower_case_table_names=1
tmp_table_size = 8M
character-set-server = UTF8MB4
max_connections = 500
max_connect_errors = 100
open_files_limit = 2560
max_allowed_packet = 128M
#skip-external-locking
#skip-grant-tables
#loose-skip-innodb
#skip-networking
#skip-name-resolve
log-bin=mysql-bin
slow_query_log=1
slow-query-log-file={$SERVER_APP_PATH}/data/mysql-slow.log
long_query_time=3
#log_queries_not_using_indexes=on
relay-log=mdserver
relay-log-index=mdserver
#master
#binlog-do-db
#sync_binlog=1
binlog-ignore-db = test
binlog-ignore-db = mysql
binlog-ignore-db = information_schema
binlog-ignore-db = performance_schema
#slave
log_replica_updates
#replicate-do-db
replica_skip_errors=1062,1396
replicate-ignore-db = information_schema
replicate-ignore-db = performance_schema
replicate-ignore-db = mysql
replicate-ignore-db = test
default_storage_engine = InnoDB
innodb_data_home_dir = {$SERVER_APP_PATH}/data
innodb_data_file_path = ibdata1:10M:autoextend
innodb_log_group_home_dir = {$SERVER_APP_PATH}/data
innodb_buffer_pool_size = 16M
innodb_redo_log_capacity=10485760
innodb_log_buffer_size = 8M
innodb_flush_log_at_trx_commit = 1
innodb_lock_wait_timeout = 120
innodb_max_dirty_pages_pct = 90
innodb_read_io_threads = 1
innodb_write_io_threads = 1
innodb_file_per_table=1
binlog_expire_logs_seconds=2592000
secure-file-priv={$SERVER_APP_PATH}/tmp
[mysqldump]
quick
[mysql]
no-auto-rehash
[myisamchk]
key_buffer_size = 20M
sort_buffer_size = 20M
read_buffer = 2M
write_buffer = 2M
[mysqlhotcopy]
interactive-timeout
+105
View File
@@ -0,0 +1,105 @@
[client]
user = root
#password = your_password
port = 33206
socket = {$SERVER_APP_PATH}/mysql.sock
default-character-set = UTF8MB4
[mysqld]
!include {$SERVER_APP_PATH}/etc/mode/classic.cnf
authentication_policy=caching_sha2_password
pid-file = {$SERVER_APP_PATH}/data/mysql.pid
user = mysql
port = 33206
mysqlx_port = 33260
socket = {$SERVER_APP_PATH}/mysql.sock
datadir = {$SERVER_APP_PATH}/data
log-error = {$SERVER_APP_PATH}/data/error.log
server-id = {$SERVER_ID}
sql-mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES
default_storage_engine = InnoDB
key_buffer_size = 8M
table_open_cache = 32
sort_buffer_size = 256K
net_buffer_length = 4K
read_buffer_size = 128K
read_rnd_buffer_size = 256K
myisam_sort_buffer_size = 4M
thread_cache_size = 4
lower_case_table_names=1
tmp_table_size = 8M
character-set-server = UTF8MB4
max_connections = 500
max_connect_errors = 100
open_files_limit = 2560
max_allowed_packet = 128M
#skip-external-locking
#skip-grant-tables
#loose-skip-innodb
#skip-networking
#skip-name-resolve
log-bin=mysql-bin
slow_query_log=1
slow-query-log-file={$SERVER_APP_PATH}/data/mysql-slow.log
long_query_time=3
#log_queries_not_using_indexes=on
relay-log=mdserver
relay-log-index=mdserver
#master
#binlog-do-db
#sync_binlog=1
binlog-ignore-db = test
binlog-ignore-db = mysql
binlog-ignore-db = information_schema
binlog-ignore-db = performance_schema
#slave
log_replica_updates
#replicate-do-db
replica_skip_errors=1062,1396
replicate-ignore-db = information_schema
replicate-ignore-db = performance_schema
replicate-ignore-db = mysql
replicate-ignore-db = test
default_storage_engine = InnoDB
innodb_data_home_dir = {$SERVER_APP_PATH}/data
innodb_data_file_path = ibdata1:10M:autoextend
innodb_log_group_home_dir = {$SERVER_APP_PATH}/data
innodb_buffer_pool_size = 16M
innodb_redo_log_capacity=10485760
innodb_log_buffer_size = 8M
innodb_flush_log_at_trx_commit = 1
innodb_lock_wait_timeout = 120
innodb_max_dirty_pages_pct = 90
innodb_read_io_threads = 1
innodb_write_io_threads = 1
innodb_file_per_table=1
binlog_expire_logs_seconds=2592000
secure-file-priv={$SERVER_APP_PATH}/tmp
[mysqldump]
quick
[mysql]
no-auto-rehash
[myisamchk]
key_buffer_size = 20M
sort_buffer_size = 20M
read_buffer = 2M
write_buffer = 2M
[mysqlhotcopy]
interactive-timeout
+104
View File
@@ -0,0 +1,104 @@
[client]
user = root
#password = your_password
port = 33206
socket = {$SERVER_APP_PATH}/mysql.sock
default-character-set = UTF8MB4
[mysqld]
!include {$SERVER_APP_PATH}/etc/mode/classic.cnf
#mysql_native_password=ON
authentication_policy=caching_sha2_password
pid-file = {$SERVER_APP_PATH}/data/mysql.pid
user = mysql
port = 33206
#mysqlx_port = 33260
socket = {$SERVER_APP_PATH}/mysql.sock
datadir = {$SERVER_APP_PATH}/data
log-error = {$SERVER_APP_PATH}/data/error.log
server-id = {$SERVER_ID}
default_storage_engine = InnoDB
key_buffer_size = 8M
table_open_cache = 32
sort_buffer_size = 256K
net_buffer_length = 4K
read_buffer_size = 128K
read_rnd_buffer_size = 256K
myisam_sort_buffer_size = 4M
thread_cache_size = 4
lower_case_table_names=1
tmp_table_size = 8M
character-set-server = UTF8MB4
max_connections = 500
max_connect_errors = 100
open_files_limit = 2560
max_allowed_packet = 128M
#skip-external-locking
#skip-grant-tables
#loose-skip-innodb
#skip-networking
#skip-name-resolve
log-bin=mysql-bin
slow_query_log=1
slow-query-log-file={$SERVER_APP_PATH}/data/mysql-slow.log
long_query_time=3
#log_queries_not_using_indexes=on
relay-log=mdserver
relay-log-index=mdserver
#master
#binlog-do-db
#sync_binlog=1
binlog-ignore-db = test
binlog-ignore-db = mysql
binlog-ignore-db = information_schema
binlog-ignore-db = performance_schema
#slave
log_replica_updates
#replicate-do-db
replica_skip_errors=1062,1396
replicate-ignore-db = information_schema
replicate-ignore-db = performance_schema
replicate-ignore-db = mysql
replicate-ignore-db = test
default_storage_engine = InnoDB
innodb_data_home_dir = {$SERVER_APP_PATH}/data
innodb_data_file_path = ibdata1:10M:autoextend
innodb_log_group_home_dir = {$SERVER_APP_PATH}/data
innodb_buffer_pool_size = 16M
innodb_redo_log_capacity=10485760
innodb_log_buffer_size = 8M
innodb_flush_log_at_trx_commit = 1
innodb_lock_wait_timeout = 120
innodb_max_dirty_pages_pct = 90
innodb_read_io_threads = 1
innodb_write_io_threads = 1
innodb_file_per_table=1
binlog_expire_logs_seconds=2592000
secure-file-priv={$SERVER_APP_PATH}/tmp
[mysqldump]
quick
[mysql]
no-auto-rehash
[myisamchk]
key_buffer_size = 20M
sort_buffer_size = 20M
read_buffer = 2M
write_buffer = 2M
[mysqlhotcopy]
interactive-timeout
+104
View File
@@ -0,0 +1,104 @@
[client]
user = root
#password = your_password
port = 33206
socket = {$SERVER_APP_PATH}/mysql.sock
default-character-set = UTF8MB4
[mysqld]
!include {$SERVER_APP_PATH}/etc/mode/classic.cnf
#mysql_native_password=ON
authentication_policy=caching_sha2_password
pid-file = {$SERVER_APP_PATH}/data/mysql.pid
user = mysql
port = 33206
#mysqlx_port = 33260
socket = {$SERVER_APP_PATH}/mysql.sock
datadir = {$SERVER_APP_PATH}/data
log-error = {$SERVER_APP_PATH}/data/error.log
server-id = {$SERVER_ID}
default_storage_engine = InnoDB
key_buffer_size = 8M
table_open_cache = 32
sort_buffer_size = 256K
net_buffer_length = 4K
read_buffer_size = 128K
read_rnd_buffer_size = 256K
myisam_sort_buffer_size = 4M
thread_cache_size = 4
lower_case_table_names=1
tmp_table_size = 8M
character-set-server = UTF8MB4
max_connections = 500
max_connect_errors = 100
open_files_limit = 2560
max_allowed_packet = 128M
#skip-external-locking
#skip-grant-tables
#loose-skip-innodb
#skip-networking
#skip-name-resolve
log-bin=mysql-bin
slow_query_log=1
slow-query-log-file={$SERVER_APP_PATH}/data/mysql-slow.log
long_query_time=3
#log_queries_not_using_indexes=on
relay-log=mdserver
relay-log-index=mdserver
#master
#binlog-do-db
#sync_binlog=1
binlog-ignore-db = test
binlog-ignore-db = mysql
binlog-ignore-db = information_schema
binlog-ignore-db = performance_schema
#slave
log_replica_updates
#replicate-do-db
replica_skip_errors=1062,1396
replicate-ignore-db = information_schema
replicate-ignore-db = performance_schema
replicate-ignore-db = mysql
replicate-ignore-db = test
default_storage_engine = InnoDB
innodb_data_home_dir = {$SERVER_APP_PATH}/data
innodb_data_file_path = ibdata1:10M:autoextend
innodb_log_group_home_dir = {$SERVER_APP_PATH}/data
innodb_buffer_pool_size = 16M
innodb_redo_log_capacity=10485760
innodb_log_buffer_size = 8M
innodb_flush_log_at_trx_commit = 1
innodb_lock_wait_timeout = 120
innodb_max_dirty_pages_pct = 90
innodb_read_io_threads = 1
innodb_write_io_threads = 1
innodb_file_per_table=1
binlog_expire_logs_seconds=2592000
secure-file-priv={$SERVER_APP_PATH}/tmp
[mysqldump]
quick
[mysql]
no-auto-rehash
[myisamchk]
key_buffer_size = 20M
sort_buffer_size = 20M
read_buffer = 2M
write_buffer = 2M
[mysqlhotcopy]
interactive-timeout
+2
View File
@@ -50,7 +50,9 @@ CREATE TABLE IF NOT EXISTS `slave_sync_user` (
`pass` TEXT,
`mode` TEXT,
`cmd` TEXT,
`db` TEXT,
`addtime` TEXT
);
ALTER TABLE `slave_sync_user` ADD COLUMN `db` TEXT DEFAULT '';
+635 -92
View File
@@ -125,7 +125,12 @@ def getSocketFile():
content = mw.readFile(file)
rep = 'socket\s*=\s*(.*)'
tmp = re.search(rep, content)
return tmp.groups()[0].strip()
socket = tmp.groups()[0].strip()
_socket = socket+'.sock'
if os.path.exists(_socket):
return _socket
return socket
def getErrorLogsFile():
@@ -149,8 +154,7 @@ def contentReplace(content):
service_path = mw.getServerDir()
content = content.replace('{$ROOT_PATH}', mw.getRootDir())
content = content.replace('{$SERVER_PATH}', service_path)
content = content.replace('{$SERVER_APP_PATH}',
service_path + '/' + getPluginName())
content = content.replace('{$SERVER_APP_PATH}',service_path + '/' + getPluginName())
server_id = int(time.time())
content = content.replace('{$SERVER_ID}', str(server_id))
@@ -241,17 +245,23 @@ def initDreplace(version=''):
systemDir = mw.systemdCfgDir()
systemService = systemDir + '/mysql-yum.service'
systemServiceTpl = getPluginDir() + '/init.d/mysql' + version + '.service.tpl'
if os.path.exists(systemDir) and not os.path.exists(systemService):
service_path = mw.getServerDir()
se_content = mw.readFile(systemServiceTpl)
se_content = se_content.replace('{$SERVER_PATH}', service_path)
mw.writeFile(systemService, se_content)
mw.execShell('systemctl daemon-reload')
# if os.path.exists(systemDir) and not os.path.exists(systemService):
service_path = mw.getServerDir()
content = mw.readFile(systemServiceTpl)
content = content.replace('{$SERVER_PATH}', service_path)
mw.writeFile(systemService, content)
mw.execShell('systemctl daemon-reload')
if mw.getOs() != 'darwin':
mw.execShell('chown -R mysql mysql ' + getServerDir())
return 'ok'
def process_status():
cmd = "ps -ef|grep mysql-yum | grep mysql |grep -v grep | grep -v python | awk '{print $2}'"
data = mw.execShell(cmd)
if data[0] == '':
return 'stop'
return 'start'
def status(version=''):
pid = getPidFile()
@@ -260,7 +270,7 @@ def status(version=''):
return 'start'
def binLog():
def binLog(version=''):
args = getArgs()
conf = getConf()
con = mw.readFile(conf)
@@ -271,7 +281,7 @@ def binLog():
con = con.replace('#log-bin=mysql-bin', 'log-bin=mysql-bin')
con = con.replace('#binlog_format=mixed', 'binlog_format=mixed')
mw.execShell('sync')
restart()
restart(version)
else:
path = getDataDir()
if 'status' in args:
@@ -285,7 +295,7 @@ def binLog():
con = con.replace('log-bin=mysql-bin', '#log-bin=mysql-bin')
con = con.replace('binlog_format=mixed', '#binlog_format=mixed')
mw.execShell('sync')
restart()
restart(version)
mw.execShell('rm -f ' + path + '/mysql-bin.*')
mw.writeFile(conf, con)
@@ -379,6 +389,8 @@ def getShowLogFile():
tmp = re.search(rep, content)
return tmp.groups()[0].strip()
def getMdb8Ver():
return ['8.0','8.1','8.2','8.3','8.4','9.0']
def pGetDbUser():
if mw.isAppleSystem():
@@ -413,7 +425,8 @@ def initMysql8Data():
user = pGetDbUser()
cmd = serverdir + '/bin/usr/sbin/mysqld --basedir=' + serverdir + '/bin/usr --datadir=' + \
datadir + ' --initialize-insecure --lower-case-table-names=1'
mw.execShell(cmd)
data = mw.execShell(cmd)
# print(data)
if not mw.isAppleSystem():
mw.execShell('chown -R mysql:mysql ' + datadir)
@@ -442,7 +455,6 @@ def yumLibFix():
makeLib64SoftLink('libtinfo')
def initMysql8Pwd():
yumLibFix()
'''
/usr/bin/mysql --defaults-file=/www/server/mysql-apt/etc/my.cnf -uroot -e"UPDATE mysql.user SET password=PASSWORD('BhIroUczczNVaKvw') WHERE user='root';flush privileges;"
/usr/bin/mysql --defaults-file=/www/server/mysql-apt/etc/my.cnf -uroot -e"alter user 'root'@'localhost' identified by '123456';"
@@ -496,19 +508,46 @@ def initMysql8Pwd():
def my8cmd(version, method):
initDreplace(version)
# mysql 8.0 and 5.7
mdb8 = getMdb8Ver()
try:
isInited = True
if version == '5.7':
isInited = initMysql57Data()
elif version == '8.0':
if mw.inArray(mdb8, version):
isInited = initMysql8Data()
else:
isInited = initMysql57Data()
if not isInited:
mw.execShell('systemctl start ' + getPluginName())
initMysql8Pwd()
mw.execShell('systemctl stop ' + getPluginName())
if not mw.isSupportSystemctl():
cmd_init_start = init_file + ' start'
subprocess.Popen(cmd_init_start, stdout=subprocess.PIPE, shell=True,
bufsize=4096, stderr=subprocess.PIPE)
mw.execShell('systemctl ' + method + ' ' + getPluginName())
time.sleep(6)
else:
mw.execShell('systemctl start '+getPluginName())
for x in range(10):
mydb_status = process_status()
if mydb_status == 'start':
initMysql8Pwd()
break
time.sleep(1)
if not mw.isSupportSystemctl():
cmd_init_stop = init_file + ' stop'
subprocess.Popen(cmd_init_stop, stdout=subprocess.PIPE, shell=True,
bufsize=4096, stderr=subprocess.PIPE)
time.sleep(3)
else:
mw.execShell('systemctl stop ' + getPluginName())
if not mw.isSupportSystemctl():
sub = subprocess.Popen(cmd, stdout=subprocess.PIPE, shell=True,
bufsize=4096, stderr=subprocess.PIPE)
sub.wait(5)
else:
mw.execShell('systemctl ' + method + ' ' + getPluginName())
return 'ok'
except Exception as e:
return str(e)
@@ -601,8 +640,8 @@ def setMyDbPos(version=''):
mw.writeFile(myfile, mycnf)
restart(version)
result = mw.execShell(
'ps aux|grep "mysql-apt/bin/usr/sbin/mysqld"| grep -v grep|grep -v python')
cmd = 'ps aux|grep "mysql-yum/bin/usr/sbin/mysqld"| grep -v grep|grep -v python'
result = mw.execShell(cmd)
if len(result[0]) > 10:
mw.writeFile('data/datadir.pl', t_datadir)
return mw.returnJson(True, '存储目录迁移成功!')
@@ -869,6 +908,80 @@ def importDbExternal():
return mw.returnJson(True, 'ok')
def importDbExternalProgress():
args = getArgs()
data = checkArgs(args, ['file', 'name'])
if not data[0]:
return data[1]
file = args['file']
name = args['name']
cmd = 'cd '+mw.getServerDir()+'/mdserver-web && source bin/activate && '
cmd += 'python3 '+mw.getServerDir()+'/mdserver-web/plugins/mysql-yum/index.py import_db_external_progress_bar {"file":"'+file+'","name":"'+name+'"}'
return mw.returnJson(True, 'ok',cmd)
def importDbExternalProgressBar():
args = getArgs()
data = checkArgs(args, ['file', 'name'])
if not data[0]:
return data[1]
file = args['file']
name = args['name']
import_dir = mw.getRootDir() + '/backup/import/'
file_path = import_dir + file
if not os.path.exists(file_path):
return mw.returnJson(False, '文件突然消失?')
exts = ['sql', 'gz', 'zip']
ext = mw.getFileSuffix(file)
if ext not in exts:
return mw.returnJson(False, '导入数据库格式不对!')
tmp = file.split('/')
tmpFile = tmp[len(tmp) - 1]
tmpFile = tmpFile.replace('.sql.' + ext, '.sql')
tmpFile = tmpFile.replace('.' + ext, '.sql')
tmpFile = tmpFile.replace('tar.', '')
# print(tmpFile)
import_sql = ""
if file.find("sql.gz") > -1:
cmd = 'cd ' + import_dir + ' && gzip -dc ' + \
file + " > " + import_dir + tmpFile
info = mw.execShell(cmd)
if info[1] == "":
import_sql = import_dir + tmpFile
if file.find(".zip") > -1:
cmd = 'cd ' + import_dir + ' && unzip -o ' + file
mw.execShell(cmd)
import_sql = import_dir + tmpFile
if file.find("tar.gz") > -1:
cmd = 'cd ' + import_dir + ' && tar -zxvf ' + file
mw.execShell(cmd)
import_sql = import_dir + tmpFile
if file.find(".sql") > -1 and file.find(".sql.gz") == -1:
import_sql = import_dir + file
if import_sql == "":
return mw.returnJson(False, '未找SQL文件')
pwd = pSqliteDb('config').where('id=?', (1,)).getField('mysql_root')
sock = getSocketFile()
my_cnf = getConf()
mysql_cmd = getServerDir() + '/bin/usr/bin/mysql --defaults-file=' + my_cnf + \
' -uroot -p"' + pwd + '" -f ' + name
mysql_cmd_progress_bar = "pv -t -p " + import_sql + '|'+ mysql_cmd
print(mysql_cmd_progress_bar)
rdata = os.system(mysql_cmd_progress_bar)
return ""
def importDbBackup():
args = getArgs()
@@ -1239,7 +1352,7 @@ def addDb():
reg = "^[\w-]+$"
if not re.match(reg, args['name']):
return mw.returnJson(False, '数据库名称不能带有特殊符号!')
checks = ['root', 'mysql', 'test', 'sys', 'panel_logs']
checks = ['root', 'mysql', 'test', 'sys', 'performance_schema','information_schema']
if dbuser in checks or len(dbuser) < 1:
return mw.returnJson(False, '数据库用户名不合法!')
if dbname in checks or len(dbname) < 1:
@@ -1388,7 +1501,8 @@ def resetDbRootPwd(version):
pSqliteDb('config').where('id=?', (1,)).save('mysql_root', (pwd,))
if float(version) < 5.7:
mdb8 = getMdb8Ver()
if not mw.inArray(mdb8, version):
cmd_pass = serverdir + '/bin/usr/bin/mysql --defaults-file=' + myconf + ' -uroot -e'
cmd_pass = cmd_pass + '"UPDATE mysql.user SET password=PASSWORD(\'' + pwd + "') WHERE user='root';"
cmd_pass = cmd_pass + 'flush privileges;"'
@@ -1881,9 +1995,17 @@ def setDbSlave(version):
def getMasterStatus(version=''):
if status(version) == 'stop':
return mw.returnJson(False, 'MySQL未启动,或正在启动中...!', [])
query_status_cmd = 'show slave status'
mdb8 = getMdb8Ver()
is_mdb8 = False
if mw.inArray(mdb8, version):
is_mdb8 = True
query_status_cmd = 'show replica status'
try:
if status(version) == 'stop':
return mw.returnJson(False, 'MySQL未启动,或正在启动中...!', [])
conf = getConf()
content = mw.readFile(conf)
@@ -1898,15 +2020,20 @@ def getMasterStatus(version=''):
data['status'] = master_status
db = pMysqlDb()
dlist = db.query('show slave status')
dlist = db.query(query_status_cmd)
# print(dlist[0])
if len(dlist) > 0 and (dlist[0]["Slave_IO_Running"] == 'Yes' or dlist[0]["Slave_SQL_Running"] == 'Yes'):
data['slave_status'] = True
if is_mdb8:
if len(dlist) > 0 and (dlist[0]["Replica_IO_Running"] == 'Yes' or dlist[0]["Replica_SQL_Running"] == 'Yes'):
data['slave_status'] = True
else:
if len(dlist) > 0 and (dlist[0]["Slave_IO_Running"] == 'Yes' or dlist[0]["Slave_SQL_Running"] == 'Yes'):
data['slave_status'] = True
return mw.returnJson(master_status, '设置成功', data)
except Exception as e:
return mw.returnJson(False, "数据库密码错误,在管理列表-点击【修复】!", 'pwd')
mw.getTracebackInfo()
return mw.returnJson(False, "数据库密码错误,在管理列表-点击【修复】,"+str(e), 'pwd')
def setMasterStatus(version=''):
@@ -1979,21 +2106,17 @@ def addMasterRepSlaveUser(version=''):
if not data[0]:
return data[1]
if not 'address' in args:
address = ''
else:
address = ''
if 'address' in args:
address = args['address'].strip()
username = args['username'].strip()
password = args['password'].strip()
# ps = args['ps'].strip()
# address = args['address'].strip()
# dataAccess = args['dataAccess'].strip()
reg = "^[\w-]+$"
if not re.match(reg, username):
return mw.returnJson(False, '用户名不能带有特殊符号!')
checks = ['root', 'mysql', 'test', 'sys', 'panel_logs']
checks = ['root', 'mysql', 'test', 'sys', 'performance_schema','information_schema']
if username in checks or len(username) < 1:
return mw.returnJson(False, '用户名不合法!')
if password in checks or len(password) < 1:
@@ -2005,14 +2128,13 @@ def addMasterRepSlaveUser(version=''):
pdb = pMysqlDb()
psdb = pSqliteDb('master_replication_user')
auth_policy = getAuthPolicy()
if psdb.where("username=?", (username)).count() > 0:
return mw.returnJson(False, '用户已存在!')
if version == "8.0":
mdb8 = ['8.0','8.1','8.2','8.3','8.4']
if mw.inArray(mdb8,version):
sql = "CREATE USER '" + username + \
"' IDENTIFIED WITH "+auth_policy+" BY '" + password + "';"
"' IDENTIFIED WITH mysql_native_password BY '" + password + "';"
pdb.execute(sql)
sql = "grant replication slave on *.* to '" + username + "'@'%';"
result = pdb.execute(sql)
@@ -2028,13 +2150,12 @@ def addMasterRepSlaveUser(version=''):
if isError != None:
return isError
sql_select = "grant select,lock tables,PROCESS on *.* to " + username + "@'%';"
sql_select = "grant select,reload,REPLICATION CLIENT,PROCESS on *.* to " + username + "@'%';"
pdb.execute(sql_select)
pdb.execute('FLUSH PRIVILEGES;')
addTime = time.strftime('%Y-%m-%d %X', time.localtime())
psdb.add('username,password,accept,ps,addtime',
(username, password, '%', '', addTime))
psdb.add('username,password,accept,ps,addtime',(username, password, '%', '', addTime))
return mw.returnJson(True, '添加成功!')
@@ -2071,31 +2192,31 @@ def getMasterRepSlaveUserCmd(version):
sid = getDbServerId()
channel_name = ""
if sid != '':
channel_name = " for channel 'r{}';".format(sid)
channel_name = " for channel 'r{}'".format(sid)
if mode == "gtid":
sql = "CHANGE MASTER TO MASTER_HOST='" + ip + "', MASTER_PORT=" + port + ", MASTER_USER='" + \
clist[0]['username'] + "', MASTER_PASSWORD='" + \
clist[0]['password'] + "', MASTER_AUTO_POSITION=1" + channel_name
if version == '8.0':
sql = "CHANGE REPLICATION SOURCE TO SOURCE_HOST='" + ip + "', SOURCE_PORT=" + port + ", SOURCE_USER='" + \
clist[0]['username'] + "', SOURCE_PASSWORD='" + \
clist[0]['password'] + \
"', MASTER_AUTO_POSITION=1" + channel_name
mdb8 = getMdb8Ver()
sql = ''
if not mw.inArray(mdb8,version):
base_sql = "CHANGE MASTER TO MASTER_HOST='" + ip + "', MASTER_PORT=" + port + ", MASTER_USER='" + \
clist[0]['username'] + "', MASTER_PASSWORD='" + clist[0]['password'] + "'"
sql += base_sql;
sql += "<br/><hr/>";
# sql += base_sql + ", MASTER_AUTO_POSITION=1" + channel_name
sql += base_sql + channel_name
sql += "<br/><hr/>";
sql += base_sql + ", MASTER_LOG_FILE='" + mstatus[0]["File"] + "',MASTER_LOG_POS=" + str(mstatus[0]["Position"]) + channel_name
else:
sql = "CHANGE MASTER TO MASTER_HOST='" + ip + "', MASTER_PORT=" + port + ", MASTER_USER='" + \
clist[0]['username'] + "', MASTER_PASSWORD='" + \
clist[0]['password'] + \
"', MASTER_LOG_FILE='" + mstatus[0]["File"] + \
"',MASTER_LOG_POS=" + str(mstatus[0]["Position"]) + channel_name
base_sql = "CHANGE REPLICATION SOURCE TO SOURCE_HOST='" + ip + "', SOURCE_PORT=" + port + ", SOURCE_USER='" + \
clist[0]['username'] + "', SOURCE_PASSWORD='" + clist[0]['password']+"'"
sql += base_sql;
sql += "<br/><hr/>";
# sql += base_sql + ", MASTER_AUTO_POSITION=1" + channel_name
sql += base_sql + channel_name
sql += "<br/><hr/>";
sql += base_sql + ", SOURCE_LOG_FILE='" + mstatus[0]["File"] + "',SOURCE_LOG_POS=" + str(mstatus[0]["Position"]) + channel_name
if version == "8.0":
sql = "CHANGE REPLICATION SOURCE TO SOURCE_HOST='" + ip + "', SOURCE_PORT=" + port + ", SOURCE_USER='" + \
clist[0]['username'] + "', SOURCE_PASSWORD='" + \
clist[0]['password'] + \
"', SOURCE_LOG_FILE='" + mstatus[0]["File"] + \
"',SOURCE_LOG_POS=" + \
str(mstatus[0]["Position"]) + channel_name
data = {}
data['cmd'] = sql
@@ -2366,8 +2487,16 @@ def updateSlaveSSH(version=''):
def getSlaveList(version=''):
if status(version) == 'stop':
return mw.returnJson(False, 'MySQL未启动', [])
query_status_cmd = 'show slave status'
mdb8 = getMdb8Ver()
if mw.inArray(mdb8, version):
query_status_cmd = 'show replica status'
db = pMysqlDb()
dlist = db.query('show slave status')
dlist = db.query(query_status_cmd)
data = {}
data['data'] = dlist
return mw.getJson(data)
@@ -2659,17 +2788,314 @@ def dumpMysqlData(version=''):
return 'fail'
############### --- 重要 数据补足同步 ---- ###########
def getSyncMysqlDB(dbname,sign = ''):
conn = pSqliteDb('slave_sync_user')
if sign != '':
data = conn.field('ip,port,user,pass,mode,cmd').where('ip=?', (sign,)).find()
else:
data = conn.field('ip,port,user,pass,mode,cmd').find()
user = data['user']
apass = data['pass']
port = data['port']
ip = data['ip']
# 远程数据
sync_db = mw.getMyORM()
# MySQLdb |
sync_db.setPort(port)
sync_db.setHost(ip)
sync_db.setUser(user)
sync_db.setPwd(apass)
sync_db.setDbName(dbname)
sync_db.setTimeout(60)
return sync_db
def syncDatabaseRepairTempFile():
tmp_log = mw.getMWLogs()+ '/mysql-check.log'
return tmp_log
def syncDatabaseRepairLog(version=''):
import subprocess
args = getArgs()
data = checkArgs(args, ['db','sign','op'])
if not data[0]:
return data[1]
sync_args_db = args['db']
sync_args_sign = args['sign']
op = args['op']
tmp_log = syncDatabaseRepairTempFile()
cmd = 'cd '+mw.getServerDir()+'/mdserver-web && source bin/activate && python3 plugins/mysql-yum/index.py sync_database_repair {"db":"'+sync_args_db+'","sign":"'+sync_args_sign+'"}'
# print(cmd)
if op == 'get':
log = mw.getLastLine(tmp_log, 15)
return mw.returnJson(True, log)
if op == 'cmd':
return mw.returnJson(True, 'ok', cmd)
if op == 'do':
os.system(' echo "开始执行" > '+ tmp_log)
os.system(cmd +' >> '+ tmp_log +' &')
return mw.returnJson(True, 'ok')
return mw.returnJson(False, '无效请求!')
def syncDatabaseRepair(version=''):
time_stats_s = time.time()
tmp_log = syncDatabaseRepairTempFile()
from pymysql.converters import escape_string
args = getArgs()
data = checkArgs(args, ['db','sign'])
if not data[0]:
return data[1]
sync_args_db = args['db']
sync_args_sign = args['sign']
# 本地数据
local_db = pMysqlDb()
# 远程数据
sync_db = getSyncMysqlDB(sync_args_db,sync_args_sign)
tables = local_db.query('show tables from `%s`' % sync_args_db)
table_key = "Tables_in_" + sync_args_db
inconsistent_table = []
tmp_dir = '/tmp/sync_db_repair'
mw.execShell('mkdir -p '+tmp_dir)
for tb in tables:
table_name = sync_args_db+'.'+tb[table_key]
table_check_file = tmp_dir+'/'+table_name+'.txt'
if os.path.exists(table_check_file):
# print(table_name+', 已检查OK')
continue
primary_key_sql = "SHOW INDEX FROM "+table_name+" WHERE Key_name = 'PRIMARY';";
primary_key_data = local_db.query(primary_key_sql)
# print(primary_key_sql,primary_key_data)
pkey_name = '*'
if len(primary_key_data) == 1:
pkey_name = primary_key_data[0]['Column_name']
# print(pkey_name)
if pkey_name != '*' :
# 智能校验(由于服务器同步可能会慢,比较总数总是对不上)
cmd_local_newpk_sql = 'select ' + pkey_name + ' from ' + table_name + " order by " + pkey_name + " desc limit 1"
cmd_local_newpk_data = local_db.query(cmd_local_newpk_sql)
# print(cmd_local_newpk_data)
if len(cmd_local_newpk_data) == 1:
# 比较总数
cmd_count_sql = 'select count('+pkey_name+') as num from '+table_name + ' where '+pkey_name + ' <= '+ str(cmd_local_newpk_data[0][pkey_name])
local_count_data = local_db.query(cmd_count_sql)
sync_count_data = sync_db.query(cmd_count_sql)
if local_count_data != sync_count_data:
print(cmd_count_sql)
print("all data compare: ",local_count_data, sync_count_data)
else:
print(table_name+' smart compare check ok.')
mw.writeFile(tmp_log, table_name+' smart compare check ok.\n','a+')
mw.execShell("echo 'ok' > "+table_check_file)
continue
# 比较总数
cmd_count_sql = 'select count('+pkey_name+') as num from '+table_name
local_count_data = local_db.query(cmd_count_sql)
sync_count_data = sync_db.query(cmd_count_sql)
if local_count_data != sync_count_data:
print("all data compare: ",local_count_data, sync_count_data)
inconsistent_table.append(table_name)
diff = sync_count_data[0]['num'] - local_count_data[0]['num']
print(table_name+', need sync. diff,'+str(diff))
mw.writeFile(tmp_log, table_name+', need sync. diff,'+str(diff)+'\n','a+')
else:
print(table_name+' check ok.')
mw.writeFile(tmp_log, table_name+' check ok.\n','a+')
mw.execShell("echo 'ok' > "+table_check_file)
# inconsistent_table = ['xx.xx']
# 数据对齐
for table_name in inconsistent_table:
is_break = False
while not is_break:
local_db.ping()
# 远程数据
sync_db.ping()
print("check table:"+table_name)
mw.writeFile(tmp_log, "check table:"+table_name+'\n','a+')
table_name_pos = 0
table_name_pos_file = tmp_dir+'/'+table_name+'.pos.txt'
primary_key_sql = "SHOW INDEX FROM "+table_name+" WHERE Key_name = 'PRIMARY';";
primary_key_data = local_db.query(primary_key_sql)
pkey_name = primary_key_data[0]['Column_name']
if os.path.exists(table_name_pos_file):
table_name_pos = mw.readFile(table_name_pos_file)
data_select_sql = 'select * from '+table_name + ' where '+pkey_name+' > '+str(table_name_pos)+' limit 10000'
print(data_select_sql)
local_select_data = local_db.query(data_select_sql)
time_s = time.time()
sync_select_data = sync_db.query(data_select_sql)
print(f'sync query cos:{time.time() - time_s:.4f}s')
mw.writeFile(tmp_log, f'sync query cos:{time.time() - time_s:.4f}s\n','a+')
# print(local_select_data)
# print(sync_select_data)
# print(len(local_select_data))
# print(len(sync_select_data))
print('pos:',str(table_name_pos),'local compare sync,',local_select_data == sync_select_data)
cmd_count_sql = 'select count('+pkey_name+') as num from '+table_name
local_count_data = local_db.query(cmd_count_sql)
time_s = time.time()
sync_count_data = sync_db.query(cmd_count_sql)
print(f'sync count data cos:{time.time() - time_s:.4f}s')
print(local_count_data,sync_count_data)
# 数据同步有延迟,相等即任务数据补足完成
if local_count_data[0]['num'] == sync_count_data[0]['num']:
is_break = True
break
diff = sync_count_data[0]['num'] - local_count_data[0]['num']
print("diff," + str(diff)+' line data!')
if local_select_data == sync_select_data:
data_count = len(local_select_data)
if data_count == 0:
# mw.writeFile(table_name_pos_file, '0')
print(table_name+",data is equal ok..")
is_break = True
break
# print(table_name,data_count)
pos = local_select_data[data_count-1][pkey_name]
print('pos',pos)
progress = pos/sync_count_data[0]['num']
print('progress,%.2f' % progress+'%')
mw.writeFile(table_name_pos_file, str(pos))
else:
sync_select_data_len = len(sync_select_data)
skip_idx = 0
# 主库PK -> 查询本地 | 保证一致
if sync_select_data_len > 0:
for idx in range(sync_select_data_len):
sync_idx_data = sync_select_data[idx]
local_idx_data = None
if idx in local_select_data:
local_idx_data = local_select_data[idx]
if sync_select_data[idx] == local_idx_data:
skip_idx = idx
pos = local_select_data[idx][pkey_name]
mw.writeFile(table_name_pos_file, str(pos))
# print(insert_data)
local_inquery_sql = 'select * from ' + table_name+ ' where ' +pkey_name+' = '+ str(sync_idx_data[pkey_name])
# print(local_inquery_sql)
ldata = local_db.query(local_inquery_sql)
# print('ldata:',ldata)
if len(ldata) == 0:
print("id:"+ str(sync_idx_data[pkey_name])+ " no exists, insert")
insert_sql = 'insert into ' + table_name
field_str = ''
value_str = ''
for field in sync_idx_data:
field_str += '`'+field+'`,'
value_str += '\''+escape_string(str(sync_idx_data[field]))+'\','
field_str = '(' +field_str.strip(',')+')'
value_str = '(' +value_str.strip(',')+')'
insert_sql = insert_sql+' '+field_str+' values'+value_str+';'
print(insert_sql)
r = local_db.execute(insert_sql)
print(r)
else:
# print('compare sync->local:',sync_idx_data == ldata[0] )
if ldata[0] == sync_idx_data:
continue
print("id:"+ str(sync_idx_data[pkey_name])+ " data is not equal, update")
update_sql = 'update ' + table_name
field_str = ''
value_str = ''
for field in sync_idx_data:
if field == pkey_name:
continue
field_str += '`'+field+'`=\''+escape_string(str(sync_idx_data[field]))+'\','
field_str = field_str.strip(',')
update_sql = update_sql+' set '+field_str+' where '+pkey_name+'=\''+str(sync_idx_data[pkey_name])+'\';'
print(update_sql)
r = local_db.execute(update_sql)
print(r)
# 本地PK -> 查询主库 | 保证一致
# local_select_data_len = len(local_select_data)
# if local_select_data_len > 0:
# for idx in range(local_select_data_len):
# if idx < skip_idx:
# continue
# local_idx_data = local_select_data[idx]
# print('local idx check', idx, skip_idx)
# local_inquery_sql = 'select * from ' + table_name+ ' where ' +pkey_name+' = '+ str(local_idx_data[pkey_name])
# print(local_inquery_sql)
# sdata = sync_db.query(local_inquery_sql)
# sdata_len = len(sdata)
# print('sdata:',sdata,sdata_len)
# if sdata_len == 0:
# delete_sql = 'delete from ' + table_name + ' where ' +pkey_name+' = '+ str(local_idx_data[pkey_name])
# print(delete_sql)
# r = local_db.execute(delete_sql)
# print(r)
# break
if is_break:
print("break all")
break
time.sleep(3)
print(f'data check cos:{time.time() - time_stats_s:.4f}s')
print("data supplementation completed")
mw.execShell('rm -rf '+tmp_dir)
return 'ok'
############### --- 重要 同步---- ###########
def asyncTmpfile():
path = '/tmp/mysql_yum_async_status.txt'
path = '/tmp/mysql_async_status.txt'
return path
def writeDbSyncStatus(data):
path = asyncTmpfile()
mw.writeFile(path, json.dumps(data))
return True
def fullSyncCmd():
args = getArgs()
data = checkArgs(args, ['db', 'sign'])
if not data[0]:
return data[1]
db = args['db']
sign = args['sign']
cmd = 'cd '+mw.getServerDir()+'/mdserver-web && source bin/activate && python3 plugins/mysql-yum/index.py do_full_sync {"db":"'+db+'","sign":"'+sign+'"}'
return mw.returnJson(True,'ok',cmd)
def doFullSync(version=''):
mode_file = getSyncModeFile()
@@ -2683,7 +3109,51 @@ def doFullSync(version=''):
return doFullSyncUser(version)
def isSimpleSyncCmd(sql):
new_sql = sql.lower()
if new_sql.find('master_auto_position') > 0:
return False
return True
def getChannelNameForCmd(cmd):
cmd = cmd.lower()
cmd_arr = cmd.split('channel')
if len(cmd_arr) == 2:
cmd_channel_info = cmd_arr[1]
channel_name = cmd_channel_info.strip()
channel_name = channel_name.strip(';')
channel_name = channel_name.strip("'")
return channel_name
return ''
def doFullSyncUserImportContentForChannel(file, channel_name):
# print(file, channel_name)
content = mw.readFile(file)
content = content.replace('STOP SLAVE;', "STOP SLAVE for channel '{}';".format(channel_name))
content = content.replace('START SLAVE;', "START SLAVE for channel '{}';".format(channel_name))
find_head = "CHANGE MASTER TO "
find_re = find_head+"(.*?);"
find_r = re.search(find_re, content, re.I|re.M)
if find_r:
find_rg = find_r.groups()
if len(find_rg)>0:
find_str = find_head+find_rg[0]
if find_str.lower().find('channel')==-1:
content = content.replace(find_str+';', find_str+" for channel '{}';".format(channel_name))
mw.writeFile(file,content)
return True
def doFullSyncUser(version=''):
which_pv = mw.execShell('which pv')
is_exist_pv = False
if os.path.exists(which_pv[0]):
is_exist_pv = True
time_all_s = time.time()
args = getArgs()
data = checkArgs(args, ['db', 'sign'])
if not data[0]:
@@ -2715,8 +3185,14 @@ def doFullSyncUser(version=''):
apass = data['pass']
port = data['port']
ip = data['ip']
cmd = data['cmd']
channel_name = getChannelNameForCmd(cmd)
sync_mdb = getSyncMysqlDB(sync_db,sync_sign)
bak_file = '/tmp/tmp.sql'
if os.path.exists(bak_file):
os.system("rm -rf " + bak_file)
writeDbSyncStatus({'code': 0, 'msg': '开始同步...', 'progress': 0})
dmp_option = ''
@@ -2724,29 +3200,86 @@ def doFullSyncUser(version=''):
if mode == 'gtid':
dmp_option = ' --set-gtid-purged=off '
writeDbSyncStatus({'code': 1, 'msg': '远程导出数据...', 'progress': 20})
writeDbSyncStatus({'code': 1, 'msg': '远程导出数据...', 'progress': 15})
mdb8 = getMdb8Ver()
if mw.inArray(mdb8,version):
db.query("stop slave user='{}' password='{}';".format(user, apass))
else:
db.query("stop slave")
time.sleep(1)
writeDbSyncStatus({'code': 2, 'msg': '远程导出数据...', 'progress': 20})
find_run_dump = mw.execShell('ps -ef | grep mysqldump | grep -v grep')
if find_run_dump[0] != "":
print("正在远程导出数据中,别着急...")
writeDbSyncStatus({'code': 3.1, 'msg': '正在远程导出数据中,别着急...', 'progress': 19})
return False
if not os.path.exists(bak_file):
dump_sql_data = getServerDir() + "/bin/usr/bin/mysqldump " + dmp_option + " --force --opt --default-character-set=utf8 --single-transaction -h" + ip + " -P" + \
port + " -u" + user + " -p\"" + apass + \
"\" --ssl-mode=DISABLED " + sync_db + " > " + bak_file
# print(dump_sql_data)
mw.execShell(dump_sql_data)
dmp_option += ' '
if isSimpleSyncCmd(cmd):
if mw.inArray(mdb8,version):
# --compression-algorithms
dmp_option += " --source-data=1 --apply-replica-statements --include-source-host-port "
else:
dmp_option += " --master-data=1 --apply-slave-statements --include-master-host-port --compress "
dump_sql_data = getServerDir() + "/bin/usr/bin/mysqldump --single-transaction --default-character-set=utf8mb4 -q " + dmp_option + " -h" + \
ip + " -P" + port + " -u" + user + ' -p"' + apass + '" --ssl-mode=DISABLED ' + sync_db + " > " + bak_file
print(dump_sql_data)
time_s = time.time()
r = mw.execShell(dump_sql_data)
print(r)
time_e = time.time()
export_cos = time_e - time_s
print("export cos:", export_cos)
writeDbSyncStatus({'code': 3, 'msg': '导出耗时:'+str(int(export_cos))+'秒,正在到本地导入数据中...', 'progress': 40})
find_run_import = mw.execShell('ps -ef | grep mysql| grep '+ bak_file +' | grep -v grep')
if find_run_import[0] != "":
print("正在导入数据中,别着急...")
writeDbSyncStatus({'code': 4.1, 'msg': '正在导入数据中,别着急...', 'progress': 39})
return False
writeDbSyncStatus({'code': 2, 'msg': '本地导入数据...', 'progress': 40})
time_s = time.time()
if os.path.exists(bak_file):
# 重置
db.execute('reset master')
if channel_name != '':
doFullSyncUserImportContentForChannel(bak_file, channel_name)
pwd = pSqliteDb('config').where('id=?', (1,)).getField('mysql_root')
sock = getSocketFile()
if is_exist_pv:
my_import_cmd = getServerDir() + '/bin/usr/bin/mysql -S ' + sock + " -uroot -p'" + pwd + "' " + sync_db_import
my_import_cmd = "pv -t -p " + bak_file + '|' + my_import_cmd
print(my_import_cmd)
os.system(my_import_cmd)
else:
my_import_cmd = getServerDir() + '/bin/usr/bin/mysql -S ' + sock + " -uroot -p'" + pwd + "' " + sync_db_import + ' < ' + bak_file
print(my_import_cmd)
mw.execShell(my_import_cmd)
my_import_cmd = getServerDir() + '/bin/usr/bin/mysql -S ' + sock + ' -uroot -p' + pwd + \
' ' + sync_db_import + ' < ' + bak_file
mw.execShell(my_import_cmd)
if version == '8.0':
db.query("start slave user='{}' password='{}';".format(user, apass))
if mw.inArray(mdb8, version):
db.query("start replica user='{}' password='{}';".format(user, apass))
else:
db.query("start slave")
writeDbSyncStatus({'code': 6, 'msg': '从库重启完成...', 'progress': 100})
db.query("start all slaves")
time_all_e = time.time()
cos = time_all_e - time_all_s
writeDbSyncStatus({'code': 6, 'msg': '总耗时:'+str(int(cos))+'秒,从库重启完成...', 'progress': 100})
if os.path.exists(bak_file):
os.system("rm -rf " + bak_file)
@@ -2928,32 +3461,32 @@ def fullSync(version=''):
def installPreInspection(version):
cmd = "cat /etc/*-release | grep PRETTY_NAME |awk -F = '{print $2}' | awk -F '\"' '{print $2}'| awk '{print $1}'"
sys = mw.execShell(cmd)
sys = mw.execShell(
"cat /etc/*-release | grep PRETTY_NAME |awk -F = '{print $2}' | awk -F '\"' '{print $2}'| awk '{print $1}'")
if sys[1] != '':
return '不支持改系统'
sys_id = mw.execShell(
"cat /etc/*-release | grep VERSION_ID | awk -F = '{print $2}' | awk -F '\"' '{print $2}'")
cmd = "cat /etc/*-release | grep VERSION_ID | awk -F = '{print $2}' | awk -F '\"' '{print $2}'"
sys_id = mw.execShell(cmd)
sysName = sys[0].strip().lower()
sysId = sys_id[0].strip()
if not sysName in ('centos',):
return '仅支持centos'
if not sysName in ['centos','almalinux','rocky','opensuse']:
return '仅支持centos,almalinux,rocky,opensuse'
if (sysName == 'centos' and version == '5.7' and not sysId in('7',)):
return 'mysql5.7 仅支持centos7'
if (sysName == 'centos' and version == '8.0' and not sysId in ('7', '8', '9',)):
mdb8 = getMdb8Ver()
if (sysName == 'centos' and mw.inArray(mdb8, version) and not sysId in ('7', '8', '9',)):
return 'mysql8.0 仅支持centos7,8,9'
return 'ok'
def uninstallPreInspection(version):
stop(version)
try:
stop(version)
except Exception as e:
pass
if mw.isDebugMode():
return 'ok'
@@ -2965,7 +3498,7 @@ def uninstallPreInspection(version):
if __name__ == "__main__":
func = sys.argv[1]
version = "5.6"
version = '5.6'
version_pl = getServerDir() + "/version.pl"
if os.path.exists(version_pl):
version = mw.readFile(version_pl).strip()
@@ -2999,7 +3532,7 @@ if __name__ == "__main__":
elif func == 'conf':
print(getConf())
elif func == 'bin_log':
print(binLog())
print(binLog(version))
elif func == 'binlog_list':
print(binLogList())
elif func == 'clean_bin_log':
@@ -3028,6 +3561,10 @@ if __name__ == "__main__":
print(importDbBackup())
elif func == 'import_db_external':
print(importDbExternal())
elif func == 'import_db_external_progress':
print(importDbExternalProgress())
elif func == 'import_db_external_progress_bar':
print(importDbExternalProgressBar())
elif func == 'delete_db_backup':
print(deleteDbBackup())
elif func == 'get_db_backup_list':
@@ -3134,7 +3671,13 @@ if __name__ == "__main__":
print(fullSync(version))
elif func == 'do_full_sync':
print(doFullSync(version))
elif func == 'full_sync_cmd':
print(fullSyncCmd())
elif func == 'dump_mysql_data':
print(dumpMysqlData(version))
elif func == 'sync_database_repair':
print(syncDatabaseRepair())
elif func == 'sync_database_repair_log':
print(syncDatabaseRepairLog())
else:
print('error')
+2 -2
View File
@@ -5,10 +5,10 @@
"name":"mysql-yum",
"type":"运行环境",
"ps":"一种关系数据库管理系统[centos](极速安装)",
"todo_versions":["5.7","8.0"],
"versions":["5.7","8.0"],
"versions":["5.7","8.0","8.2","8.3", "8.4", "9.0"],
"shell":"install.sh",
"install_pre_inspection":true,
"uninstall_pre_inspection":true,
"checks":"server/mysql-yum",
"path":"server/mysql-yum",
"author":"mysql",
@@ -0,0 +1,63 @@
# It's not recommended to modify this file in-place, because it will be
# overwritten during package upgrades. If you want to customize, the
# best way is to use systemctl edit:
#
# $ systemctl edit mysqld.service
#
# this will create file
#
# /etc/systemd/system/mysqld.service.d/override.conf
#
# which be parsed after the file mysqld.service itself is parsed.
#
# For example, if you want to increase mysql's open-files-limit to 20000
# add following when editing with command above:
#
# [Service]
# LimitNOFILE=20000
#
# Or if you require to execute pre and post scripts in the unit file as root, set
# PermissionsStartOnly=true
#
# For more info about custom unit files, see systemd.unit(5) or
# http://fedoraproject.org/wiki/Systemd#How_do_I_customize_a_unit_file.2F_add_a_custom_unit_file.3F
#
# Don't forget to reload systemd daemon after you change unit configuration:
# root> systemctl --system daemon-reload
[Unit]
Description=MySQL 8.0 database server
After=syslog.target
After=network.target
[Service]
Type=notify
User=mysql
Group=mysql
#ExecStartPre=/usr/libexec/mysql-check-socket
#ExecStartPre=/usr/libexec/mysql-prepare-db-dir %n
# Note: we set --basedir to prevent probes that might trigger SELinux alarms,
# per bug #547485
ExecStart={$SERVER_PATH}/mysql-yum/bin/usr/sbin/mysqld --defaults-file={$SERVER_PATH}/mysql-yum/etc/my.cnf --basedir={$SERVER_PATH}/mysql-yum/bin/usr --user=mysql
#ExecStartPost=/usr/libexec/mysql-check-upgrade
#ExecStopPost=/usr/libexec/mysql-wait-stop
# Give a reasonable amount of time for the server to start up/shut down
TimeoutSec=300
# Place temp files in a secure directory, not /tmp
PrivateTmp=false
Restart=on-failure
RestartPreventExitStatus=1
# Sets open_files_limit
LimitNOFILE = 10000
# Set enviroment variable MYSQLD_PARENT_PID. This is required for SQL restart command.
Environment=MYSQLD_PARENT_PID=1
[Install]
WantedBy=multi-user.target
@@ -0,0 +1,63 @@
# It's not recommended to modify this file in-place, because it will be
# overwritten during package upgrades. If you want to customize, the
# best way is to use systemctl edit:
#
# $ systemctl edit mysqld.service
#
# this will create file
#
# /etc/systemd/system/mysqld.service.d/override.conf
#
# which be parsed after the file mysqld.service itself is parsed.
#
# For example, if you want to increase mysql's open-files-limit to 20000
# add following when editing with command above:
#
# [Service]
# LimitNOFILE=20000
#
# Or if you require to execute pre and post scripts in the unit file as root, set
# PermissionsStartOnly=true
#
# For more info about custom unit files, see systemd.unit(5) or
# http://fedoraproject.org/wiki/Systemd#How_do_I_customize_a_unit_file.2F_add_a_custom_unit_file.3F
#
# Don't forget to reload systemd daemon after you change unit configuration:
# root> systemctl --system daemon-reload
[Unit]
Description=MySQL 8.0 database server
After=syslog.target
After=network.target
[Service]
Type=notify
User=mysql
Group=mysql
#ExecStartPre=/usr/libexec/mysql-check-socket
#ExecStartPre=/usr/libexec/mysql-prepare-db-dir %n
# Note: we set --basedir to prevent probes that might trigger SELinux alarms,
# per bug #547485
ExecStart={$SERVER_PATH}/mysql-yum/bin/usr/sbin/mysqld --defaults-file={$SERVER_PATH}/mysql-yum/etc/my.cnf --basedir={$SERVER_PATH}/mysql-yum/bin/usr --user=mysql
#ExecStartPost=/usr/libexec/mysql-check-upgrade
#ExecStopPost=/usr/libexec/mysql-wait-stop
# Give a reasonable amount of time for the server to start up/shut down
TimeoutSec=300
# Place temp files in a secure directory, not /tmp
PrivateTmp=false
Restart=on-failure
RestartPreventExitStatus=1
# Sets open_files_limit
LimitNOFILE = 10000
# Set enviroment variable MYSQLD_PARENT_PID. This is required for SQL restart command.
Environment=MYSQLD_PARENT_PID=1
[Install]
WantedBy=multi-user.target
@@ -0,0 +1,63 @@
# It's not recommended to modify this file in-place, because it will be
# overwritten during package upgrades. If you want to customize, the
# best way is to use systemctl edit:
#
# $ systemctl edit mysqld.service
#
# this will create file
#
# /etc/systemd/system/mysqld.service.d/override.conf
#
# which be parsed after the file mysqld.service itself is parsed.
#
# For example, if you want to increase mysql's open-files-limit to 20000
# add following when editing with command above:
#
# [Service]
# LimitNOFILE=20000
#
# Or if you require to execute pre and post scripts in the unit file as root, set
# PermissionsStartOnly=true
#
# For more info about custom unit files, see systemd.unit(5) or
# http://fedoraproject.org/wiki/Systemd#How_do_I_customize_a_unit_file.2F_add_a_custom_unit_file.3F
#
# Don't forget to reload systemd daemon after you change unit configuration:
# root> systemctl --system daemon-reload
[Unit]
Description=MySQL 8.0 database server
After=syslog.target
After=network.target
[Service]
Type=notify
User=mysql
Group=mysql
#ExecStartPre=/usr/libexec/mysql-check-socket
#ExecStartPre=/usr/libexec/mysql-prepare-db-dir %n
# Note: we set --basedir to prevent probes that might trigger SELinux alarms,
# per bug #547485
ExecStart={$SERVER_PATH}/mysql-yum/bin/usr/sbin/mysqld --defaults-file={$SERVER_PATH}/mysql-yum/etc/my.cnf --basedir={$SERVER_PATH}/mysql-yum/bin/usr --user=mysql
#ExecStartPost=/usr/libexec/mysql-check-upgrade
#ExecStopPost=/usr/libexec/mysql-wait-stop
# Give a reasonable amount of time for the server to start up/shut down
TimeoutSec=300
# Place temp files in a secure directory, not /tmp
PrivateTmp=false
Restart=on-failure
RestartPreventExitStatus=1
# Sets open_files_limit
LimitNOFILE = 10000
# Set enviroment variable MYSQLD_PARENT_PID. This is required for SQL restart command.
Environment=MYSQLD_PARENT_PID=1
[Install]
WantedBy=multi-user.target
@@ -0,0 +1,63 @@
# It's not recommended to modify this file in-place, because it will be
# overwritten during package upgrades. If you want to customize, the
# best way is to use systemctl edit:
#
# $ systemctl edit mysqld.service
#
# this will create file
#
# /etc/systemd/system/mysqld.service.d/override.conf
#
# which be parsed after the file mysqld.service itself is parsed.
#
# For example, if you want to increase mysql's open-files-limit to 20000
# add following when editing with command above:
#
# [Service]
# LimitNOFILE=20000
#
# Or if you require to execute pre and post scripts in the unit file as root, set
# PermissionsStartOnly=true
#
# For more info about custom unit files, see systemd.unit(5) or
# http://fedoraproject.org/wiki/Systemd#How_do_I_customize_a_unit_file.2F_add_a_custom_unit_file.3F
#
# Don't forget to reload systemd daemon after you change unit configuration:
# root> systemctl --system daemon-reload
[Unit]
Description=MySQL 8.0 database server
After=syslog.target
After=network.target
[Service]
Type=notify
User=mysql
Group=mysql
#ExecStartPre=/usr/libexec/mysql-check-socket
#ExecStartPre=/usr/libexec/mysql-prepare-db-dir %n
# Note: we set --basedir to prevent probes that might trigger SELinux alarms,
# per bug #547485
ExecStart={$SERVER_PATH}/mysql-yum/bin/usr/sbin/mysqld --defaults-file={$SERVER_PATH}/mysql-yum/etc/my.cnf --basedir={$SERVER_PATH}/mysql-yum/bin/usr --user=mysql
#ExecStartPost=/usr/libexec/mysql-check-upgrade
#ExecStopPost=/usr/libexec/mysql-wait-stop
# Give a reasonable amount of time for the server to start up/shut down
TimeoutSec=300
# Place temp files in a secure directory, not /tmp
PrivateTmp=false
Restart=on-failure
RestartPreventExitStatus=1
# Sets open_files_limit
LimitNOFILE = 10000
# Set enviroment variable MYSQLD_PARENT_PID. This is required for SQL restart command.
Environment=MYSQLD_PARENT_PID=1
[Install]
WantedBy=multi-user.target
+9
View File
@@ -11,6 +11,7 @@ serverPath=$(dirname "$rootPath")
# cd /www/server/mdserver-web/plugins/mysql-yum && bash install.sh install 8.0
# cd /www/server/mdserver-web/plugins/mysql-yum && bash install.sh uninstall 8.0
# cd /www/server/mdserver-web && python3 /www/server/mdserver-web/plugins/mysql-yum/index.py start 8.0
# cd /www/server/mdserver-web && python3 /www/server/mdserver-web/plugins/mysql-yum/index.py get_master_status 8.4
install_tmp=${rootPath}/tmp/mw_install.pl
@@ -18,6 +19,14 @@ install_tmp=${rootPath}/tmp/mw_install.pl
action=$1
type=$2
if id mysql &> /dev/null ;then
echo "mysql UID is `id -u mysql`"
echo "mysql Shell is `grep "^mysql:" /etc/passwd |cut -d':' -f7 `"
else
groupadd mysql
useradd -g mysql -s /usr/sbin/nologin mysql
fi
if [ "${2}" == "" ];then
+232 -45
View File
@@ -56,9 +56,10 @@ function myAsyncPost(method,args){
}
var loadT = layer.msg('正在获取...', { icon: 16, time: 0, shade: 0.3 });
return syncPost('/plugins/run', {name:'mysql-yum', func:method, args:_args});
return syncPost('/plugins/run', {name:'mysql', func:method, args:_args});
}
function myPostCallbak(method, version, args,callback){
var loadT = layer.msg('正在获取...', { icon: 16, time: 0, shade: 0.3 });
@@ -115,7 +116,6 @@ function myPostCallbakN(method, version, args,callback){
},'json');
}
function vaildPhpmyadmin(url,username,password){
// console.log("Authorization: Basic " + btoa(username + ":" + password));
$.ajax({
@@ -161,7 +161,7 @@ function runInfo(){
<tr><th>活动/峰值连接数</th><td>' + rdata.Threads_running + '/' + rdata.Max_used_connections + '</td><td colspan="2">若值过大,增加max_connections</td></tr>\
<tr><th>线程缓存命中率</th><td>' + ((1 - rdata.Threads_created / rdata.Connections) * 100).toFixed(2) + '%</td><td colspan="2">若过低,增加thread_cache_size</td></tr>\
<tr><th>索引命中率</th><td>' + ((1 - rdata.Key_reads / rdata.Key_read_requests) * 100).toFixed(2) + '%</td><td colspan="2">若过低,增加key_buffer_size</td></tr>\
<tr><th>Innodb索引命中率</th><td>' + ((1 - rdata.Innodb_buffer_pool_reads / rdata.Innodb_buffer_pool_read_requests) * 100).toFixed(2) + '%</td><td colspan="2">若过低,增加innodb_buffer_pool_size</td></tr>\
<tr><th>Innodb索引命中率</th><td>' + (rdata.Innodb_buffer_pool_read_requests / (rdata.Innodb_buffer_pool_read_requests+rdata.Innodb_buffer_pool_reads)).toFixed(2) + '%</td><td colspan="2">若过低,增加innodb_buffer_pool_size</td></tr>\
<tr><th>查询缓存命中率</th><td>' + cache_size + '</td><td colspan="2">' + lan.soft.mysql_status_ps5 + '</td></tr>\
<tr><th>创建临时表到磁盘</th><td>' + ((rdata.Created_tmp_disk_tables / rdata.Created_tmp_tables) * 100).toFixed(2) + '%</td><td colspan="2">若过大,尝试增加tmp_table_size</td></tr>\
<tr><th>已打开的表</th><td>' + rdata.Open_tables + '</td><td colspan="2">若过大,增加table_cache_size</td></tr>\
@@ -200,7 +200,7 @@ function myPort(){
myPost('my_port','',function(data){
var con = '<div class="line ">\
<div class="info-r ml0">\
<input name="port" class="bt-input-text mr5 port" type="text" style="width:100px" value="'+data.data+'">\
<input name="port" class="bt-input-text mr5 port" type="number" style="width:100px" value="'+data.data+'">\
<button id="btn_change_port" name="btn_change_port" class="btn btn-success btn-sm mr5 ml5 btn_change_port">修改</button>\
</div></div>';
$(".soft-man-con").html(con);
@@ -701,7 +701,7 @@ function setDbPass(id, username, password){
<span title='随机密码' class='glyphicon glyphicon-repeat cursor' onclick='repeatPwd(16)'></span></div>\
</div>\
<input type='hidden' name='id' value='"+id+"'>\
</form>",
</form>",
yes:function(index){
// var data = $("#mod_pwd").serialize();
var data = {};
@@ -795,7 +795,7 @@ function addDatabase(type){
function delDb(id, name){
safeMessage('删除['+name+']','您真的要删除['+name+']吗?',function(){
var data='id='+id+'&name='+name
var data='id='+id+'&name='+name;
myPost('del_db', data, function(data){
var rdata = $.parseJSON(data.data);
showMsg(rdata.msg,function(){
@@ -871,7 +871,7 @@ function openPhpmyadmin(name,username,password){
}
if (rdata.data['cfg']['choose'] != 'mysql-yum'){
layer.msg('当前为['+rdata.choose+']模式,若要使用请修改phpMyAdmin访问切换.',{icon:2,shade: [0.3, '#000']});
layer.msg('当前为['+rdata.data['cfg']['choose'] + ']模式,若要使用请修改phpMyAdmin访问切换.',{icon:2,shade: [0.3, '#000']});
return;
}
var home_page = rdata.data['home_page'];
@@ -929,6 +929,31 @@ function importBackup(file,name){
});
}
function importBackupProgress(file,name){
myPost('import_db_backup_progress',{file:file,name:name}, function(data){
var rdata = $.parseJSON(data.data);
layer.open({
title: "手动导入命令CMD【显示进度】",
area: ['600px', '180px'],
type:1,
closeBtn: 1,
shadeClose: false,
btn:["复制","取消"],
content: '<div class="pd15">\
<div class="divtable">\
<pre class="layui-code">'+rdata.data+'</pre>\
</div>\
</div>',
success:function(){
copyText(rdata.data);
},
yes:function(){
copyText(rdata.data);
}
});
});
}
function importDbExternal(file,name){
myPost('import_db_external',{file:file,name:name}, function(data){
@@ -936,6 +961,31 @@ function importDbExternal(file,name){
});
}
function importDbExternalProgress(file,name){
myPost('import_db_external_progress',{file:file,name:name}, function(data){
var rdata = $.parseJSON(data.data);
layer.open({
title: "手动导入命令CMD【显示进度】",
area: ['600px', '180px'],
type:1,
closeBtn: 1,
shadeClose: false,
btn:["复制","取消"],
content: '<div class="pd15">\
<div class="divtable">\
<pre class="layui-code">'+rdata.data+'</pre>\
</div>\
</div>',
success:function(){
copyText(rdata.data);
},
yes:function(){
copyText(rdata.data);
}
});
});
}
function setLocalImport(db_name){
//上传文件
@@ -991,6 +1041,7 @@ function setLocalImport(db_name){
<td><span> ' + file_list[i]['time'] + '</span></td>\
<td style="text-align: right;">\
<a class="btlink" onclick="importDbExternal(\'' + file_list[i]['name'] + '\',\'' +db_name+ '\')">导入</a> | \
<a class="btlink" onclick="importDbExternalProgress(\'' + file_list[i]['name'] + '\',\'' +db_name+ '\')">导入进度</a> | \
<a class="btlink del" index="'+i+'">删除</a>\
</td>\
</tr>';
@@ -1014,7 +1065,7 @@ function setLocalImport(db_name){
var layerIndex = layer.open({
type: 1,
title: "从文件导入数据",
area: ['600px', '380px'],
area: ['700px', '380px'],
closeBtn: 1,
shadeClose: false,
content: '<div class="pd15">\
@@ -1060,7 +1111,7 @@ function setBackup(db_name){
var layerIndex = layer.open({
type: 1,
title: "数据库备份详情",
area: ['600px', '280px'],
area: ['700px', '280px'],
closeBtn: 1,
shadeClose: false,
content: '<div class="pd15">\
@@ -1114,6 +1165,7 @@ function setBackupReq(db_name, obj){
<td><span> ' + rdata.data[i]['time'] + '</span></td>\
<td style="text-align: right;">\
<a class="btlink" onclick="importBackup(\'' + rdata.data[i]['name'] + '\',\'' +db_name+ '\')">导入</a> | \
<a class="btlink" onclick="importBackupProgress(\'' + rdata.data[i]['name'] + '\',\'' +db_name+ '\')">导入进度</a> | \
<a class="btlink" onclick="downloadBackup(\'' + rdata.data[i]['file'] + '\')">下载</a> | \
<a class="btlink" onclick="delBackup(\'' + rdata.data[i]['name'] + '\',\'' +db_name+ '\')">删除</a>\
</td>\
@@ -1231,6 +1283,7 @@ function dbList(page, search){
});
}
function myBinRollingLogs(_name, func, _args, line){
var file_line = 100;
@@ -1654,7 +1707,7 @@ function addMasterRepSlaveUser(){
function updateMasterRepSlaveUser(username){
function updateMasterRepSlaveUser(username, password){
var index = layer.open({
type: 1,
@@ -1667,7 +1720,7 @@ function updateMasterRepSlaveUser(username){
<div class='line'><span class='tname'>用户名</span><div class='info-r'><input name='username' readonly='readonly' class='bt-input-text mr5' placeholder='用户名' type='text' style='width:330px;' value='"+username+"'></div></div>\
<div class='line'>\
<span class='tname'>密码</span>\
<div class='info-r'><input class='bt-input-text mr5' type='text' name='password' id='MyPassword' style='width:330px' value='"+(randomStrPwd(16))+"' /><span title='随机密码' class='glyphicon glyphicon-repeat cursor' onclick='repeatPwd(16)'></span></div>\
<div class='info-r'><input class='bt-input-text mr5' type='text' name='password' id='MyPassword' style='width:330px' value='"+password+"' /><span title='随机密码' class='glyphicon glyphicon-repeat cursor' onclick='repeatPwd(16)'></span></div>\
</div>\
<input type='hidden' name='ps' value='' />\
<div class='bt-form-submit-btn'>\
@@ -1709,17 +1762,11 @@ function getMasterRepSlaveUserCmd(username, db=''){
area: '500px',
content:"<form class='bt-form pd20 pb70' id='add_master'>\
<div class='line'>"+cmd+"</div>\
<div class='bt-form-submit-btn'>\
<button type='button' class='btn btn-success btn-sm btn-title class-copy-cmd'>复制</button>\
<div class='bt-form-submit-btn' style='text-align:center;'>\
<button type='button' class='btn btn-success btn-sm btn-title'>选择其中一个复制</button>\
</div>\
</form>",
});
copyPass(cmd);
$('.class-copy-cmd').click(function(){
copyPass(cmd);
});
});
}
@@ -1810,6 +1857,7 @@ function setDbMasterAccess(username){
});
}
function resetMaster(){
myPost('reset_master', '', function(data){
var rdata = $.parseJSON(data.data);
@@ -1840,10 +1888,11 @@ function getMasterRepSlaveList(){
for (i in user_list) {
// console.log(i);
var name = user_list[i]['username'];
var password = user_list[i]['password'];
list += '<tr><td>'+name+'</td>\
<td>'+user_list[i]['password']+'</td>\
<td>'+password+'</td>\
<td>\
<a class="btlink" onclick="updateMasterRepSlaveUser(\''+name+'\');">修改</a> | \
<a class="btlink" onclick="updateMasterRepSlaveUser(\''+name+'\',\''+password+'\');">修改</a> | \
<a class="btlink" onclick="delMasterRepSlaveUser(\''+name+'\');">删除</a> | \
<a class="btlink" onclick="setDbMasterAccess(\''+name+'\');">权限</a> | \
<a class="btlink" onclick="getMasterRepSlaveUserCmd(\''+name+'\');">从库同步命令</a>\
@@ -1931,6 +1980,7 @@ function getFullSyncStatus(db){
</div>\
<div class='table_toolbar' style='left:0px;'>\
<span data-status='init' class='sync btn btn-default btn-sm' id='begin_full_sync'>开始</span>\
<span data-status='init' class='btn btn-default btn-sm' id='full_sync_cmd'>手动命令</span>\
</div>\
</div>",
cancel: function(){
@@ -1949,10 +1999,36 @@ function getFullSyncStatus(db){
fullSync(db,sign,0);
}, 1000);
$(this).data('status','starting');
$('#begin_full_sync').text("同步中");
} else {
layer.msg("正在同步中..",{icon:0});
}
});
$('#full_sync_cmd').click(function(){
myPostN('full_sync_cmd', {'db':db,'sign':''}, function(rdata){
var rdata = $.parseJSON(rdata.data);
layer.open({
title: "手动执行命令CMD",
area: ['600px', '180px'],
type:1,
closeBtn: 1,
shadeClose: false,
btn:["复制","取消"],
content: '<div class="pd15">\
<div class="divtable">\
<pre class="layui-code">'+rdata.data+'</pre>\
</div>\
</div>',
success:function(){
copyText(rdata.data);
},
yes:function(){
copyText(rdata.data);
}
});
});
});
}
});
});
@@ -1968,12 +2044,91 @@ function getFullSyncStatus(db){
if (rdata['code']==6 ||rdata['code']<0){
layer.msg(rdata['msg']);
clearInterval(timeId);
$('#begin_full_sync').text("同步结束,再次同步?");
$("#begin_full_sync").attr('data-status','init');
}
});
}
}
function dataSyncVerify(db){
var reqTimer = null;
function requestLogs(layerIndex){
myPostN('sync_database_repair_log', {db:db, sign:'',op:'get'}, function(rdata){
var rdata = $.parseJSON(rdata.data);
if(!rdata.status) {
layer.close(layerIndex);
layer.msg(rdata.msg,{icon:2, time:2000});
clearInterval(reqTimer);
return;
};
if (rdata.msg == ''){
rdata.msg = '暂无数据!';
}
$("#data_verify_log").html(rdata.msg);
//滚动到最低
var ob = document.getElementById('data_verify_log');
ob.scrollTop = ob.scrollHeight;
});
}
layer.open({
type: 1,
title: '同步数据库['+db+']数据校验',
area: '500px',
btn:[ "开始","取消","手动"],
content:"<div class='bt-form'>\
"+'<pre id="data_verify_log" style="overflow: auto; border: 0px none; line-height:23px;padding: 5px; margin: 0px; white-space: pre-wrap; height: 395px; background-color: rgb(51,51,51);color:#f1f1f1;border-radius:0px;font-family:"></pre>'+"\
</div>",
cancel: function(){
if (reqTimer){
clearInterval(reqTimer);
}
},
yes:function(index,layer_index){
myPostN('sync_database_repair_log', {db:db, sign:'',op:'do'}, function(data){});
layer.msg("执行成功");
requestLogs(layer_index);
reqTimer = setInterval(function(){
requestLogs(layer_index);
},3000);
},
success:function(){
},
btn3: function(){
myPostN('sync_database_repair_log', {db:db, sign:'',op:'cmd'}, function(rdata){
var rdata = $.parseJSON(rdata.data);
layer.open({
title: "手动执行命令CMD",
area: ['600px', '180px'],
type:1,
closeBtn: 1,
shadeClose: false,
btn:["复制","取消"],
content: '<div class="pd15">\
<div class="divtable">\
<pre class="layui-code">'+rdata.data+'</pre>\
</div>\
</div>',
success:function(){
copyText(rdata.data);
},
yes:function(){
copyText(rdata.data);
}
});
});
return false;
}
});
}
function addSlaveSSH(ip=''){
myPost('get_slave_ssh_by_ip', {ip:ip}, function(rdata){
@@ -2129,7 +2284,7 @@ function addSlaveSyncUser(ip=''){
var index = layer.open({
type: 1,
area: ['500px','470px'],
area: ['500px','510px'],
title: '同步账户',
closeBtn: 1,
shift: 5,
@@ -2141,7 +2296,16 @@ function addSlaveSyncUser(ip=''){
<div class='line'><span class='tname'>同步账户</span><div class='info-r'><input name='user' class='bt-input-text mr5' type='text' style='width:330px;' value='"+user+"'></div></div>\
<div class='line'><span class='tname'>同步密码</span><div class='info-r'><input name='pass' class='bt-input-text mr5' type='text' style='width:330px;' value='"+pass+"'></div></div>\
<div class='line'>\
<span class='tname'>CMD[必须填写]</span>\
<span class='tname'>同步模式</span>\
<div class='info-r'>\
<select class='bt-input-text mr5' name='mode'>\
<option value='0' "+( mode == '0' ? 'selected="selected"' : '')+">经典</option>\
<option value='1' "+( mode == '1' ? 'selected="selected"' : '')+">GTID</option>\
</select>\
</div>\
</div>\
<div class='line'>\
<span class='tname'>CMD[必填]</span>\
<div class='info-r'><textarea class='bt-input-text mr5' row='20' cols='30' name='cmd' style='width:330px;height:150px;'></textarea></div>\
</div>\
<input type='hidden' name='mode' value='"+mode+"' />\
@@ -2150,6 +2314,7 @@ function addSlaveSyncUser(ip=''){
$('textarea[name="cmd"]').html(cmd);
$('textarea[name="cmd"]').change(function(){
var val = $(this).val();
val = val.replace(';','');
var a = {};
if (val.toLowerCase().indexOf('for')>0){
cmd_tmp = val.split('for');
@@ -2172,14 +2337,16 @@ function addSlaveSyncUser(ip=''){
a[kv[0]] = kv[1].replace("'",'').replace("'",'');
}
$('input[name="ip"]').val(a['MASTER_HOST']);
$('input[name="port"]').val(a['MASTER_PORT']);
$('input[name="user"]').val(a['MASTER_USER']);
$('input[name="pass"]').val(a['MASTER_PASSWORD']);
console.log(a['MASTER_AUTO_POSITION'],typeof(a['MASTER_AUTO_POSITION']));
if (typeof(a['MASTER_AUTO_POSITION']) != 'undefined' ){
$('input[name="mode"]').val('1');
if ('MASTER_HOST' in a){
$('input[name="ip"]').val(a['MASTER_HOST']);
$('input[name="port"]').val(a['MASTER_PORT']);
$('input[name="user"]').val(a['MASTER_USER']);
$('input[name="pass"]').val(a['MASTER_PASSWORD']);
} else {
$('input[name="ip"]').val(a['SOURCE_HOST']);
$('input[name="port"]').val(a['SOURCE_PORT']);
$('input[name="user"]').val(a['SOURCE_USER']);
$('input[name="pass"]').val(a['SOURCE_PASSWORD']);
}
});
},
@@ -2189,7 +2356,7 @@ function addSlaveSyncUser(ip=''){
var user = $('input[name="user"]').val();
var pass = $('input[name="pass"]').val();
var cmd = $('textarea[name="cmd"]').val();
var mode = $('input[name="mode"]').val();
var mode = $('select[name="mode"]').val();
var data = {ip:ip,port:port,cmd:cmd,user:user,pass:pass,mode:mode};
myPost('add_slave_sync_user', data, function(ret_data){
@@ -2459,6 +2626,8 @@ function masterOrSlaveConf(version=''){
_data['page'] = page;
_data['page_size'] = 10;
var mdb_ver = $('.plugin_version').attr('version');
myPost('get_slave_list', _data, function(data){
var rdata = $.parseJSON(data.data);
var list = '';
@@ -2467,22 +2636,38 @@ function masterOrSlaveConf(version=''){
for(i in rdata.data){
var v = rdata.data[i];
if ('Channel_Name' in v){
if ('Channel_Name' in v && v['Channel_Name'] !=''){
isHasSign = true;
}
var status = "<a data-id="+i+" class='btlink db_error'>异常</>";
if (v['Slave_SQL_Running'] == 'Yes' && v['Slave_IO_Running'] == 'Yes'){
status = "正常";
}
if (mdb_ver >= 8){
if (v['Replica_SQL_Running'] == 'Yes' && v['Replica_IO_Running'] == 'Yes'){
status = "正常";
}
list += '<tr>';
list += '<td>' + rdata.data[i]['Master_Host'] +'</td>';
list += '<td>' + rdata.data[i]['Master_Port'] +'</td>';
list += '<td>' + rdata.data[i]['Master_User'] +'</td>';
list += '<td>' + rdata.data[i]['Master_Log_File'] +'</td>';
list += '<td>' + rdata.data[i]['Slave_IO_Running'] +'</td>';
list += '<td>' + rdata.data[i]['Slave_SQL_Running'] +'</td>';
list += '<tr>';
list += '<td>' + rdata.data[i]['Source_Host'] +'</td>';
list += '<td>' + rdata.data[i]['Source_Port'] +'</td>';
list += '<td>' + rdata.data[i]['Source_User'] +'</td>';
list += '<td>' + rdata.data[i]['Relay_Source_Log_File'] +'</td>';
list += '<td>' + rdata.data[i]['Replica_IO_Running'] +'</td>';
list += '<td>' + rdata.data[i]['Replica_SQL_Running'] +'</td>';
} else {
if (v['Slave_SQL_Running'] == 'Yes' && v['Slave_IO_Running'] == 'Yes'){
status = "正常";
}
list += '<tr>';
list += '<td>' + rdata.data[i]['Master_Host'] +'</td>';
list += '<td>' + rdata.data[i]['Master_Port'] +'</td>';
list += '<td>' + rdata.data[i]['Master_User'] +'</td>';
list += '<td>' + rdata.data[i]['Master_Log_File'] +'</td>';
list += '<td>' + rdata.data[i]['Slave_IO_Running'] +'</td>';
list += '<td>' + rdata.data[i]['Slave_SQL_Running'] +'</td>';
}
if (isHasSign){
list += '<td>' + v['Channel_Name'] +'</td>';
@@ -2554,6 +2739,7 @@ function masterOrSlaveConf(version=''){
<td>"+(info['Slave_SQL_Running_State'] == '' ? '无':info['Slave_SQL_Running_State']) +"</td>\
</tr>";
var btn_list = ['复制错误',"取消"];
if (info['Last_IO_Error'].search(/1236/i)>0){
btn_list = ['复制错误',"取消","尝试修复"];
@@ -2637,7 +2823,8 @@ function masterOrSlaveConf(version=''){
list += '<td>' + rdata.data[i]['name'] +'</td>';
list += '<td style="text-align:right">' +
'<a href="javascript:;" class="btlink" onclick="setDbSlave(\''+rdata.data[i]['name']+'\')" title="加入|退出">'+(rdata.data[i]['slave']?'退出':'加入')+'</a> | ' +
'<a href="javascript:;" class="btlink" onclick="getFullSyncStatus(\''+rdata.data[i]['name']+'\')" title="同步">同步</a>' +
'<a href="javascript:;" class="btlink" onclick="getFullSyncStatus(\''+rdata.data[i]['name']+'\')" title="同步">同步</a> | ' +
'<a href="javascript:;" class="btlink" onclick="dataSyncVerify(\''+rdata.data[i]['name']+'\')" title="数据校验">数据校验</a>' +
'</td>';
list += '</tr>';
}
@@ -2685,7 +2872,7 @@ function masterOrSlaveConf(version=''){
<p class="conf_p">\
<span class="f14 c6 mr20">Master[主]配置</span><span class="f14 c6 mr20"></span>\
<button class="btn '+(!rdata.status ? 'btn-danger' : 'btn-success')+' btn-xs btn-master">'+(!rdata.status ? '未开启' : '已开启') +'</button>\
<button class="btn btn-success btn-xs" onclick="resetMaster()" >重置</button>\
<button class="btn btn-success btn-xs" onclick="resetMaster()">重置</button>\
</p>\
<hr/>\
<!-- master list -->\
+1 -1
View File
@@ -65,7 +65,7 @@ class backupTools:
if len(content) > 100:
mw.writeFile(my_cnf, content)
cmd = db_path + "/bin/usr/bin/mysqldump --defaults-file=" + my_cnf + " --single-transaction -q --default-character-set=utf8 " + \
cmd = db_path + "/bin/usr/bin/mysqldump --defaults-file=" + my_cnf + " --single-transaction -q --default-character-set=utf8mb4 " + \
name + " | gzip > " + filename
mw.execShell(cmd)
+44 -14
View File
@@ -39,16 +39,19 @@ if [ "$OSNAME" == "centos" ];then
OS_SIGN=1.el${VERSION_ID}
elif [ "$OSNAME" == "fedora" ]; then
OS_SIGN=10.fc${VERSION_ID}
elif [ "$OSNAME" == "suse" ]; then
OS_SIGN=1.sl${VERSION_ID}
elif [ "$OSNAME" == "opensuse" ]; then
OS_SIGN=1.sl${VERSION_ID:0:2}
fi
MYSQL_VER=5.7.39
MYSQL_VER=5.7.44
SUFFIX_NAME=${MYSQL_VER}-${OS_SIGN}.${ARCH}
YUM_INSTALL()
{
mkdir -p /var/run/mysqld
chown mysql -R /var/run/mysqld
#######
mkdir -p $myDir
@@ -71,6 +74,38 @@ rpm2cpio ${myDir}/mysql-community-test-${SUFFIX_NAME}.rpm | cpio -div
#######
}
ZYPPER_INSTALL()
{
zypper install -y libstdc++6
mkdir -p /var/run/mysqld
chown mysql -R /var/run/mysqld
#######
mkdir -p $myDir
wget --no-check-certificate -O $myDir/mysql-${SUFFIX_NAME}.rpm-bundle.tar https://cdn.mysql.com/archives/mysql-5.7/mysql-${SUFFIX_NAME}.rpm-bundle.tar
echo "wget --no-check-certificate -O $myDir/mysql-${SUFFIX_NAME}.rpm-bundle.tar https://cdn.mysql.com/archives/mysql-5.7/mysql-${SUFFIX_NAME}.rpm-bundle.tar"
cd ${myDir} && tar vxf mysql-${SUFFIX_NAME}.rpm-bundle.tar
mkdir -p ${serverPath}/mysql-yum/bin && cd ${serverPath}/mysql-yum/bin
rpm2cpio ${myDir}/mysql-community-client-${SUFFIX_NAME}.rpm | cpio -div
rpm2cpio ${myDir}/mysql-community-client-${SUFFIX_NAME}.x86_64.rpm | cpio -div
rpm2cpio ${myDir}/mysql-community-common-${SUFFIX_NAME}.rpm | cpio -div
rpm2cpio ${myDir}/mysql-community-debuginfo-${SUFFIX_NAME}.rpm | cpio -div
rpm2cpio ${myDir}/mysql-community-devel-${SUFFIX_NAME}.rpm | cpio -div
rpm2cpio ${myDir}/mysql-community-embedded-compat-${SUFFIX_NAME}.rpm | cpio -div
rpm2cpio ${myDir}/mysql-community-icu-data-files-${SUFFIX_NAME}.rpm | cpio -div
rpm2cpio ${myDir}/mysql-community-libs-${SUFFIX_NAME}.rpm | cpio -div
rpm2cpio ${myDir}/mysql-community-libs-compat-${SUFFIX_NAME}.rpm | cpio -div
rpm2cpio ${myDir}/mysql-community-server-${SUFFIX_NAME}.rpm | cpio -div
rpm2cpio ${myDir}/mysql-community-server-debug-${SUFFIX_NAME}.rpm | cpio -div
rpm2cpio ${myDir}/mysql-community-test-${SUFFIX_NAME}.rpm | cpio -div
#######
}
YUM_UNINSTALL()
{
### YUM卸载 START ########
@@ -84,13 +119,6 @@ Install_mysql()
{
echo '正在安装脚本文件...' > $install_tmp
if id mysql &> /dev/null ;then
echo "mysql uid is `id -u mysql`"
echo "mysql shell is `grep "^mysql:" /etc/passwd |cut -d':' -f7 `"
else
groupadd mysql
useradd -g mysql mysql
fi
mkdir -p $serverPath/mysql-yum
@@ -98,6 +126,11 @@ Install_mysql()
if [ "$isYum" != "" ];then
YUM_INSTALL
fi
isZypper=`which zypper`
if [ "$isZypper" != "" ];then
ZYPPER_INSTALL
fi
rm -rf $myDir
echo '5.7' > $serverPath/mysql-yum/version.pl
@@ -106,10 +139,7 @@ Install_mysql()
Uninstall_mysql()
{
isYum=`which yum`
if [ "$isYum" != "" ];then
YUM_UNINSTALL
fi
YUM_UNINSTALL
rm -rf $serverPath/mysql-yum
echo '卸载完成' > $install_tmp
}
+44 -14
View File
@@ -35,16 +35,18 @@ if [ "$OSNAME" == "centos" ];then
OS_SIGN=1.el${VERSION_ID}
elif [ "$OSNAME" == "fedora" ]; then
OS_SIGN=10.fc${VERSION_ID}
elif [ "$OSNAME" == "suse" ]; then
OS_SIGN=1.sl${VERSION_ID}
elif [ "$OSNAME" == "opensuse" ]; then
OS_SIGN=1.sl${VERSION_ID:0:2}
fi
MYSQL_VER=8.0.30
MYSQL_VER=8.0.37
SUFFIX_NAME=${MYSQL_VER}-${OS_SIGN}.${ARCH}
YUM_INSTALL()
{
mkdir -p /var/run/mysqld
chown mysql -R /var/run/mysqld
#######
mkdir -p $myDir
@@ -69,6 +71,37 @@ rpm2cpio ${myDir}/mysql-community-test-${SUFFIX_NAME}.rpm | cpio -div
#######
}
ZYPPER_INSTALL()
{
zypper install -y libstdc++6
mkdir -p /var/run/mysqld
chown mysql -R /var/run/mysqld
#######
mkdir -p $myDir
wget --no-check-certificate -O $myDir/mysql-${SUFFIX_NAME}.rpm-bundle.tar https://cdn.mysql.com/archives/mysql-8.0/mysql-${SUFFIX_NAME}.rpm-bundle.tar
cd ${myDir} && tar vxf mysql-${SUFFIX_NAME}.rpm-bundle.tar
echo "wget --no-check-certificate -O $myDir/mysql-${SUFFIX_NAME}.rpm-bundle.tar https://cdn.mysql.com/archives/mysql-8.0/mysql-${SUFFIX_NAME}.rpm-bundle.tar"
mkdir -p ${serverPath}/mysql-yum/bin && cd ${serverPath}/mysql-yum/bin
rpm2cpio ${myDir}/mysql-community-client-${SUFFIX_NAME}.rpm | cpio -div
rpm2cpio ${myDir}/mysql-community-client-${SUFFIX_NAME}.x86_64.rpm | cpio -div
rpm2cpio ${myDir}/mysql-community-common-${SUFFIX_NAME}.rpm | cpio -div
rpm2cpio ${myDir}/mysql-community-debuginfo-${SUFFIX_NAME}.rpm | cpio -div
rpm2cpio ${myDir}/mysql-community-devel-${SUFFIX_NAME}.rpm | cpio -div
rpm2cpio ${myDir}/mysql-community-embedded-compat-${SUFFIX_NAME}.rpm | cpio -div
rpm2cpio ${myDir}/mysql-community-icu-data-files-${SUFFIX_NAME}.rpm | cpio -div
rpm2cpio ${myDir}/mysql-community-libs-${SUFFIX_NAME}.rpm | cpio -div
rpm2cpio ${myDir}/mysql-community-libs-compat-${SUFFIX_NAME}.rpm | cpio -div
rpm2cpio ${myDir}/mysql-community-server-${SUFFIX_NAME}.rpm | cpio -div
rpm2cpio ${myDir}/mysql-community-server-debug-${SUFFIX_NAME}.rpm | cpio -div
rpm2cpio ${myDir}/mysql-community-test-${SUFFIX_NAME}.rpm | cpio -div
#######
}
YUM_UNINSTALL()
{
### YUM卸载 START ########
@@ -82,21 +115,21 @@ Install_mysql()
{
echo '正在安装脚本文件...' > $install_tmp
if id mysql &> /dev/null ;then
echo "mysql uid is `id -u mysql`"
echo "mysql shell is `grep "^mysql:" /etc/passwd |cut -d':' -f7 `"
else
groupadd mysql
useradd -g mysql mysql
fi
mkdir -p $serverPath/mysql-yum
mkdir -p /var/run/mysqld
chown mysql -R /var/run/mysqld
isYum=`which yum`
if [ "$isYum" != "" ];then
YUM_INSTALL
fi
isZypper=`which zypper`
if [ "$isZypper" != "" ];then
ZYPPER_INSTALL
fi
rm -rf $myDir
echo '8.0' > $serverPath/mysql-yum/version.pl
@@ -105,10 +138,7 @@ Install_mysql()
Uninstall_mysql()
{
isYum=`which yum`
if [ "$isYum" != "" ];then
YUM_UNINSTALL
fi
YUM_UNINSTALL
rm -rf $serverPath/mysql-yum
echo '卸载完成'
}
+153
View File
@@ -0,0 +1,153 @@
# -*- coding: utf-8 -*-
#!/bin/bash
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
export PATH
# https://downloads.mysql.com/archives/community/
curPath=`pwd`
rootPath=$(dirname "$curPath")
rootPath=$(dirname "$rootPath")
serverPath=$(dirname "$rootPath")
sysName=`uname`
install_tmp=${rootPath}/tmp/mw_install.pl
myDir=${serverPath}/source/mysql-yum
ARCH=`uname -m`
ARCH_NAME=''
case $(uname -m) in
i386) ARCH_NAME="386" ;;
i686) ARCH_NAME="386" ;;
x86_64) ARCH_NAME="amd64" ;;
arm) ARCH_NAME="arm64" ;;
esac
bash ${rootPath}/scripts/getos.sh
OSNAME=`cat ${rootPath}/data/osname.pl`
VERSION_ID=`cat /etc/*-release | grep VERSION_ID | awk -F = '{print $2}' | awk -F "\"" '{print $2}'`
echo "VERSION_ID:${VERSION_ID}"
OS_SIGN=1.el9
if [ "$OSNAME" == "centos" ];then
OS_SIGN=1.el${VERSION_ID}
elif [ "$OSNAME" == "fedora" ]; then
OS_SIGN=10.fc${VERSION_ID}
elif [ "$OSNAME" == "opensuse" ]; then
OS_SIGN=1.sl${VERSION_ID:0:2}
fi
MYSQL_VER=8.2.0
SUFFIX_NAME=${MYSQL_VER}-${OS_SIGN}.${ARCH}
YUM_INSTALL()
{
mkdir -p /var/run/mysqld
chown mysql -R /var/run/mysqld
#######
mkdir -p $myDir
wget --no-check-certificate -O $myDir/mysql-${SUFFIX_NAME}.rpm-bundle.tar https://cdn.mysql.com/archives/mysql-8.2/mysql-${SUFFIX_NAME}.rpm-bundle.tar
cd ${myDir} && tar vxf mysql-${SUFFIX_NAME}.rpm-bundle.tar
mkdir -p ${serverPath}/mysql-yum/bin && cd ${serverPath}/mysql-yum/bin
rpm2cpio ${myDir}/mysql-community-client-${SUFFIX_NAME}.rpm | cpio -div
rpm2cpio ${myDir}/mysql-community-client-${SUFFIX_NAME}.x86_64.rpm | cpio -div
rpm2cpio ${myDir}/mysql-community-common-${SUFFIX_NAME}.rpm | cpio -div
rpm2cpio ${myDir}/mysql-community-debuginfo-${SUFFIX_NAME}.rpm | cpio -div
rpm2cpio ${myDir}/mysql-community-devel-${SUFFIX_NAME}.rpm | cpio -div
rpm2cpio ${myDir}/mysql-community-embedded-compat-${SUFFIX_NAME}.rpm | cpio -div
rpm2cpio ${myDir}/mysql-community-icu-data-files-${SUFFIX_NAME}.rpm | cpio -div
rpm2cpio ${myDir}/mysql-community-libs-${SUFFIX_NAME}.rpm | cpio -div
rpm2cpio ${myDir}/mysql-community-libs-compat-${SUFFIX_NAME}.rpm | cpio -div
rpm2cpio ${myDir}/mysql-community-server-${SUFFIX_NAME}.rpm | cpio -div
rpm2cpio ${myDir}/mysql-community-server-debug-${SUFFIX_NAME}.rpm | cpio -div
rpm2cpio ${myDir}/mysql-community-test-${SUFFIX_NAME}.rpm | cpio -div
#######
}
ZYPPER_INSTALL()
{
zypper install -y libstdc++6
mkdir -p /var/run/mysqld
chown mysql -R /var/run/mysqld
#######
mkdir -p $myDir
wget --no-check-certificate -O $myDir/mysql-${SUFFIX_NAME}.rpm-bundle.tar https://cdn.mysql.com/archives/mysql-8.2/mysql-${SUFFIX_NAME}.rpm-bundle.tar
echo "wget --no-check-certificate -O $myDir/mysql-${SUFFIX_NAME}.rpm-bundle.tar https://cdn.mysql.com/archives/mysql-8.2/mysql-${SUFFIX_NAME}.rpm-bundle.tar"
cd ${myDir} && tar vxf mysql-${SUFFIX_NAME}.rpm-bundle.tar
mkdir -p ${serverPath}/mysql-yum/bin && cd ${serverPath}/mysql-yum/bin
rpm2cpio ${myDir}/mysql-community-client-${SUFFIX_NAME}.rpm | cpio -div
rpm2cpio ${myDir}/mysql-community-client-${SUFFIX_NAME}.x86_64.rpm | cpio -div
rpm2cpio ${myDir}/mysql-community-common-${SUFFIX_NAME}.rpm | cpio -div
rpm2cpio ${myDir}/mysql-community-debuginfo-${SUFFIX_NAME}.rpm | cpio -div
rpm2cpio ${myDir}/mysql-community-devel-${SUFFIX_NAME}.rpm | cpio -div
rpm2cpio ${myDir}/mysql-community-embedded-compat-${SUFFIX_NAME}.rpm | cpio -div
rpm2cpio ${myDir}/mysql-community-icu-data-files-${SUFFIX_NAME}.rpm | cpio -div
rpm2cpio ${myDir}/mysql-community-libs-${SUFFIX_NAME}.rpm | cpio -div
rpm2cpio ${myDir}/mysql-community-libs-compat-${SUFFIX_NAME}.rpm | cpio -div
rpm2cpio ${myDir}/mysql-community-server-${SUFFIX_NAME}.rpm | cpio -div
rpm2cpio ${myDir}/mysql-community-server-debug-${SUFFIX_NAME}.rpm | cpio -div
rpm2cpio ${myDir}/mysql-community-test-${SUFFIX_NAME}.rpm | cpio -div
#######
}
YUM_UNINSTALL()
{
### YUM卸载 START ########
# yum -y remove mysql-server
rm -rf ${myDir}
### YUM卸载 END ########
}
Install_mysql()
{
echo '正在安装脚本文件...' > $install_tmp
mkdir -p $serverPath/mysql-yum
mkdir -p /var/lib/mysql
chown mysql -R /var/lib/mysql
isYum=`which yum`
if [ "$isYum" != "" ];then
YUM_INSTALL
fi
isZypper=`which zypper`
if [ "$isZypper" != "" ];then
ZYPPER_INSTALL
fi
rm -rf $myDir
echo '8.2' > $serverPath/mysql-yum/version.pl
echo '安装完成'
}
Uninstall_mysql()
{
YUM_UNINSTALL
rm -rf $serverPath/mysql-yum
echo '卸载完成'
}
action=$1
if [ "${1}" == 'install' ];then
Install_mysql
else
Uninstall_mysql
fi
+153
View File
@@ -0,0 +1,153 @@
# -*- coding: utf-8 -*-
#!/bin/bash
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
export PATH
# https://downloads.mysql.com/archives/community/
curPath=`pwd`
rootPath=$(dirname "$curPath")
rootPath=$(dirname "$rootPath")
serverPath=$(dirname "$rootPath")
sysName=`uname`
install_tmp=${rootPath}/tmp/mw_install.pl
myDir=${serverPath}/source/mysql-yum
ARCH=`uname -m`
ARCH_NAME=''
case $(uname -m) in
i386) ARCH_NAME="386" ;;
i686) ARCH_NAME="386" ;;
x86_64) ARCH_NAME="amd64" ;;
arm) ARCH_NAME="arm64" ;;
esac
bash ${rootPath}/scripts/getos.sh
OSNAME=`cat ${rootPath}/data/osname.pl`
VERSION_ID=`cat /etc/*-release | grep VERSION_ID | awk -F = '{print $2}' | awk -F "\"" '{print $2}'`
echo "VERSION_ID:${VERSION_ID}"
OS_SIGN=1.el9
if [ "$OSNAME" == "centos" ];then
OS_SIGN=1.el${VERSION_ID}
elif [ "$OSNAME" == "fedora" ]; then
OS_SIGN=10.fc${VERSION_ID}
elif [ "$OSNAME" == "opensuse" ]; then
OS_SIGN=1.sl${VERSION_ID:0:2}
fi
MYSQL_VER=8.3.0
SUFFIX_NAME=${MYSQL_VER}-${OS_SIGN}.${ARCH}
YUM_INSTALL()
{
mkdir -p /var/run/mysqld
chown mysql -R /var/run/mysqld
#######
mkdir -p $myDir
wget --no-check-certificate -O $myDir/mysql-${SUFFIX_NAME}.rpm-bundle.tar https://cdn.mysql.com/archives/mysql-8.3/mysql-${SUFFIX_NAME}.rpm-bundle.tar
cd ${myDir} && tar vxf mysql-${SUFFIX_NAME}.rpm-bundle.tar
mkdir -p ${serverPath}/mysql-yum/bin && cd ${serverPath}/mysql-yum/bin
rpm2cpio ${myDir}/mysql-community-client-${SUFFIX_NAME}.rpm | cpio -div
rpm2cpio ${myDir}/mysql-community-client-${SUFFIX_NAME}.x86_64.rpm | cpio -div
rpm2cpio ${myDir}/mysql-community-common-${SUFFIX_NAME}.rpm | cpio -div
rpm2cpio ${myDir}/mysql-community-debuginfo-${SUFFIX_NAME}.rpm | cpio -div
rpm2cpio ${myDir}/mysql-community-devel-${SUFFIX_NAME}.rpm | cpio -div
rpm2cpio ${myDir}/mysql-community-embedded-compat-${SUFFIX_NAME}.rpm | cpio -div
rpm2cpio ${myDir}/mysql-community-icu-data-files-${SUFFIX_NAME}.rpm | cpio -div
rpm2cpio ${myDir}/mysql-community-libs-${SUFFIX_NAME}.rpm | cpio -div
rpm2cpio ${myDir}/mysql-community-libs-compat-${SUFFIX_NAME}.rpm | cpio -div
rpm2cpio ${myDir}/mysql-community-server-${SUFFIX_NAME}.rpm | cpio -div
rpm2cpio ${myDir}/mysql-community-server-debug-${SUFFIX_NAME}.rpm | cpio -div
rpm2cpio ${myDir}/mysql-community-test-${SUFFIX_NAME}.rpm | cpio -div
#######
}
ZYPPER_INSTALL()
{
zypper install -y libstdc++6
mkdir -p /var/run/mysqld
chown mysql -R /var/run/mysqld
#######
mkdir -p $myDir
wget --no-check-certificate -O $myDir/mysql-${SUFFIX_NAME}.rpm-bundle.tar https://cdn.mysql.com/archives/mysql-8.3/mysql-${SUFFIX_NAME}.rpm-bundle.tar
echo "wget --no-check-certificate -O $myDir/mysql-${SUFFIX_NAME}.rpm-bundle.tar https://cdn.mysql.com/archives/mysql-8.3/mysql-${SUFFIX_NAME}.rpm-bundle.tar"
cd ${myDir} && tar vxf mysql-${SUFFIX_NAME}.rpm-bundle.tar
mkdir -p ${serverPath}/mysql-yum/bin && cd ${serverPath}/mysql-yum/bin
rpm2cpio ${myDir}/mysql-community-client-${SUFFIX_NAME}.rpm | cpio -div
rpm2cpio ${myDir}/mysql-community-client-${SUFFIX_NAME}.x86_64.rpm | cpio -div
rpm2cpio ${myDir}/mysql-community-common-${SUFFIX_NAME}.rpm | cpio -div
rpm2cpio ${myDir}/mysql-community-debuginfo-${SUFFIX_NAME}.rpm | cpio -div
rpm2cpio ${myDir}/mysql-community-devel-${SUFFIX_NAME}.rpm | cpio -div
rpm2cpio ${myDir}/mysql-community-embedded-compat-${SUFFIX_NAME}.rpm | cpio -div
rpm2cpio ${myDir}/mysql-community-icu-data-files-${SUFFIX_NAME}.rpm | cpio -div
rpm2cpio ${myDir}/mysql-community-libs-${SUFFIX_NAME}.rpm | cpio -div
rpm2cpio ${myDir}/mysql-community-libs-compat-${SUFFIX_NAME}.rpm | cpio -div
rpm2cpio ${myDir}/mysql-community-server-${SUFFIX_NAME}.rpm | cpio -div
rpm2cpio ${myDir}/mysql-community-server-debug-${SUFFIX_NAME}.rpm | cpio -div
rpm2cpio ${myDir}/mysql-community-test-${SUFFIX_NAME}.rpm | cpio -div
#######
}
YUM_UNINSTALL()
{
### YUM卸载 START ########
# yum -y remove mysql-server
rm -rf ${myDir}
### YUM卸载 END ########
}
Install_mysql()
{
echo '正在安装脚本文件...' > $install_tmp
mkdir -p $serverPath/mysql-yum
mkdir -p /var/lib/mysql
chown mysql -R /var/lib/mysql
isYum=`which yum`
if [ "$isYum" != "" ];then
YUM_INSTALL
fi
isZypper=`which zypper`
if [ "$isZypper" != "" ];then
ZYPPER_INSTALL
fi
rm -rf $myDir
echo '8.3' > $serverPath/mysql-yum/version.pl
echo '安装完成'
}
Uninstall_mysql()
{
YUM_UNINSTALL
rm -rf $serverPath/mysql-yum
echo '卸载完成'
}
action=$1
if [ "${1}" == 'install' ];then
Install_mysql
else
Uninstall_mysql
fi
+155
View File
@@ -0,0 +1,155 @@
# -*- coding: utf-8 -*-
#!/bin/bash
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
export PATH
# https://downloads.mysql.com/archives/community/
curPath=`pwd`
rootPath=$(dirname "$curPath")
rootPath=$(dirname "$rootPath")
serverPath=$(dirname "$rootPath")
sysName=`uname`
install_tmp=${rootPath}/tmp/mw_install.pl
myDir=${serverPath}/source/mysql-yum
ARCH=`uname -m`
ARCH_NAME=''
case $(uname -m) in
i386) ARCH_NAME="386" ;;
i686) ARCH_NAME="386" ;;
x86_64) ARCH_NAME="amd64" ;;
arm) ARCH_NAME="arm64" ;;
esac
bash ${rootPath}/scripts/getos.sh
OSNAME=`cat ${rootPath}/data/osname.pl`
VERSION_ID=`cat /etc/*-release | grep VERSION_ID | awk -F = '{print $2}' | awk -F "\"" '{print $2}'`
echo "VERSION_ID:${VERSION_ID}"
OS_SIGN=1.el9
if [ "$OSNAME" == "centos" ];then
OS_SIGN=1.el${VERSION_ID}
elif [ "$OSNAME" == "fedora" ]; then
OS_SIGN=10.fc${VERSION_ID}
elif [ "$OSNAME" == "opensuse" ]; then
OS_SIGN=1.sl${VERSION_ID:0:2}
fi
MYSQL_VER=8.4.0
SUFFIX_NAME=${MYSQL_VER}-${OS_SIGN}.${ARCH}
YUM_INSTALL()
{
mkdir -p /var/run/mysqld
chown mysql -R /var/run/mysqld
#######
mkdir -p $myDir
# https://dev.mysql.com/get/Downloads/MySQL-8.4/mysql-${SUFFIX_NAME}.rpm-bundle.tar
# https://cdn.mysql.com/archives/mysql-8.4/mysql-${SUFFIX_NAME}.rpm-bundle.tar
wget --no-check-certificate -O $myDir/mysql-${SUFFIX_NAME}.rpm-bundle.tar https://dev.mysql.com/get/Downloads/MySQL-8.4/mysql-${SUFFIX_NAME}.rpm-bundle.tar
cd ${myDir} && tar vxf mysql-${SUFFIX_NAME}.rpm-bundle.tar
mkdir -p ${serverPath}/mysql-yum/bin && cd ${serverPath}/mysql-yum/bin
rpm2cpio ${myDir}/mysql-community-client-${SUFFIX_NAME}.rpm | cpio -div
rpm2cpio ${myDir}/mysql-community-client-${SUFFIX_NAME}.x86_64.rpm | cpio -div
rpm2cpio ${myDir}/mysql-community-common-${SUFFIX_NAME}.rpm | cpio -div
rpm2cpio ${myDir}/mysql-community-debuginfo-${SUFFIX_NAME}.rpm | cpio -div
rpm2cpio ${myDir}/mysql-community-devel-${SUFFIX_NAME}.rpm | cpio -div
rpm2cpio ${myDir}/mysql-community-embedded-compat-${SUFFIX_NAME}.rpm | cpio -div
rpm2cpio ${myDir}/mysql-community-icu-data-files-${SUFFIX_NAME}.rpm | cpio -div
rpm2cpio ${myDir}/mysql-community-libs-${SUFFIX_NAME}.rpm | cpio -div
rpm2cpio ${myDir}/mysql-community-libs-compat-${SUFFIX_NAME}.rpm | cpio -div
rpm2cpio ${myDir}/mysql-community-server-${SUFFIX_NAME}.rpm | cpio -div
rpm2cpio ${myDir}/mysql-community-server-debug-${SUFFIX_NAME}.rpm | cpio -div
rpm2cpio ${myDir}/mysql-community-test-${SUFFIX_NAME}.rpm | cpio -div
#######
}
ZYPPER_INSTALL()
{
zypper install -y libstdc++6
mkdir -p /var/run/mysqld
chown mysql -R /var/run/mysqld
#######
mkdir -p $myDir
wget --no-check-certificate -O $myDir/mysql-${SUFFIX_NAME}.rpm-bundle.tar https://cdn.mysql.com/archives/mysql-8.4/mysql-${SUFFIX_NAME}.rpm-bundle.tar
echo "wget --no-check-certificate -O $myDir/mysql-${SUFFIX_NAME}.rpm-bundle.tar https://cdn.mysql.com/archives/mysql-8.4/mysql-${SUFFIX_NAME}.rpm-bundle.tar"
cd ${myDir} && tar vxf mysql-${SUFFIX_NAME}.rpm-bundle.tar
mkdir -p ${serverPath}/mysql-yum/bin && cd ${serverPath}/mysql-yum/bin
rpm2cpio ${myDir}/mysql-community-client-${SUFFIX_NAME}.rpm | cpio -div
rpm2cpio ${myDir}/mysql-community-client-${SUFFIX_NAME}.x86_64.rpm | cpio -div
rpm2cpio ${myDir}/mysql-community-common-${SUFFIX_NAME}.rpm | cpio -div
rpm2cpio ${myDir}/mysql-community-debuginfo-${SUFFIX_NAME}.rpm | cpio -div
rpm2cpio ${myDir}/mysql-community-devel-${SUFFIX_NAME}.rpm | cpio -div
rpm2cpio ${myDir}/mysql-community-embedded-compat-${SUFFIX_NAME}.rpm | cpio -div
rpm2cpio ${myDir}/mysql-community-icu-data-files-${SUFFIX_NAME}.rpm | cpio -div
rpm2cpio ${myDir}/mysql-community-libs-${SUFFIX_NAME}.rpm | cpio -div
rpm2cpio ${myDir}/mysql-community-libs-compat-${SUFFIX_NAME}.rpm | cpio -div
rpm2cpio ${myDir}/mysql-community-server-${SUFFIX_NAME}.rpm | cpio -div
rpm2cpio ${myDir}/mysql-community-server-debug-${SUFFIX_NAME}.rpm | cpio -div
rpm2cpio ${myDir}/mysql-community-test-${SUFFIX_NAME}.rpm | cpio -div
#######
}
YUM_UNINSTALL()
{
### YUM卸载 START ########
# yum -y remove mysql-server
rm -rf ${myDir}
### YUM卸载 END ########
}
Install_mysql()
{
echo '正在安装脚本文件...' > $install_tmp
mkdir -p $serverPath/mysql-yum
mkdir -p /var/lib/mysql
chown mysql -R /var/lib/mysql/
isYum=`which yum`
if [ "$isYum" != "" ];then
YUM_INSTALL
fi
isZypper=`which zypper`
if [ "$isZypper" != "" ];then
ZYPPER_INSTALL
fi
rm -rf $myDir
echo '8.4' > $serverPath/mysql-yum/version.pl
echo '安装完成'
}
Uninstall_mysql()
{
YUM_UNINSTALL
rm -rf $serverPath/mysql-yum
echo '卸载完成'
}
action=$1
if [ "${1}" == 'install' ];then
Install_mysql
else
Uninstall_mysql
fi
+156
View File
@@ -0,0 +1,156 @@
# -*- coding: utf-8 -*-
#!/bin/bash
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
export PATH
# https://downloads.mysql.com/archives/community/
curPath=`pwd`
rootPath=$(dirname "$curPath")
rootPath=$(dirname "$rootPath")
serverPath=$(dirname "$rootPath")
sysName=`uname`
install_tmp=${rootPath}/tmp/mw_install.pl
myDir=${serverPath}/source/mysql-yum
ARCH=`uname -m`
ARCH_NAME=''
case $(uname -m) in
i386) ARCH_NAME="386" ;;
i686) ARCH_NAME="386" ;;
x86_64) ARCH_NAME="amd64" ;;
arm) ARCH_NAME="arm64" ;;
esac
bash ${rootPath}/scripts/getos.sh
OSNAME=`cat ${rootPath}/data/osname.pl`
VERSION_ID=`cat /etc/*-release | grep VERSION_ID | awk -F = '{print $2}' | awk -F "\"" '{print $2}'`
echo "VERSION_ID:${VERSION_ID}"
OS_SIGN=1.el9
if [ "$OSNAME" == "centos" ];then
OS_SIGN=1.el${VERSION_ID}
elif [ "$OSNAME" == "fedora" ]; then
OS_SIGN=10.fc${VERSION_ID}
elif [ "$OSNAME" == "opensuse" ]; then
OS_SIGN=1.sl${VERSION_ID:0:2}
fi
MYSQL_VER=9.0.1
SUFFIX_NAME=${MYSQL_VER}-${OS_SIGN}.${ARCH}
YUM_INSTALL()
{
mkdir -p /var/run/mysqld
chown mysql -R /var/run/mysqld
#######
mkdir -p $myDir
# https://dev.mysql.com/get/Downloads/MySQL-8.4/mysql-${SUFFIX_NAME}.rpm-bundle.tar
# https://cdn.mysql.com/archives/mysql-8.4/mysql-${SUFFIX_NAME}.rpm-bundle.tar
wget --no-check-certificate -O $myDir/mysql-${SUFFIX_NAME}.rpm-bundle.tar https://dev.mysql.com/get/Downloads/MySQL-9.0/mysql-${SUFFIX_NAME}.rpm-bundle.tar
cd ${myDir} && tar vxf mysql-${SUFFIX_NAME}.rpm-bundle.tar
mkdir -p ${serverPath}/mysql-yum/bin && cd ${serverPath}/mysql-yum/bin
rpm2cpio ${myDir}/mysql-community-client-${SUFFIX_NAME}.rpm | cpio -div
rpm2cpio ${myDir}/mysql-community-client-${SUFFIX_NAME}.x86_64.rpm | cpio -div
rpm2cpio ${myDir}/mysql-community-common-${SUFFIX_NAME}.rpm | cpio -div
rpm2cpio ${myDir}/mysql-community-debuginfo-${SUFFIX_NAME}.rpm | cpio -div
rpm2cpio ${myDir}/mysql-community-devel-${SUFFIX_NAME}.rpm | cpio -div
rpm2cpio ${myDir}/mysql-community-embedded-compat-${SUFFIX_NAME}.rpm | cpio -div
rpm2cpio ${myDir}/mysql-community-icu-data-files-${SUFFIX_NAME}.rpm | cpio -div
rpm2cpio ${myDir}/mysql-community-libs-${SUFFIX_NAME}.rpm | cpio -div
rpm2cpio ${myDir}/mysql-community-libs-compat-${SUFFIX_NAME}.rpm | cpio -div
rpm2cpio ${myDir}/mysql-community-server-${SUFFIX_NAME}.rpm | cpio -div
rpm2cpio ${myDir}/mysql-community-server-debug-${SUFFIX_NAME}.rpm | cpio -div
rpm2cpio ${myDir}/mysql-community-test-${SUFFIX_NAME}.rpm | cpio -div
#######
}
ZYPPER_INSTALL()
{
zypper install -y libstdc++6
mkdir -p /var/run/mysqld
chown mysql -R /var/run/mysqld
#######
mkdir -p $myDir
wget --no-check-certificate -O $myDir/mysql-${SUFFIX_NAME}.rpm-bundle.tar https://cdn.mysql.com/Downloads/MySQL-9.0/mysql-${SUFFIX_NAME}.rpm-bundle.tar
echo "wget --no-check-certificate -O $myDir/mysql-${SUFFIX_NAME}.rpm-bundle.tar https://cdn.mysql.com/Downloads/MySQL-9.0/mysql-${SUFFIX_NAME}.rpm-bundle.tar"
cd ${myDir} && tar vxf mysql-${SUFFIX_NAME}.rpm-bundle.tar
mkdir -p ${serverPath}/mysql-yum/bin && cd ${serverPath}/mysql-yum/bin
rpm2cpio ${myDir}/mysql-community-client-${SUFFIX_NAME}.rpm | cpio -div
rpm2cpio ${myDir}/mysql-community-client-${SUFFIX_NAME}.x86_64.rpm | cpio -div
rpm2cpio ${myDir}/mysql-community-common-${SUFFIX_NAME}.rpm | cpio -div
rpm2cpio ${myDir}/mysql-community-debuginfo-${SUFFIX_NAME}.rpm | cpio -div
rpm2cpio ${myDir}/mysql-community-devel-${SUFFIX_NAME}.rpm | cpio -div
rpm2cpio ${myDir}/mysql-community-embedded-compat-${SUFFIX_NAME}.rpm | cpio -div
rpm2cpio ${myDir}/mysql-community-icu-data-files-${SUFFIX_NAME}.rpm | cpio -div
rpm2cpio ${myDir}/mysql-community-libs-${SUFFIX_NAME}.rpm | cpio -div
rpm2cpio ${myDir}/mysql-community-libs-compat-${SUFFIX_NAME}.rpm | cpio -div
rpm2cpio ${myDir}/mysql-community-server-${SUFFIX_NAME}.rpm | cpio -div
rpm2cpio ${myDir}/mysql-community-server-debug-${SUFFIX_NAME}.rpm | cpio -div
rpm2cpio ${myDir}/mysql-community-test-${SUFFIX_NAME}.rpm | cpio -div
#######
}
YUM_UNINSTALL()
{
### YUM卸载 START ########
# yum -y remove mysql-server
rm -rf ${myDir}
### YUM卸载 END ########
}
Install_mysql()
{
echo '正在安装脚本文件...' > $install_tmp
mkdir -p $serverPath/mysql-yum
mkdir -p /var/lib/mysql
chown mysql -R /var/lib/mysql/
isYum=`which yum`
if [ "$isYum" != "" ];then
YUM_INSTALL
fi
isZypper=`which zypper`
if [ "$isZypper" != "" ];then
ZYPPER_INSTALL
fi
rm -rf $myDir
echo '9.0' > $serverPath/mysql-yum/version.pl
echo '安装完成'
}
Uninstall_mysql()
{
YUM_UNINSTALL
rm -rf $serverPath/mysql-yum
echo '卸载完成'
}
action=$1
if [ "${1}" == 'install' ];then
Install_mysql
else
Uninstall_mysql
fi
+1 -1
View File
@@ -10,7 +10,7 @@ default-character-set = UTF8MB4
sha256_password_private_key_path={$SERVER_APP_PATH}/data/mysql.pem
sha256_password_public_key_path={$SERVER_APP_PATH}/data/mysql.pub
authentication_policy=mysql_native_password
authentication_policy=caching_sha2_password
pid-file = {$SERVER_APP_PATH}/data/mysql.pid
user = mysql
+1 -1
View File
@@ -10,7 +10,7 @@ default-character-set = UTF8MB4
sha256_password_private_key_path={$SERVER_APP_PATH}/data/mysql.pem
sha256_password_public_key_path={$SERVER_APP_PATH}/data/mysql.pub
authentication_policy=mysql_native_password
authentication_policy=caching_sha2_password
pid-file = {$SERVER_APP_PATH}/data/mysql.pid
user = mysql
+113
View File
@@ -0,0 +1,113 @@
[client]
user = root
#password = your_password
port = 3306
socket = {$SERVER_APP_PATH}/mysql.sock
default-character-set = UTF8MB4
[mysqld]
!include {$SERVER_APP_PATH}/etc/mode/classic.cnf
authentication_policy=caching_sha2_password
pid-file = {$SERVER_APP_PATH}/data/mysql.pid
user = mysql
port = 3306
socket = {$SERVER_APP_PATH}/mysql.sock
basedir = {$SERVER_APP_PATH}
datadir = {$SERVER_APP_PATH}/data
log-error = {$SERVER_APP_PATH}/data/error.log
server-id = {$SERVER_ID}
#sql-mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES
default_storage_engine = InnoDB
key_buffer_size = 8M
table_open_cache = 32
sort_buffer_size = 256K
net_buffer_length = 4K
read_buffer_size = 128K
read_rnd_buffer_size = 256K
myisam_sort_buffer_size = 4M
thread_cache_size = 4
lower_case_table_names=0
tmp_table_size = 8M
character-set-server = UTF8MB4
max_connections = 500
max_connect_errors = 100
open_files_limit = 2560
max_allowed_packet = 128M
skip_name_resolve=1
#skip-networking
#skip-external-locking
#loose-skip-innodb
#skip-grant-tables
log-bin=mysql-bin
slow_query_log=1
slow-query-log-file={$SERVER_APP_PATH}/data/mysql-slow.log
long_query_time=10
#log_queries_not_using_indexes=1
#log_slow_admin_statements=1
#log_slow_replica_statements=1
binlog_expire_logs_seconds=2592000
relay-log=mdserver
relay-log-index=mdserver
#多主设置
#auto_increment_offset=2
#auto_increment_increment=2
#master
#sync_binlog=1
#binlog-do-db
binlog-ignore-db = test
binlog-ignore-db = mysql
binlog-ignore-db = information_schema
binlog-ignore-db = performance_schema
#slave
log_replica_updates = 1
# Prevent replication from starting automatically with MySQL
#skip_replica_start = 1
#replicate-do-db
replica_skip_errors=1062,1396
replicate-ignore-db = information_schema
replicate-ignore-db = performance_schema
replicate-ignore-db = mysql
replicate-ignore-db = test
innodb_data_home_dir = {$SERVER_APP_PATH}/data
innodb_data_file_path = ibdata1:10M:autoextend
innodb_log_group_home_dir = {$SERVER_APP_PATH}/data
innodb_buffer_pool_size = 16M
#innodb_log_file_size = 5M
innodb_redo_log_capacity=10485760
innodb_log_buffer_size = 8M
innodb_flush_log_at_trx_commit = 1
innodb_lock_wait_timeout = 120
innodb_max_dirty_pages_pct = 90
innodb_read_io_threads = 1
innodb_write_io_threads = 1
innodb_file_per_table=1
secure-file-priv={$SERVER_APP_PATH}/tmp
[mysqldump]
quick
[mysql]
no-auto-rehash
[myisamchk]
key_buffer_size = 20M
sort_buffer_size = 20M
read_buffer = 2M
write_buffer = 2M
[mysqlhotcopy]
interactive-timeout
+113
View File
@@ -0,0 +1,113 @@
[client]
user = root
#password = your_password
port = 3306
socket = {$SERVER_APP_PATH}/mysql.sock
default-character-set = UTF8MB4
[mysqld]
!include {$SERVER_APP_PATH}/etc/mode/classic.cnf
authentication_policy=caching_sha2_password
pid-file = {$SERVER_APP_PATH}/data/mysql.pid
user = mysql
port = 3306
socket = {$SERVER_APP_PATH}/mysql.sock
basedir = {$SERVER_APP_PATH}
datadir = {$SERVER_APP_PATH}/data
log-error = {$SERVER_APP_PATH}/data/error.log
server-id = {$SERVER_ID}
#sql-mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES
default_storage_engine = InnoDB
key_buffer_size = 8M
table_open_cache = 32
sort_buffer_size = 256K
net_buffer_length = 4K
read_buffer_size = 128K
read_rnd_buffer_size = 256K
myisam_sort_buffer_size = 4M
thread_cache_size = 4
lower_case_table_names=0
tmp_table_size = 8M
character-set-server = UTF8MB4
max_connections = 500
max_connect_errors = 100
open_files_limit = 2560
max_allowed_packet = 128M
skip_name_resolve=1
#skip-networking
#skip-external-locking
#loose-skip-innodb
#skip-grant-tables
log-bin=mysql-bin
slow_query_log=1
slow-query-log-file={$SERVER_APP_PATH}/data/mysql-slow.log
long_query_time=10
#log_queries_not_using_indexes=1
#log_slow_admin_statements=1
#log_slow_replica_statements=1
binlog_expire_logs_seconds=2592000
relay-log=mdserver
relay-log-index=mdserver
#多主设置
#auto_increment_offset=2
#auto_increment_increment=2
#master
#sync_binlog=1
#binlog-do-db
binlog-ignore-db = test
binlog-ignore-db = mysql
binlog-ignore-db = information_schema
binlog-ignore-db = performance_schema
#slave
log_replica_updates = 1
# Prevent replication from starting automatically with MySQL
#skip_replica_start = 1
#replicate-do-db
replica_skip_errors=1062,1396
replicate-ignore-db = information_schema
replicate-ignore-db = performance_schema
replicate-ignore-db = mysql
replicate-ignore-db = test
innodb_data_home_dir = {$SERVER_APP_PATH}/data
innodb_data_file_path = ibdata1:10M:autoextend
innodb_log_group_home_dir = {$SERVER_APP_PATH}/data
innodb_buffer_pool_size = 16M
#innodb_log_file_size = 5M
innodb_redo_log_capacity=10485760
innodb_log_buffer_size = 8M
innodb_flush_log_at_trx_commit = 1
innodb_lock_wait_timeout = 120
innodb_max_dirty_pages_pct = 90
innodb_read_io_threads = 1
innodb_write_io_threads = 1
innodb_file_per_table=1
secure-file-priv={$SERVER_APP_PATH}/tmp
[mysqldump]
quick
[mysql]
no-auto-rehash
[myisamchk]
key_buffer_size = 20M
sort_buffer_size = 20M
read_buffer = 2M
write_buffer = 2M
[mysqlhotcopy]
interactive-timeout
+101 -79
View File
@@ -88,7 +88,7 @@ def getConf():
def getDbPort():
file = getConf()
content = mw.readFile(file)
rep = 'port\s*=\s*(.*)'
rep = r'port\s*=\s*(.*)'
tmp = re.search(rep, content)
return tmp.groups()[0].strip()
@@ -96,7 +96,7 @@ def getDbPort():
def getDbServerId():
file = getConf()
content = mw.readFile(file)
rep = 'server-id\s*=\s*(.*)'
rep = r'server-id\s*=\s*(.*)'
tmp = re.search(rep, content)
return tmp.groups()[0].strip()
@@ -104,7 +104,7 @@ def getDbServerId():
def getSocketFile():
file = getConf()
content = mw.readFile(file)
rep = 'socket\s*=\s*(.*)'
rep = r'socket\s*=\s*(.*)'
tmp = re.search(rep, content)
return tmp.groups()[0].strip()
@@ -112,14 +112,14 @@ def getSocketFile():
def getErrorLogsFile():
file = getConf()
content = mw.readFile(file)
rep = 'log-error\s*=\s*(.*)'
rep = r'log-error\s*=\s*(.*)'
tmp = re.search(rep, content)
return tmp.groups()[0].strip()
def getAuthPolicy():
file = getConf()
content = mw.readFile(file)
rep = 'authentication_policy\s*=\s*(.*)'
rep = r'authentication_policy\s*=\s*(.*)'
tmp = re.search(rep, content)
if tmp:
return tmp.groups()[0].strip()
@@ -183,7 +183,7 @@ def pMysqlDb():
db = mw.getMyORM()
# MySQLdb |
# db = mw.getMyORMDb()
# print(getDbPort())
db.setPort(getDbPort())
db.setSocket(getSocketFile())
# db.setCharset("utf8")
@@ -302,7 +302,7 @@ def status(version=''):
def getDataDir():
file = getConf()
content = mw.readFile(file)
rep = 'datadir\s*=\s*(.*)'
rep = r'datadir\s*=\s*(.*)'
tmp = re.search(rep, content)
return tmp.groups()[0].strip()
@@ -310,7 +310,7 @@ def getDataDir():
def getLogBinName():
file = getConf()
content = mw.readFile(file)
rep = 'log-bin\s*=\s*(.*)'
rep = r'log-bin\s*=\s*(.*)'
tmp = re.search(rep, content)
return tmp.groups()[0].strip()
@@ -318,12 +318,12 @@ def getLogBinName():
def getPidFile():
file = getConf()
content = mw.readFile(file)
rep = 'pid-file\s*=\s*(.*)'
rep = r'pid-file\s*=\s*(.*)'
tmp = re.search(rep, content)
return tmp.groups()[0].strip()
def binLog():
def binLog(version = ''):
args = getArgs()
conf = getConf()
con = mw.readFile(conf)
@@ -334,7 +334,7 @@ def binLog():
con = con.replace('#log-bin=mysql-bin', 'log-bin=mysql-bin')
con = con.replace('#binlog_format=mixed', 'binlog_format=mixed')
mw.execShell('sync')
restart()
restart(version)
else:
path = getDataDir()
if 'status' in args:
@@ -348,7 +348,7 @@ def binLog():
con = con.replace('log-bin=mysql-bin', '#log-bin=mysql-bin')
con = con.replace('binlog_format=mixed', '#binlog_format=mixed')
mw.execShell('sync')
restart()
restart(version)
mw.execShell('rm -f ' + path + '/mysql-bin.*')
mw.writeFile(conf, con)
@@ -424,11 +424,14 @@ def getErrorLog():
def getShowLogFile():
file = getConf()
content = mw.readFile(file)
rep = 'slow-query-log-file\s*=\s*(.*)'
rep = r'slow-query-log-file\s*=\s*(.*)'
tmp = re.search(rep, content)
return tmp.groups()[0].strip()
def getMdb8Ver():
return ['8.0','8.1','8.2','8.3','8.4','9.0']
def pGetDbUser():
if mw.isAppleSystem():
user = mw.execShell(
@@ -589,23 +592,22 @@ def myOp(version, method):
isInited = initMysqlData()
if not isInited:
if current_os.startswith("freebsd"):
if not mw.isSupportSystemctl():
mw.execShell('service ' + getPluginName() + ' start')
else:
mw.execShell('systemctl start mysql')
initMysqlPwd()
if current_os.startswith("freebsd"):
if not mw.isSupportSystemctl():
mw.execShell('service ' + getPluginName() + ' stop')
else:
mw.execShell('systemctl stop mysql')
if current_os.startswith("freebsd"):
data = mw.execShell('service ' + getPluginName() + ' ' + method)
return 'ok'
mw.execShell('systemctl ' + method + ' mysql')
if not mw.isSupportSystemctl():
mw.execShell('service ' + getPluginName() + ' ' + method)
else:
mw.execShell('systemctl ' + method + ' mysql')
return 'ok'
except Exception as e:
return str(e)
@@ -615,19 +617,17 @@ def my8cmd(version, method):
# mysql 8.0 and 5.7
init_file = initDreplace(version)
cmd = init_file + ' ' + method
mdb8 = getMdb8Ver()
try:
if version == '5.7':
isInited = True
if mw.inArray(mdb8, version):
isInited = initMysql8Data()
else:
isInited = initMysql57Data()
elif version == '8.0':
isInited = initMysql8Data()
elif version == '8.2':
isInited = initMysql8Data()
elif version == '8.3':
isInited = initMysql8Data()
if not isInited:
if mw.isAppleSystem():
if not mw.isSupportSystemctl():
cmd_init_start = init_file + ' start'
subprocess.Popen(cmd_init_start, stdout=subprocess.PIPE, shell=True,
bufsize=4096, stderr=subprocess.PIPE)
@@ -643,7 +643,7 @@ def my8cmd(version, method):
break
time.sleep(1)
if mw.isAppleSystem():
if not mw.isSupportSystemctl():
cmd_init_stop = init_file + ' stop'
subprocess.Popen(cmd_init_stop, stdout=subprocess.PIPE, shell=True,
bufsize=4096, stderr=subprocess.PIPE)
@@ -651,7 +651,7 @@ def my8cmd(version, method):
else:
mw.execShell('systemctl stop mysql')
if mw.isAppleSystem():
if not mw.isSupportSystemctl():
sub = subprocess.Popen(cmd, stdout=subprocess.PIPE, shell=True,
bufsize=4096, stderr=subprocess.PIPE)
sub.wait(5)
@@ -664,7 +664,10 @@ def my8cmd(version, method):
def appCMD(version, action):
makeInitRsaKey(version)
if float(version) >= 5.7:
mdb8 = getMdb8Ver()
mdb8.append('5.7')
# print(mdb8)
if mw.inArray(mdb8, version):
status = my8cmd(version, action)
else:
status = myOp(version, action)
@@ -740,7 +743,7 @@ def initdUinstall():
def getMyDbPos():
file = getConf()
content = mw.readFile(file)
rep = 'datadir\s*=\s*(.*)'
rep = r'datadir\s*=\s*(.*)'
tmp = re.search(rep, content)
return tmp.groups()[0].strip()
@@ -776,8 +779,7 @@ def setMyDbPos(version):
mw.writeFile(myfile, mycnf)
start(version)
result = mw.execShell(
'ps aux|grep mysqld| grep -v grep|grep -v python')
result = mw.execShell('ps aux|grep mysqld| grep -v grep|grep -v python')
if len(result[0]) > 10:
mw.writeFile('data/datadir.pl', t_datadir)
return mw.returnJson(True, '存储目录迁移成功!')
@@ -791,7 +793,7 @@ def setMyDbPos(version):
def getMyPort():
file = getConf()
content = mw.readFile(file)
rep = 'port\s*=\s*(.*)'
rep = r'port\s*=\s*(.*)'
tmp = re.search(rep, content)
return tmp.groups()[0].strip()
@@ -805,7 +807,7 @@ def setMyPort(version):
port = args['port']
file = getConf()
content = mw.readFile(file)
rep = "port\s*=\s*([0-9]+)\s*\n"
rep = r"port\s*=\s*([0-9]+)\s*\n"
content = re.sub(rep, 'port = ' + port + '\n', content)
mw.writeFile(file, content)
restart(version)
@@ -896,7 +898,7 @@ def setDbStatus(version):
s = 'K'
if g in emptys:
s = ''
rep = '\s*' + g + '\s*=\s*\d+(M|K|k|m|G)?\n'
rep = r'\s*' + g + r'\s*=\s*\d+(M|K|k|m|G)?\n'
c = g + ' = ' + args[g] + s + '\n'
if content.find(g) != -1:
content = re.sub(rep, '\n' + c, content, 1)
@@ -1569,10 +1571,10 @@ def addDb():
dataAccess = args['dataAccess'].strip()
ps = args['ps'].strip()
reg = "^[\w-]+$"
reg = r"^[\w-]+$"
if not re.match(reg, args['name']):
return mw.returnJson(False, '数据库名称不能带有特殊符号!')
checks = ['root', 'mysql', 'test', 'sys', 'panel_logs']
checks = ['root', 'mysql', 'test', 'sys', 'performance_schema','information_schema']
if dbuser in checks or len(dbuser) < 1:
return mw.returnJson(False, '数据库用户名不合法!')
if dbname in checks or len(dbname) < 1:
@@ -1722,7 +1724,8 @@ def resetDbRootPwd(version):
pSqliteDb('config').where('id=?', (1,)).save('mysql_root', (pwd,))
if float(version) < 5.7:
mdb8 = getMdb8Ver()
if not mw.inArray(mdb8, version):
cmd_pass = serverdir + '/bin/mysql --defaults-file=' + myconf + ' -uroot -e'
cmd_pass = cmd_pass + '"UPDATE mysql.user SET password=PASSWORD(\'' + pwd + "') WHERE user='root';"
cmd_pass = cmd_pass + 'flush privileges;"'
@@ -2160,8 +2163,7 @@ def setDbMaster(version):
if not isHas:
prefix = '#binlog-do-db'
con = con.replace(
prefix, prefix + "\nbinlog-do-db=" + args['name'])
con = con.replace(prefix, prefix + "\nbinlog-do-db=" + args['name'])
mw.writeFile(conf, con)
restart(version)
@@ -2200,11 +2202,18 @@ def setDbSlave(version):
def getMasterStatus(version=''):
if status(version) == 'stop':
return mw.returnJson(False, 'MySQL未启动,或正在启动中...!', [])
query_status_cmd = 'show slave status'
is_mdb8 = False
mdb8 = getMdb8Ver()
if mw.inArray(mdb8, version):
is_mdb8 = True
query_status_cmd = 'show replica status'
try:
if status(version) == 'stop':
return mw.returnJson(False, 'MySQL未启动,或正在启动中...!', [])
conf = getConf()
content = mw.readFile(conf)
master_status = False
@@ -2219,15 +2228,20 @@ def getMasterStatus(version=''):
data['slave_status'] = False
db = pMysqlDb()
dlist = db.query('show slave status')
dlist = db.query(query_status_cmd)
for v in dlist:
if v["Slave_IO_Running"] == 'Yes' or v["Slave_SQL_Running"] == 'Yes':
data['slave_status'] = True
if is_mdb8:
if (v["Replica_IO_Running"] == 'Yes' or v["Replica_SQL_Running"] == 'Yes'):
data['slave_status'] = True
else:
if (v["Slave_IO_Running"] == 'Yes' or v["Slave_SQL_Running"] == 'Yes'):
data['slave_status'] = True
return mw.returnJson(master_status, '设置成功', data)
except Exception as e:
return mw.returnJson(False, "数据库密码错误,在管理列表-点击【修复】!", 'pwd')
return mw.returnJson(False, "数据库密码错误,在管理列表-点击【修复】,"+str(e), 'pwd')
def setMasterStatus(version=''):
@@ -2311,10 +2325,10 @@ def addMasterRepSlaveUser(version=''):
# address = args['address'].strip()
# dataAccess = args['dataAccess'].strip()
reg = "^[\w-]+$"
reg = r"^[\w-]+$"
if not re.match(reg, username):
return mw.returnJson(False, '用户名不能带有特殊符号!')
checks = ['root', 'mysql', 'test', 'sys', 'panel_logs']
checks = ['root', 'mysql', 'test', 'sys', 'performance_schema','information_schema']
if username in checks or len(username) < 1:
return mw.returnJson(False, '用户名不合法!')
if password in checks or len(password) < 1:
@@ -2331,7 +2345,8 @@ def addMasterRepSlaveUser(version=''):
if psdb.where("username=?", (username)).count() > 0:
return mw.returnJson(False, '用户已存在!')
if version == "8.0":
mdb8 = getMdb8Ver()
if mw.inArray(mdb8,version):
sql = "CREATE USER '" + username + \
"' IDENTIFIED WITH "+auth_policy+" BY '" + password + "';"
pdb.execute(sql)
@@ -2340,7 +2355,6 @@ def addMasterRepSlaveUser(version=''):
isError = isSqlError(result)
if isError != None:
return isError
else:
sql = "grant replication SLAVE ON *.* TO '" + username + \
"'@'%' identified by '" + password + "';"
@@ -2392,32 +2406,30 @@ def getMasterRepSlaveUserCmd(version):
sid = getDbServerId()
channel_name = ""
if sid != '':
channel_name = " for channel 'r{}';".format(sid)
channel_name = " for channel 'r{}'".format(sid)
mdb8 = ['8.0','8.1','8.2','8.3','8.4']
mdb8 = getMdb8Ver()
sql = ''
if not mw.inArray(mdb8,version):
base_sql = "CHANGE MASTER TO MASTER_HOST='" + ip + "', MASTER_PORT=" + port + ", MASTER_USER='" + \
clist[0]['username'] + "', MASTER_PASSWORD='" + \
clist[0]['password'] + "'"
clist[0]['username'] + "', MASTER_PASSWORD='" + clist[0]['password'] + "'"
sql += base_sql +';'
sql += "<br/><hr/>"
sql += base_sql;
sql += "<br/><hr/>";
# sql += base_sql + ", MASTER_AUTO_POSITION=1" + channel_name
sql += base_sql + channel_name
sql += "<br/><hr/>"
sql += "<br/><hr/>";
sql += base_sql + "', MASTER_LOG_FILE='" + mstatus[0]["File"] + "',MASTER_LOG_POS=" + str(mstatus[0]["Position"]) + channel_name
sql += base_sql + ", MASTER_LOG_FILE='" + mstatus[0]["File"] + "',MASTER_LOG_POS=" + str(mstatus[0]["Position"]) + channel_name
else:
base_sql = "CHANGE REPLICATION SOURCE TO SOURCE_HOST='" + ip + "', SOURCE_PORT=" + port + ", SOURCE_USER='" + \
clist[0]['username'] + "', SOURCE_PASSWORD='" + \
clist[0]['password']+"'"
sql += base_sql +';'
sql += "<br/><hr/>"
clist[0]['username'] + "', SOURCE_PASSWORD='" + clist[0]['password']+"'"
sql += base_sql;
sql += "<br/><hr/>";
# sql += base_sql + ", MASTER_AUTO_POSITION=1" + channel_name
sql += base_sql + channel_name
sql += "<br/><hr/>"
sql += base_sql + "', SOURCE_LOG_FILE='" + mstatus[0]["File"] + "',SOURCE_LOG_POS=" + str(mstatus[0]["Position"]) + channel_name
sql += "<br/><hr/>";
sql += base_sql + ", SOURCE_LOG_FILE='" + mstatus[0]["File"] + "',SOURCE_LOG_POS=" + str(mstatus[0]["Position"]) + channel_name
data = {}
@@ -2689,11 +2701,17 @@ def updateSlaveSSH(version=''):
def getSlaveList(version=''):
query_status_cmd = 'show slave status'
mdb8 = getMdb8Ver()
if mw.inArray(mdb8, version):
query_status_cmd = 'show replica status'
if status(version) == 'stop':
return mw.returnJson(False, 'MySQL未启动', [])
db = pMysqlDb()
dlist = db.query('show slave status')
dlist = db.query(query_status_cmd)
# print(dlist)
data = {}
@@ -3373,7 +3391,7 @@ def doFullSyncUserImportContentForChannel(file, channel_name):
content = content.replace('STOP SLAVE;', "STOP SLAVE for channel '{}';".format(channel_name))
content = content.replace('START SLAVE;', "START SLAVE for channel '{}';".format(channel_name))
find_head = "CHANGE MASTER TO "
find_head = r"CHANGE MASTER TO "
find_re = find_head+"(.*?);"
find_r = re.search(find_re, content, re.I|re.M)
if find_r:
@@ -3447,7 +3465,7 @@ def doFullSyncUser(version=''):
time.sleep(1)
writeDbSyncStatus({'code': 1, 'msg': '正在停止从库...', 'progress': 15})
mdb8 = ['8.0','8.1','8.2','8.3','8.4']
mdb8 = getMdb8Ver()
if mw.inArray(mdb8,version):
db.query("stop slave user='{}' password='{}';".format(user, apass))
else:
@@ -3475,12 +3493,14 @@ def doFullSyncUser(version=''):
time_s = time.time()
if not os.path.exists(bak_file):
if isSimpleSyncCmd(cmd):
dmp_option += " --master-data=1 --apply-slave-statements --include-master-host-port "
dmp_option += ' '
if mw.inArray(mdb8,version):
# --compression-algorithms
dmp_option += " --source-data=1 --apply-replica-statements --include-source-host-port "
else:
dmp_option += ' '
dmp_option += " --master-data=1 --apply-slave-statements --include-master-host-port --compress "
dump_sql_data = getServerDir() + "/bin/mysqldump --single-transaction --default-character-set=utf8mb4 --compress -q " + dmp_option + " -h" + ip + " -P" + \
dump_sql_data = getServerDir() + "/bin/mysqldump --single-transaction --default-character-set=utf8mb4 -q " + dmp_option + " -h" + ip + " -P" + \
port + " -u" + user + " -p'" + apass + "' --ssl-mode=DISABLED " + sync_db + " > " + bak_file
print(dump_sql_data)
time_s = time.time()
@@ -3537,9 +3557,8 @@ def doFullSyncUser(version=''):
# r = db.query(cmd)
# print(r)
mdb8 = ['8.0','8.1','8.2','8.3','8.4']
if mw.inArray(mdb8,version):
db.query("start slave user='{}' password='{}';".format(user, apass))
db.query("start replica user='{}' password='{}';".format(user, apass))
else:
db.query("start slave")
@@ -3682,7 +3701,7 @@ def doFullSyncSSH(version=''):
writeDbSyncStatus({'code': 5, 'msg': '导入数据失败...', 'progress': 100})
return 'fail'
mdb8 = ['8.0','8.1','8.2','8.3','8.4']
mdb8 = getMdb8Ver()
if mw.inArray(mdb8,version):
db.query("start slave user='{}' password='{}';".format(uinfo['username'], uinfo['password']))
else:
@@ -3746,7 +3765,10 @@ def installPreInspection(version):
def uninstallPreInspection(version):
stop(version)
data_dir = getDataDir()
if os.path.exists(data_dir):
stop(version)
if mw.isDebugMode():
return 'ok'
@@ -3792,7 +3814,7 @@ if __name__ == "__main__":
elif func == 'conf':
print(getConf())
elif func == 'bin_log':
print(binLog())
print(binLog(version))
elif func == 'binlog_list':
print(binLogList())
elif func == 'clean_bin_log':
+2 -2
View File
@@ -10,8 +10,8 @@
"checks": "server/mysql/VERSION/bin/mysql",
"path": "server/mysql/VERSION",
"todo_versions":["5.6","5.7","8.0","8.2"],
"versions":["5.5", "5.6", "5.7","8.0","8.2","8.3"],
"updates":["5.5.62","5.6.50", "5.7.32","8.0.34","8.2.0","8.3.0"],
"versions":["5.5", "5.6", "5.7","8.0","8.2","8.3","8.4","9.0"],
"updates":["5.5.62","5.6.50", "5.7.32","8.0.34","8.2.0","8.3.0","9.0.1"],
"shell":"install.sh",
"checks":"server/mysql",
"path":"server/mysql",
+8
View File
@@ -23,6 +23,14 @@ install_tmp=${rootPath}/tmp/mw_install.pl
action=$1
type=$2
if id mysql &> /dev/null ;then
echo "mysql UID is `id -u mysql`"
echo "mysql Shell is `grep "^mysql:" /etc/passwd |cut -d':' -f7 `"
else
groupadd mysql
useradd -g mysql -s /usr/sbin/nologin mysql
fi
if [ "${2}" == "" ];then
echo '缺少安装脚本...' > $install_tmp
exit 0
+45 -27
View File
@@ -1707,7 +1707,7 @@ function addMasterRepSlaveUser(){
function updateMasterRepSlaveUser(username){
function updateMasterRepSlaveUser(username, password){
var index = layer.open({
type: 1,
@@ -1720,7 +1720,7 @@ function updateMasterRepSlaveUser(username){
<div class='line'><span class='tname'>用户名</span><div class='info-r'><input name='username' readonly='readonly' class='bt-input-text mr5' placeholder='用户名' type='text' style='width:330px;' value='"+username+"'></div></div>\
<div class='line'>\
<span class='tname'>密码</span>\
<div class='info-r'><input class='bt-input-text mr5' type='text' name='password' id='MyPassword' style='width:330px' value='"+(randomStrPwd(16))+"' /><span title='随机密码' class='glyphicon glyphicon-repeat cursor' onclick='repeatPwd(16)'></span></div>\
<div class='info-r'><input class='bt-input-text mr5' type='text' name='password' id='MyPassword' style='width:330px' value='"+password+"' /><span title='随机密码' class='glyphicon glyphicon-repeat cursor' onclick='repeatPwd(16)'></span></div>\
</div>\
<input type='hidden' name='ps' value='' />\
<div class='bt-form-submit-btn'>\
@@ -1762,17 +1762,11 @@ function getMasterRepSlaveUserCmd(username, db=''){
area: '500px',
content:"<form class='bt-form pd20 pb70' id='add_master'>\
<div class='line'>"+cmd+"</div>\
<div class='bt-form-submit-btn'>\
<button type='button' class='btn btn-success btn-sm btn-title class-copy-cmd'>复制</button>\
<div class='bt-form-submit-btn' style='text-align:center;'>\
<button type='button' class='btn btn-success btn-sm btn-title'>选择其中一个复制</button>\
</div>\
</form>",
});
copyPass(cmd);
$('.class-copy-cmd').click(function(){
copyPass(cmd);
});
});
}
@@ -1894,10 +1888,11 @@ function getMasterRepSlaveList(){
for (i in user_list) {
// console.log(i);
var name = user_list[i]['username'];
var password = user_list[i]['password'];
list += '<tr><td>'+name+'</td>\
<td>'+user_list[i]['password']+'</td>\
<td>'+password+'</td>\
<td>\
<a class="btlink" onclick="updateMasterRepSlaveUser(\''+name+'\');">修改</a> | \
<a class="btlink" onclick="updateMasterRepSlaveUser(\''+name+'\',\''+password+'\');">修改</a> | \
<a class="btlink" onclick="delMasterRepSlaveUser(\''+name+'\');">删除</a> | \
<a class="btlink" onclick="setDbMasterAccess(\''+name+'\');">权限</a> | \
<a class="btlink" onclick="getMasterRepSlaveUserCmd(\''+name+'\');">从库同步命令</a>\
@@ -2310,7 +2305,7 @@ function addSlaveSyncUser(ip=''){
</div>\
</div>\
<div class='line'>\
<span class='tname'>CMD[必须填写]</span>\
<span class='tname'>CMD[必填]</span>\
<div class='info-r'><textarea class='bt-input-text mr5' row='20' cols='30' name='cmd' style='width:330px;height:150px;'></textarea></div>\
</div>\
<input type='hidden' name='mode' value='"+mode+"' />\
@@ -2342,10 +2337,17 @@ function addSlaveSyncUser(ip=''){
a[kv[0]] = kv[1].replace("'",'').replace("'",'');
}
$('input[name="ip"]').val(a['MASTER_HOST']);
$('input[name="port"]').val(a['MASTER_PORT']);
$('input[name="user"]').val(a['MASTER_USER']);
$('input[name="pass"]').val(a['MASTER_PASSWORD']);
if ('MASTER_HOST' in a){
$('input[name="ip"]').val(a['MASTER_HOST']);
$('input[name="port"]').val(a['MASTER_PORT']);
$('input[name="user"]').val(a['MASTER_USER']);
$('input[name="pass"]').val(a['MASTER_PASSWORD']);
} else {
$('input[name="ip"]').val(a['SOURCE_HOST']);
$('input[name="port"]').val(a['SOURCE_PORT']);
$('input[name="user"]').val(a['SOURCE_USER']);
$('input[name="pass"]').val(a['SOURCE_PASSWORD']);
}
});
},
yes:function(index){
@@ -2623,6 +2625,7 @@ function masterOrSlaveConf(version=''){
_data['page'] = page;
_data['page_size'] = 10;
var mdb_ver = $('.plugin_version').attr('version');
myPost('get_slave_list', _data, function(data){
var rdata = $.parseJSON(data.data);
@@ -2637,17 +2640,32 @@ function masterOrSlaveConf(version=''){
}
var status = "<a data-id="+i+" class='btlink db_error'>异常</>";
if (v['Slave_SQL_Running'] == 'Yes' && v['Slave_IO_Running'] == 'Yes'){
status = "正常";
}
if (mdb_ver >= 8){
if (v['Replica_SQL_Running'] == 'Yes' && v['Replica_IO_Running'] == 'Yes'){
status = "正常";
}
list += '<tr>';
list += '<td>' + rdata.data[i]['Master_Host'] +'</td>';
list += '<td>' + rdata.data[i]['Master_Port'] +'</td>';
list += '<td>' + rdata.data[i]['Master_User'] +'</td>';
list += '<td>' + rdata.data[i]['Master_Log_File'] +'</td>';
list += '<td>' + rdata.data[i]['Slave_IO_Running'] +'</td>';
list += '<td>' + rdata.data[i]['Slave_SQL_Running'] +'</td>';
list += '<tr>';
list += '<td>' + rdata.data[i]['Source_Host'] +'</td>';
list += '<td>' + rdata.data[i]['Source_Port'] +'</td>';
list += '<td>' + rdata.data[i]['Source_User'] +'</td>';
list += '<td>' + rdata.data[i]['Relay_Source_Log_File'] +'</td>';
list += '<td>' + rdata.data[i]['Replica_IO_Running'] +'</td>';
list += '<td>' + rdata.data[i]['Replica_SQL_Running'] +'</td>';
} else {
if (v['Slave_SQL_Running'] == 'Yes' && v['Slave_IO_Running'] == 'Yes'){
status = "正常";
}
list += '<tr>';
list += '<td>' + rdata.data[i]['Master_Host'] +'</td>';
list += '<td>' + rdata.data[i]['Master_Port'] +'</td>';
list += '<td>' + rdata.data[i]['Master_User'] +'</td>';
list += '<td>' + rdata.data[i]['Master_Log_File'] +'</td>';
list += '<td>' + rdata.data[i]['Slave_IO_Running'] +'</td>';
list += '<td>' + rdata.data[i]['Slave_SQL_Running'] +'</td>';
}
if (isHasSign){
list += '<td>' + v['Channel_Name'] +'</td>';
@@ -0,0 +1,37 @@
diff -ruN mysql-5.5.42.orig/sql-common/client_plugin.c mysql-5.5.42/sql-common/client_plugin.c
--- mysql-5.5.42.orig/sql-common/client_plugin.c 2015-01-07 04:39:40.000000000 +0800
+++ mysql-5.5.42/sql-common/client_plugin.c 2015-03-24 10:36:45.682700014 +0800
@@ -233,6 +233,7 @@
{
MYSQL mysql;
struct st_mysql_client_plugin **builtin;
+ va_list dummy;
if (initialized)
return 0;
@@ -249,7 +250,7 @@
pthread_mutex_lock(&LOCK_load_client_plugin);
for (builtin= mysql_client_builtins; *builtin; builtin++)
- add_plugin(&mysql, *builtin, 0, 0, 0);
+ add_plugin(&mysql, *builtin, 0, 0, dummy);
pthread_mutex_unlock(&LOCK_load_client_plugin);
@@ -293,6 +294,7 @@
mysql_client_register_plugin(MYSQL *mysql,
struct st_mysql_client_plugin *plugin)
{
+ va_list dummy;
if (is_not_initialized(mysql, plugin->name))
return NULL;
@@ -307,7 +309,7 @@
plugin= NULL;
}
else
- plugin= add_plugin(mysql, plugin, 0, 0, 0);
+ plugin= add_plugin(mysql, plugin, 0, 0, dummy);
pthread_mutex_unlock(&LOCK_load_client_plugin);
return plugin;
+62 -9
View File
@@ -10,25 +10,58 @@ rootPath=$(dirname "$curPath")
rootPath=$(dirname "$rootPath")
serverPath=$(dirname "$rootPath")
sysName=`uname`
sysArch=`arch`
install_tmp=${rootPath}/tmp/mw_install.pl
mysqlDir=${serverPath}/source/mysql
VERSION=5.5.62
_os=`uname`
echo "use system: ${_os}"
if [ ${_os} == "Darwin" ]; then
OSNAME='macos'
elif grep -Eq "openSUSE" /etc/*-release; then
OSNAME='opensuse'
zypper refresh
elif grep -Eq "FreeBSD" /etc/*-release; then
OSNAME='freebsd'
pkg install -y wget unzip
elif grep -Eqi "Arch" /etc/issue || grep -Eq "Arch" /etc/*-release; then
OSNAME='arch'
echo y | pacman -Sy unzip
elif grep -Eqi "CentOS" /etc/issue || grep -Eq "CentOS" /etc/*-release; then
OSNAME='centos'
yum install -y wget zip unzip
elif grep -Eqi "Fedora" /etc/issue || grep -Eq "Fedora" /etc/*-release; then
OSNAME='fedora'
yum install -y wget zip unzip
elif grep -Eqi "Rocky" /etc/issue || grep -Eq "Rocky" /etc/*-release; then
OSNAME='rocky'
yum install -y wget zip unzip
elif grep -Eqi "AlmaLinux" /etc/issue || grep -Eq "AlmaLinux" /etc/*-release; then
OSNAME='alma'
yum install -y wget zip unzip
elif grep -Eqi "Debian" /etc/issue || grep -Eq "Debian" /etc/*-release; then
OSNAME='debian'
apt update -y
apt install -y devscripts
apt install -y wget zip unzip
elif grep -Eqi "Ubuntu" /etc/issue || grep -Eq "Ubuntu" /etc/*-release; then
OSNAME='ubuntu'
apt install -y wget zip unzip
else
OSNAME='unknow'
fi
VERSION_ID=`cat /etc/*-release | grep VERSION_ID | awk -F = '{print $2}' | awk -F "\"" '{print $2}'`
Install_mysql()
{
mkdir -p ${mysqlDir}
echo '正在安装脚本文件...' > $install_tmp
if id mysql &> /dev/null ;then
echo "mysql UID is `id -u www`"
echo "mysql Shell is `grep "^www:" /etc/passwd |cut -d':' -f7 `"
else
groupadd mysql
useradd -g mysql mysql
fi
if [ "$sysName" != "Darwin" ];then
mkdir -p /var/log/mariadb
touch /var/log/mariadb/mariadb.log
@@ -77,6 +110,27 @@ Install_mysql()
WHERE_DIR_GPP=`which g++`
fi
# https://blog.whsir.com/post-7748.html
# arm架构编译MySQL5.5报错
if [[ "$sysArch" =~ "aarch" ]];then
# wget --no-check-certificate -O ${mysqlDir}/mysql-5.5-fix-arm-client_plugin.patch https://down.whsir.com/downloads/mysql-5.5-fix-arm-client_plugin.patch
cd ${mysqlDir}/mysql-5.5.62 && patch -p1 < ${rootPath}/plugins/mysql/patch/mysql-5.5-fix-arm-client_plugin.patch
fi
if [ "$OSNAME" == "ubuntu" ];then
apt install -y libudev-dev
apt install -y libtirpc-dev
apt install -y libssl-dev
apt install -y libgssglue-dev
apt install -y software-properties-common
add-apt-repository -y ppa:ubuntu-toolchain-r/test
export PKG_CONFIG_PATH=/usr/lib/pkgconfig
apt install -y gcc-10 g++-10
WHERE_DIR_GCC=/usr/bin/gcc-10
WHERE_DIR_GPP=/usr/bin/g++-10
fi
if [ ! -d $serverPath/mysql ];then
cd ${mysqlDir}/mysql-5.5.62 && cmake \
-DCMAKE_INSTALL_PREFIX=$serverPath/mysql \
@@ -102,7 +156,6 @@ Install_mysql()
else
# rm -rf ${mysqlDir}/mysql-5.5.62
echo "${VERSION}安装失败"
echo 'install fail'>&2
exit 1
fi
fi
+70 -16
View File
@@ -11,25 +11,57 @@ rootPath=$(dirname "$curPath")
rootPath=$(dirname "$rootPath")
serverPath=$(dirname "$rootPath")
sysName=`uname`
sysArch=`arch`
_os=`uname`
echo "use system: ${_os}"
if [ ${_os} == "Darwin" ]; then
OSNAME='macos'
elif grep -Eq "openSUSE" /etc/*-release; then
OSNAME='opensuse'
zypper refresh
elif grep -Eq "FreeBSD" /etc/*-release; then
OSNAME='freebsd'
pkg install -y wget unzip
elif grep -Eqi "Arch" /etc/issue || grep -Eq "Arch" /etc/*-release; then
OSNAME='arch'
echo y | pacman -Sy unzip
elif grep -Eqi "CentOS" /etc/issue || grep -Eq "CentOS" /etc/*-release; then
OSNAME='centos'
yum install -y wget zip unzip
elif grep -Eqi "Fedora" /etc/issue || grep -Eq "Fedora" /etc/*-release; then
OSNAME='fedora'
yum install -y wget zip unzip
elif grep -Eqi "Rocky" /etc/issue || grep -Eq "Rocky" /etc/*-release; then
OSNAME='rocky'
yum install -y wget zip unzip
elif grep -Eqi "AlmaLinux" /etc/issue || grep -Eq "AlmaLinux" /etc/*-release; then
OSNAME='alma'
yum install -y wget zip unzip
elif grep -Eqi "Debian" /etc/issue || grep -Eq "Debian" /etc/*-release; then
OSNAME='debian'
apt update -y
apt install -y devscripts
apt install -y wget zip unzip
elif grep -Eqi "Ubuntu" /etc/issue || grep -Eq "Ubuntu" /etc/*-release; then
OSNAME='ubuntu'
apt install -y wget zip unzip
else
OSNAME='unknow'
fi
VERSION_ID=`cat /etc/*-release | grep VERSION_ID | awk -F = '{print $2}' | awk -F "\"" '{print $2}'`
install_tmp=${rootPath}/tmp/mw_install.pl
mysqlDir=${serverPath}/source/mysql
VERSION=5.6.50
VERSION=5.6.51
Install_mysql()
{
mkdir -p ${mysqlDir}
echo '正在安装脚本文件...' > $install_tmp
if id mysql &> /dev/null ;then
echo "mysql UID is `id -u www`"
echo "mysql Shell is `grep "^www:" /etc/passwd |cut -d':' -f7 `"
else
groupadd mysql
useradd -g mysql mysql
fi
if [ "$sysName" != "Darwin" ];then
mkdir -p /var/log/mariadb
touch /var/log/mariadb/mariadb.log
@@ -69,6 +101,29 @@ Install_mysql()
cd ${mysqlDir} && tar -zxvf ${mysqlDir}/mysql-${VERSION}.tar.gz
fi
WHERE_DIR_GCC=/usr/bin/gcc
WHERE_DIR_GPP=/usr/bin/g++
if [ ! -f $WHERE_DIR_GCC ];then
WHERE_DIR_GCC=`which gcc`
fi
if [ ! -f $WHERE_DIR_GPP ];then
WHERE_DIR_GPP=`which g++`
fi
if [ "$OSNAME" == "ubuntu" ];then
apt install -y libudev-dev
apt install -y libtirpc-dev
apt install -y libssl-dev
apt install -y libgssglue-dev
apt install -y software-properties-common
add-apt-repository -y ppa:ubuntu-toolchain-r/test
export PKG_CONFIG_PATH=/usr/lib/pkgconfig
apt install -y gcc-11 g++-11
WHERE_DIR_GCC=/usr/bin/gcc-11
WHERE_DIR_GPP=/usr/bin/g++-11
fi
OPTIONS=''
##check openssl version
@@ -76,8 +131,8 @@ Install_mysql()
if [ "${OPENSSL_VERSION}" -ge "3" ];then
#openssl version to high
cd ${rootPath}/plugins/php/lib && /bin/bash openssl10.sh
export PKG_CONFIG_PATH=$serverPath/lib/openssl10/lib/pkgconfig
OPTIONS="-DWITH_SSL=${serverPath}/lib/openssl10"
export PKG_CONFIG_PATH=$serverPath/lib/openssl11/lib/pkgconfig
OPTIONS="-DWITH_SSL=${serverPath}/lib/openssl11"
fi
if [ ! -d $serverPath/mysql ];then
@@ -96,8 +151,8 @@ Install_mysql()
-DDEFAULT_CHARSET=utf8mb4 \
-DDEFAULT_COLLATION=utf8mb4_general_ci \
$OPTIONS \
-DCMAKE_C_COMPILER=/usr/bin/gcc \
-DCMAKE_CXX_COMPILER=/usr/bin/g++ \
-DCMAKE_C_COMPILER=$WHERE_DIR_GCC \
-DCMAKE_CXX_COMPILER=$WHERE_DIR_GPP \
-DCMAKE_CXX_STANDARD=11
make -j${cpuCore} && make install && make clean
@@ -108,9 +163,8 @@ Install_mysql()
echo '5.6' > $serverPath/mysql/version.pl
echo "${VERSION}安装完成"
else
# rm -rf ${mysqlDir}/mysql-5.6.50
# rm -rf ${mysqlDir}/mysql-5.6.*
echo "${VERSION}安装失败"
echo 'install fail'>&2
exit 1
fi
fi
@@ -119,7 +173,7 @@ Install_mysql()
Uninstall_mysql()
{
rm -rf $serverPath/mysql
echo '卸载完成' > $install_tmp
echo '卸载完成'
}
action=$1
+68 -14
View File
@@ -16,7 +16,46 @@ sysName=`uname`
install_tmp=${rootPath}/tmp/mw_install.pl
mysqlDir=${serverPath}/source/mysql
VERSION=5.7.39
VERSION=5.7.44
_os=`uname`
echo "use system: ${_os}"
if [ ${_os} == "Darwin" ]; then
OSNAME='macos'
elif grep -Eq "openSUSE" /etc/*-release; then
OSNAME='opensuse'
zypper refresh
elif grep -Eq "FreeBSD" /etc/*-release; then
OSNAME='freebsd'
pkg install -y wget unzip
elif grep -Eqi "Arch" /etc/issue || grep -Eq "Arch" /etc/*-release; then
OSNAME='arch'
echo y | pacman -Sy unzip
elif grep -Eqi "CentOS" /etc/issue || grep -Eq "CentOS" /etc/*-release; then
OSNAME='centos'
yum install -y wget zip unzip
elif grep -Eqi "Fedora" /etc/issue || grep -Eq "Fedora" /etc/*-release; then
OSNAME='fedora'
yum install -y wget zip unzip
elif grep -Eqi "Rocky" /etc/issue || grep -Eq "Rocky" /etc/*-release; then
OSNAME='rocky'
yum install -y wget zip unzip
elif grep -Eqi "AlmaLinux" /etc/issue || grep -Eq "AlmaLinux" /etc/*-release; then
OSNAME='alma'
yum install -y wget zip unzip
elif grep -Eqi "Debian" /etc/issue || grep -Eq "Debian" /etc/*-release; then
OSNAME='debian'
apt update -y
apt install -y devscripts
apt install -y wget zip unzip
elif grep -Eqi "Ubuntu" /etc/issue || grep -Eq "Ubuntu" /etc/*-release; then
OSNAME='ubuntu'
apt install -y wget zip unzip
else
OSNAME='unknow'
fi
VERSION_ID=`cat /etc/*-release | grep VERSION_ID | awk -F = '{print $2}' | awk -F "\"" '{print $2}'`
Install_mysql()
@@ -24,14 +63,6 @@ Install_mysql()
mkdir -p ${mysqlDir}
echo '正在安装脚本文件...' > $install_tmp
if id mysql &> /dev/null ;then
echo "mysql UID is `id -u www`"
echo "mysql Shell is `grep "^www:" /etc/passwd |cut -d':' -f7 `"
else
groupadd mysql
useradd -g mysql mysql
fi
if [ "$sysName" != "Darwin" ];then
mkdir -p /var/log/mariadb
touch /var/log/mariadb/mariadb.log
@@ -69,7 +100,7 @@ Install_mysql()
fi
#检测文件是否损坏.
md5_mysql_ok=d949b0ef81c3f52f7ef0874066244221
md5_mysql_ok=1a637fce4599d9bf5f1c81699f086274
if [ -f ${mysqlDir}/mysql-boost-${VERSION}.tar.gz ];then
md5_mysql=`md5sum ${mysqlDir}/mysql-boost-${VERSION}.tar.gz | awk '{print $1}'`
if [ "${md5_mysql_ok}" == "${md5_mysql}" ]; then
@@ -85,6 +116,30 @@ Install_mysql()
cd ${mysqlDir} && tar -zxvf ${mysqlDir}/mysql-boost-${VERSION}.tar.gz
fi
WHERE_DIR_GCC=/usr/bin/gcc
WHERE_DIR_GPP=/usr/bin/g++
if [ ! -f $WHERE_DIR_GCC ];then
WHERE_DIR_GCC=`which gcc`
fi
if [ ! -f $WHERE_DIR_GPP ];then
WHERE_DIR_GPP=`which g++`
fi
if [ "$OSNAME" == "ubuntu" ];then
apt install -y libudev-dev
apt install -y libtirpc-dev
apt install -y libssl-dev
apt install -y libgssglue-dev
apt install -y software-properties-common
add-apt-repository -y ppa:ubuntu-toolchain-r/test
export PKG_CONFIG_PATH=/usr/lib/pkgconfig
apt install -y gcc-11 g++-11
WHERE_DIR_GCC=/usr/bin/gcc-11
WHERE_DIR_GPP=/usr/bin/g++-11
fi
OPTIONS=''
##check openssl version
OPENSSL_VERSION=`openssl version|awk '{print $2}'|awk -F '.' '{print $1}'`
@@ -111,8 +166,8 @@ Install_mysql()
-DDEFAULT_COLLATION=utf8mb4_general_ci \
-DDOWNLOAD_BOOST=1 \
$OPTIONS \
-DCMAKE_C_COMPILER=/usr/bin/gcc \
-DCMAKE_CXX_COMPILER=/usr/bin/g++ \
-DCMAKE_C_COMPILER=${WHERE_DIR_GCC} \
-DCMAKE_CXX_COMPILER=${WHERE_DIR_GPP} \
-DWITH_BOOST=${mysqlDir}/mysql-${VERSION}/boost/
make -j${cpuCore} && make install && make clean
@@ -123,7 +178,6 @@ Install_mysql()
else
# rm -rf ${mysqlDir}/mysql-${VERSION}
echo "${VERSION}安装失败"
echo 'install fail'>&2
exit 1
fi
fi
@@ -132,7 +186,7 @@ Install_mysql()
Uninstall_mysql()
{
rm -rf $serverPath/mysql
echo '卸载完成' > $install_tmp
echo '卸载完成'
}
action=$1
+3 -13
View File
@@ -56,21 +56,12 @@ fi
VERSION_ID=`cat /etc/*-release | grep VERSION_ID | awk -F = '{print $2}' | awk -F "\"" '{print $2}'`
VERSION=8.0.34
VERSION=8.0.37
Install_mysql()
{
mkdir -p ${mysqlDir}
echo '正在安装脚本文件...' > $install_tmp
if id mysql &> /dev/null ;then
echo "mysql UID is `id -u www`"
echo "mysql Shell is `grep "^www:" /etc/passwd |cut -d':' -f7 `"
else
groupadd mysql
useradd -g mysql mysql
fi
# ----- cpu start ------
if [ -z "${cpuCore}" ]; then
cpuCore="1"
@@ -113,7 +104,7 @@ Install_mysql()
fi
#检测文件是否损坏.
md5_mysql_ok=c8cfab52fbde1cca55accb3113c235eb
md5_mysql_ok=e0cb61cbf6e1144c452368c4535ae931
if [ -f ${mysqlDir}/mysql-boost-${VERSION}.tar.gz ];then
md5_mysql=`md5sum ${mysqlDir}/mysql-boost-${VERSION}.tar.gz | awk '{print $1}'`
if [ "${md5_mysql_ok}" == "${md5_mysql}" ]; then
@@ -216,7 +207,6 @@ Install_mysql()
else
# rm -rf ${mysqlDir}/mysql-${VERSION}
echo "${VERSION}安装失败"
echo 'install fail'>&2
exit 1
fi
fi
@@ -225,7 +215,7 @@ Install_mysql()
Uninstall_mysql()
{
rm -rf $serverPath/mysql
echo '卸载完成' > $install_tmp
echo '卸载完成'
}
action=$1
+1 -11
View File
@@ -62,15 +62,6 @@ Install_mysql()
mkdir -p ${mysqlDir}
echo '正在安装脚本文件...' > $install_tmp
if id mysql &> /dev/null ;then
echo "mysql UID is `id -u www`"
echo "mysql Shell is `grep "^www:" /etc/passwd |cut -d':' -f7 `"
else
groupadd mysql
useradd -g mysql mysql
fi
# ----- cpu start ------
if [ -z "${cpuCore}" ]; then
cpuCore="1"
@@ -216,7 +207,6 @@ Install_mysql()
else
# rm -rf ${mysqlDir}/mysql-${VERSION}
echo "${VERSION}安装失败"
echo 'install fail'>&2
exit 1
fi
fi
@@ -225,7 +215,7 @@ Install_mysql()
Uninstall_mysql()
{
rm -rf $serverPath/mysql
echo '卸载完成' > $install_tmp
echo '卸载完成'
}
action=$1
+1 -11
View File
@@ -62,15 +62,6 @@ Install_mysql()
mkdir -p ${mysqlDir}
echo '正在安装脚本文件...' > $install_tmp
if id mysql &> /dev/null ;then
echo "mysql UID is `id -u www`"
echo "mysql Shell is `grep "^www:" /etc/passwd |cut -d':' -f7 `"
else
groupadd mysql
useradd -g mysql mysql
fi
# ----- cpu start ------
if [ -z "${cpuCore}" ]; then
cpuCore="1"
@@ -215,7 +206,6 @@ Install_mysql()
else
# rm -rf ${mysqlDir}/mysql-${VERSION}
echo "${VERSION}安装失败"
echo 'install fail'>&2
exit 1
fi
fi
@@ -224,7 +214,7 @@ Install_mysql()
Uninstall_mysql()
{
rm -rf $serverPath/mysql
echo '卸载完成' > $install_tmp
echo '卸载完成'
}
action=$1

Some files were not shown because too many files have changed in this diff Show More