commit
c955c12d1a
17 changed files with 2228 additions and 1222 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -3,3 +3,5 @@ build/mysqltuner.spec
|
||||||
build/build.log
|
build/build.log
|
||||||
build/cve*
|
build/cve*
|
||||||
build/vulnerabilities*
|
build/vulnerabilities*
|
||||||
|
*.bak
|
||||||
|
Vagrant/Vagrantfile
|
||||||
|
|
|
@ -27,7 +27,7 @@ following restrictions:
|
||||||
respect the opinions of others.
|
respect the opinions of others.
|
||||||
|
|
||||||
|
|
||||||
##Before submitting an issue##
|
## Before submitting an issue
|
||||||
|
|
||||||
1. Upgrade to the latest version of MySQLTuner and see if the problem remains
|
1. Upgrade to the latest version of MySQLTuner and see if the problem remains
|
||||||
|
|
||||||
|
@ -47,7 +47,7 @@ Good bug reports are extremely helpful — thank you!
|
||||||
|
|
||||||
Guidelines for bug reports:
|
Guidelines for bug reports:
|
||||||
|
|
||||||
1. **Use the [GitHub issue search](https://github.com/major/MySQLTuner-perl/search?type=Issues)** — check if the issue has already been
|
1. **Use the [GitHub issue search]** — check if the issue has already been
|
||||||
reported.
|
reported.
|
||||||
|
|
||||||
2. **Check if the bug has already been fixed** — try to reproduce it using the
|
2. **Check if the bug has already been fixed** — try to reproduce it using the
|
||||||
|
@ -100,13 +100,13 @@ to MySQLTuner will be evaluated on a combination of scope (how well it fits into
|
||||||
project), maintenance burden and general usefulness.
|
project), maintenance burden and general usefulness.
|
||||||
|
|
||||||
Creating something great often means saying no to seemingly good ideas. Don't
|
Creating something great often means saying no to seemingly good ideas. Don't
|
||||||
dispair if your feature request isn't accepted, take action! Fork the
|
despair if your feature request isn't accepted, take action! Fork the
|
||||||
repository, build your idea and share it with others. We released MySQLTuner under
|
repository, build your idea and share it with others. We released MySQLTuner under
|
||||||
the MIT License for this purpose precisely. Open source works best when smart
|
the MIT License for this purpose precisely. Open source works best when smart
|
||||||
and dedicated people riff off of each others' ideas to make even greater things.
|
and dedicated people riff off of each others' ideas to make even greater things.
|
||||||
|
|
||||||
## New feature request ##
|
## New feature request
|
||||||
* You can find Enhancement asked by community at [Enhancement issue](https://github.com/major/MySQLTuner-perl/labels/enhancement)
|
You can find Enhancement asked by community at [Enhancement issue]
|
||||||
|
|
||||||
<a name="pull-requests"></a>
|
<a name="pull-requests"></a>
|
||||||
## Pull requests
|
## Pull requests
|
||||||
|
@ -153,8 +153,7 @@ these guidelines is the best way to get your work included in MySQLTuner.
|
||||||
git checkout -b <topic-branch-name>
|
git checkout -b <topic-branch-name>
|
||||||
```
|
```
|
||||||
|
|
||||||
4. Commit your changes in logical chunks. Please adhere to these [git commit
|
4. Commit your changes in logical chunks. Please adhere to these [git commit message guidelines]
|
||||||
message guidelines](http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html)
|
|
||||||
or your code is unlikely be merged into the main project. Use Git's
|
or your code is unlikely be merged into the main project. Use Git's
|
||||||
[interactive rebase](https://help.github.com/articles/interactive-rebase)
|
[interactive rebase](https://help.github.com/articles/interactive-rebase)
|
||||||
feature to tidy up your commits before making them public.
|
feature to tidy up your commits before making them public.
|
||||||
|
@ -171,18 +170,23 @@ these guidelines is the best way to get your work included in MySQLTuner.
|
||||||
git push origin <topic-branch-name>
|
git push origin <topic-branch-name>
|
||||||
```
|
```
|
||||||
|
|
||||||
7. [Open a Pull Request](https://help.github.com/articles/using-pull-requests/)
|
7. [Open a Pull Request] with a clear title and description.
|
||||||
with a clear title and description.
|
|
||||||
|
|
||||||
**IMPORTANT**: By submitting a patch, you agree to allow the project owner to
|
**IMPORTANT**: By submitting a patch, you agree to allow the project owner to
|
||||||
license your work under the [GPLv3 License](https://en.wikipedia.org/wiki/GNU_General_Public_License).
|
license your work under the [GPLv3 License].
|
||||||
|
|
||||||
Copy of the license is available at [LICENSE](https://github.com/major/MySQLTuner-perl/blob/master/LICENSE)
|
Copy of the license is available at [LICENSE]
|
||||||
|
|
||||||
<a name="code-conventions"></a>
|
<a name="code-conventions"></a>
|
||||||
#### MySQLTuner Code Conventions
|
## MySQLTuner Code Conventions
|
||||||
|
|
||||||
1. Check code convention using **perltidy** and **perlcritic**
|
1. Check code convention using **perltidy** and **perlcritic**
|
||||||
2. Don't manually update the version number in `mysqltuner.pl`.
|
2. Don't manually update the version number in `mysqltuner.pl`.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
[Enhancement issue]:https://github.com/major/MySQLTuner-perl/labels/enhancement
|
||||||
|
[GitHub issue search]:https://github.com/major/MySQLTuner-perl/search?type=Issues
|
||||||
|
[git commit message guidelines]:http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html
|
||||||
|
[Open a Pull Request]:https://help.github.com/articles/using-pull-requests/
|
||||||
|
[GPLv3 License]:https://en.wikipedia.org/wiki/GNU_General_Public_License
|
||||||
|
[LICENSE]:https://github.com/major/MySQLTuner-perl/blob/master/LICENSE
|
||||||
|
|
63
INTERNALS.md
63
INTERNALS.md
|
@ -72,7 +72,7 @@
|
||||||
## MySQLTuner system checks
|
## MySQLTuner system checks
|
||||||
* 32-bit w/>2GB RAM check
|
* 32-bit w/>2GB RAM check
|
||||||
* Check number of opened ports (warning if more than 9 ports opened)
|
* Check number of opened ports (warning if more than 9 ports opened)
|
||||||
* Check 80, 8080, 443 and 8443 ports if warning are raised if there are opened
|
* Check 80, 8080, 443 and 8443 ports if warning are raised if there are opened
|
||||||
* Check if some banned ports are not opened (option --bannedports separated by comma)
|
* Check if some banned ports are not opened (option --bannedports separated by comma)
|
||||||
* Check if non kernel and user process except mysqld are not using more than 15% of total physical memory)
|
* Check if non kernel and user process except mysqld are not using more than 15% of total physical memory)
|
||||||
* Check vm.swapiness
|
* Check vm.swapiness
|
||||||
|
@ -84,7 +84,7 @@
|
||||||
|
|
||||||
## MySQLTuner Server version checks
|
## MySQLTuner Server version checks
|
||||||
* EOL MySQL version check
|
* EOL MySQL version check
|
||||||
* Currently MySQL < 5.1 are EOF considerated.
|
* Currently MySQL < 5.1 are EOF considered.
|
||||||
* Using 5.5+ version of MySQL for performance issue (asynchronous IO).
|
* Using 5.5+ version of MySQL for performance issue (asynchronous IO).
|
||||||
|
|
||||||
## MySQL Storage engine general information
|
## MySQL Storage engine general information
|
||||||
|
@ -103,7 +103,7 @@
|
||||||
* Users w/o host restriction
|
* Users w/o host restriction
|
||||||
* Weak password check (possibly using cracklib later?)
|
* Weak password check (possibly using cracklib later?)
|
||||||
* Using basic_passwords.txt as password database
|
* Using basic_passwords.txt as password database
|
||||||
* Password list checks can be avoid (option: --skippassword)
|
* Password list checks can be avoid (option: --skippassword)
|
||||||
|
|
||||||
## MySQLTuner CVE vulnerabilities detection
|
## MySQLTuner CVE vulnerabilities detection
|
||||||
|
|
||||||
|
@ -131,7 +131,7 @@
|
||||||
* Per index information
|
* Per index information
|
||||||
* Index Cardinality
|
* Index Cardinality
|
||||||
* Index Selectivity
|
* Index Selectivity
|
||||||
* Misc information about index definition
|
* Misc information about index definition
|
||||||
* Misc information about index size
|
* Misc information about index size
|
||||||
|
|
||||||
## MySQLTuner Connections information
|
## MySQLTuner Connections information
|
||||||
|
@ -179,8 +179,8 @@
|
||||||
* Query Cache Buffers
|
* Query Cache Buffers
|
||||||
* Query Cache DISABLED, ALL REQUEST or ON DEMAND
|
* Query Cache DISABLED, ALL REQUEST or ON DEMAND
|
||||||
* Query Cache Size
|
* Query Cache Size
|
||||||
* Query cache hit ratio (cache efficienty)
|
* Query cache hit ratio (cache efficiency)
|
||||||
|
|
||||||
## MySQLTuner memory checks
|
## MySQLTuner memory checks
|
||||||
|
|
||||||
* Get total RAM/swap
|
* Get total RAM/swap
|
||||||
|
@ -194,11 +194,16 @@
|
||||||
|
|
||||||
## MySQLTuner replication checks
|
## MySQLTuner replication checks
|
||||||
|
|
||||||
* Is server replication configuarted as slave ?
|
* Is server replication configured as slave ?
|
||||||
* SQL replacation thread running ?
|
* SQL replication thread running ?
|
||||||
* IO replacation thread running ?
|
* IO replication thread running ?
|
||||||
* Replication lag in seconds
|
* Replication lag in seconds (Seconds_behind_master)
|
||||||
* Is Slave configuratedd in read only ?
|
* Is Slave configured in read only ?
|
||||||
|
* replication type ROW, MIX, STMT
|
||||||
|
* replication Semisync master
|
||||||
|
* replication Semisync slave
|
||||||
|
* XA support activated
|
||||||
|
* replication started ?
|
||||||
|
|
||||||
## MySQLTuner InnoDB information
|
## MySQLTuner InnoDB information
|
||||||
|
|
||||||
|
@ -206,14 +211,16 @@
|
||||||
* If possible, innodb_buffer_pool_size should be greater data and index size for Innodb Table
|
* If possible, innodb_buffer_pool_size should be greater data and index size for Innodb Table
|
||||||
* Innodb_buffer_pool_size should around 75 to 80 % of the available system memory.
|
* Innodb_buffer_pool_size should around 75 to 80 % of the available system memory.
|
||||||
* InnoDB Buffer Pool Instances
|
* InnoDB Buffer Pool Instances
|
||||||
* MySQL needs 1 instanes per 1Go of Buffer Pool
|
* MySQL needs 1 instance per 1Go of Buffer Pool
|
||||||
* innodb_buffer_pool instances = round(innodb_buffer_pool_size / 1Go)
|
* innodb_buffer_pool instances = round(innodb_buffer_pool_size / 1Go)
|
||||||
* innodb_buffer_pool instances must be equals or lower than 64
|
* innodb_buffer_pool instances must be equals or lower than 64
|
||||||
* InnoDB Buffer Pool Usage
|
* InnoDB Buffer Pool Usage
|
||||||
* If more than 20% of InnoDB buffer pool is not used, MySQLTuner raise an alert.
|
* If more than 20% of InnoDB buffer pool is not used, MySQLTuner raise an alert.
|
||||||
* InnoDB Read effiency
|
* InnoDB Buffer Pool Log Size
|
||||||
|
* InnoDB total log file size should be 25% of innodb_buffer_pool_size
|
||||||
|
* InnoDB Read efficiency
|
||||||
* Ratio of read without locks
|
* Ratio of read without locks
|
||||||
* InnoDB Write effiency
|
* InnoDB Write efficiency
|
||||||
* Ratio of write without locks
|
* Ratio of write without locks
|
||||||
* InnoDB Log Waits
|
* InnoDB Log Waits
|
||||||
* Checks that no lock is used on Innodb Log.
|
* Checks that no lock is used on Innodb Log.
|
||||||
|
@ -225,7 +232,7 @@
|
||||||
* Is Aria indexes size is greater than page cache size ?
|
* Is Aria indexes size is greater than page cache size ?
|
||||||
* Page cache read hit ratio (>95%)
|
* Page cache read hit ratio (>95%)
|
||||||
* Page cache write hit ratio (>95%)
|
* Page cache write hit ratio (>95%)
|
||||||
|
|
||||||
|
|
||||||
## MySQLTuner MYISAM information
|
## MySQLTuner MYISAM information
|
||||||
|
|
||||||
|
@ -249,6 +256,10 @@
|
||||||
* Joiner(Try to reach cluster group)
|
* Joiner(Try to reach cluster group)
|
||||||
* SYNCED state able to read/write
|
* SYNCED state able to read/write
|
||||||
* wsrep_cluster_conf_id configuration level must be identical in all nodes
|
* wsrep_cluster_conf_id configuration level must be identical in all nodes
|
||||||
|
* wsrep_slave_thread is between 3 or 4 times number of CPU core.
|
||||||
|
* gcs.limit should be equal to wsrep_slave_threads * 5
|
||||||
|
* gcs.fc_factor should be equal to 0.8
|
||||||
|
* Flow control fraction should be lower than 0.02 (wsrep_flow_control_paused < 0.02)
|
||||||
* wsrep_last_commited committed level must be identical in all nodes
|
* wsrep_last_commited committed level must be identical in all nodes
|
||||||
* Look for tables without primary keys
|
* Look for tables without primary keys
|
||||||
* Look for non InnoDB tables for Galera
|
* Look for non InnoDB tables for Galera
|
||||||
|
@ -260,13 +271,13 @@
|
||||||
|
|
||||||
## MySQLTuner TokuDB information
|
## MySQLTuner TokuDB information
|
||||||
|
|
||||||
* tokudb_cache_size
|
* tokudb_cache_size
|
||||||
* tokudb_directio
|
* tokudb_directio
|
||||||
* tokudb_empty_scan
|
* tokudb_empty_scan
|
||||||
* tokudb_read_block_size
|
* tokudb_read_block_size
|
||||||
* tokudb_commit_sync
|
* tokudb_commit_sync
|
||||||
* tokudb_checkpointing_period
|
* tokudb_checkpointing_period
|
||||||
* tokudb_block_size
|
* tokudb_block_size
|
||||||
* tokudb_cleaner_iterations
|
* tokudb_cleaner_iterations
|
||||||
* tokudb_fanout
|
* tokudb_fanout
|
||||||
|
|
||||||
|
@ -285,14 +296,16 @@
|
||||||
## MySQLTuner RocksDb information
|
## MySQLTuner RocksDb information
|
||||||
|
|
||||||
* Nothing for the moment
|
* Nothing for the moment
|
||||||
|
|
||||||
## MySQLTuner Thread pool information
|
## MySQLTuner Thread pool information
|
||||||
|
|
||||||
* thread_pool_size between 16 to 36 for Innodb usage
|
* thread_pool_size between 16 to 36 for Innodb usage
|
||||||
* thread_pool_size between 4 to 8 for MyIsam usage
|
* thread_pool_size between 4 to 8 for MyIsam usage
|
||||||
|
|
||||||
## MySQLTuner performance schema and sysschema information
|
## MySQLTuner performance schema and sysschema information
|
||||||
|
* Check that Performance schema is activated for 5.6+ version
|
||||||
|
* Check that Performance schema is deactivated for 5.5- version
|
||||||
|
* Check that Sys schema is installed
|
||||||
* sys Schema version
|
* sys Schema version
|
||||||
* Top user per connection
|
* Top user per connection
|
||||||
* Top user per statement
|
* Top user per statement
|
||||||
|
@ -346,9 +359,9 @@
|
||||||
* Event per wait total latency
|
* Event per wait total latency
|
||||||
* Event per wait read latency
|
* Event per wait read latency
|
||||||
* Event per wait write latency
|
* Event per wait write latency
|
||||||
* TOP 15 most read indexes
|
* TOP 15 most read indexes
|
||||||
* TOP 15 most modified indexes
|
* TOP 15 most modified indexes
|
||||||
* TOP 15 high select latency index
|
* TOP 15 high select latency index
|
||||||
* TOP 15 high insert latency index
|
* TOP 15 high insert latency index
|
||||||
* TOP 15 high update latency index
|
* TOP 15 high update latency index
|
||||||
* TOP 15 high delete latency index
|
* TOP 15 high delete latency index
|
||||||
|
@ -377,7 +390,7 @@
|
||||||
* TOP 15 merge queries with sort
|
* TOP 15 merge queries with sort
|
||||||
* TOP 15 average sort merges queries with sort
|
* TOP 15 average sort merges queries with sort
|
||||||
* TOP 15 scans queries with sort
|
* TOP 15 scans queries with sort
|
||||||
* TOP 15 range queries with sort
|
* TOP 15 range queries with sort
|
||||||
* Top 20 queries with temp table
|
* Top 20 queries with temp table
|
||||||
* Last 50 queries with temp table
|
* Last 50 queries with temp table
|
||||||
* TOP 15 total latency queries with temp table
|
* TOP 15 total latency queries with temp table
|
||||||
|
@ -387,4 +400,4 @@
|
||||||
* TOP 15 class events by total latency
|
* TOP 15 class events by total latency
|
||||||
* TOP 30 events by total latency
|
* TOP 30 events by total latency
|
||||||
* TOP 15 class events by max latency
|
* TOP 15 class events by max latency
|
||||||
* TOP 30 events by max latency
|
* TOP 30 events by max latency
|
||||||
|
|
84
README.md
84
README.md
|
@ -4,17 +4,17 @@ MySQLTuner-perl
|
||||||
[](http://opensource.box.com/badges)
|
[](http://opensource.box.com/badges)
|
||||||
[](http://opensource.box.com/badges)
|
[](http://opensource.box.com/badges)
|
||||||
[](http://isitmaintained.com/project/major/MySQLTuner-perl "Average time to resolve an issue")
|
[](http://isitmaintained.com/project/major/MySQLTuner-perl "Average time to resolve an issue")
|
||||||
[](http://isitmaintained.com/project/major/MySQLTuner-perl "Percentage of issues still open")
|
[](http://isitmaintained.com/project/major/MySQLTuner-perl "Percentage of issues still open")
|
||||||
[](https://opensource.org/licenses/GPL-3.0/)
|
[](https://opensource.org/licenses/GPL-3.0/)
|
||||||
|
|
||||||
**MySQLTuner** is a script written in Perl that allows you to review a MySQL installation quickly and make adjustments to increase performance and stability. The current configuration variables and status data is retrieved and presented in a brief format along with some basic performance suggestions.
|
**MySQLTuner** is a script written in Perl that allows you to review a MySQL installation quickly and make adjustments to increase performance and stability. The current configuration variables and status data is retrieved and presented in a brief format along with some basic performance suggestions.
|
||||||
|
|
||||||
**MySQLTuner** supports in this last version ~300 indicators for MySQL/MariaDB/Percona Server.
|
**MySQLTuner** supports ~300 indicators for MySQL/MariaDB/Percona Server in this last version.
|
||||||
|
|
||||||
**MySQLTuner** is maintained and indicator collect is increasing week after week supporting a lot of configuration such as , , , Linux OS metrics, , , , ...
|
**MySQLTuner** is maintained and indicator collect is increasing week after week supporting a lot of configuration such as [Galera Cluster](http://galeracluster.com/), [TokuDB](https://www.percona.com/software/mysql-database/percona-tokudb), [Performance schema](https://github.com/mysql/mysql-sys), Linux OS metrics, [InnoDB](http://dev.mysql.com/doc/refman/5.7/en/innodb-storage-engine.html), [MyISAM](http://dev.mysql.com/doc/refman/5.7/en/myisam-storage-engine.html), [Aria](https://mariadb.com/kb/en/mariadb/aria/), ...
|
||||||
|
|
||||||
You can found more details on this indicators
|
You can find more details on these indicators here:
|
||||||
.
|
[Indicators description](https://github.com/major/MySQLTuner-perl/blob/master/INTERNALS.md).
|
||||||
|
|
||||||
|
|
||||||

|

|
||||||
|
@ -22,20 +22,23 @@ You can found more details on this indicators
|
||||||
MySQLTuner needs you:
|
MySQLTuner needs you:
|
||||||
===
|
===
|
||||||
|
|
||||||
**MySQLTuner** needs contributors for documentation, code and feedbacks..
|
**MySQLTuner** needs contributors for documentation, code and feedback..
|
||||||
|
|
||||||
* Please join us on issue track at [GitHub tracker](https://github.com/major/MySQLTuner-perl/issues)</a>.
|
* Please join us on issue track at [GitHub tracker](https://github.com/major/MySQLTuner-perl/issues).
|
||||||
* Contribution guide is available following [MySQLTuner contributing guide](https://github.com/major/MySQLTuner-perl/blob/master/CONTRIBUTING.md)
|
* Contribution guide is available following [MySQLTuner contributing guide](https://github.com/major/MySQLTuner-perl/blob/master/CONTRIBUTING.md)
|
||||||
* Star **MySQLTuner project** at [MySQLTuner Git Hub Project](https://github.com/major/MySQLTuner-perl)
|
* Star **MySQLTuner project** at [MySQLTuner Git Hub Project](https://github.com/major/MySQLTuner-perl)
|
||||||
|
|
||||||
Compatibility:
|
Compatibility:
|
||||||
====
|
====
|
||||||
|
|
||||||
* MySQL 5.7 (full support)
|
* MySQL 5.7 (full support)
|
||||||
* MySQL 5.6 (full support)
|
* MySQL 5.6 (full support)
|
||||||
* MySQL 5.5 (full support)
|
* MySQL 5.5 (full support)
|
||||||
|
* MariaDB 10.3 (full support)
|
||||||
|
* MariaDB 10.2 (full support)
|
||||||
* MariaDB 10.1 (full support)
|
* MariaDB 10.1 (full support)
|
||||||
* MariaDB 10.0 (full support)
|
* MariaDB 10.0 (full support)
|
||||||
|
* Percona Server 5.7 (full support)
|
||||||
* Percona Server 5.6 (full support)
|
* Percona Server 5.6 (full support)
|
||||||
* Percona XtraDB cluster (full support)
|
* Percona XtraDB cluster (full support)
|
||||||
* MySQL 3.23, 4.0, 4.1, 5.0, 5.1 (partial support - deprecated version)
|
* MySQL 3.23, 4.0, 4.1, 5.0, 5.1 (partial support - deprecated version)
|
||||||
|
@ -43,21 +46,29 @@ Compatibility:
|
||||||
* Unix/Linux based operating system (tested on Linux, BSD variants, and Solaris variants)
|
* Unix/Linux based operating system (tested on Linux, BSD variants, and Solaris variants)
|
||||||
* Windows is not supported at this time (Help wanted !!!!!)
|
* Windows is not supported at this time (Help wanted !!!!!)
|
||||||
* Unrestricted read access to the MySQL server (OS root access recommended for MySQL < 5.1)
|
* Unrestricted read access to the MySQL server (OS root access recommended for MySQL < 5.1)
|
||||||
* CVE vulnerabilites detection support from [https://cve.mitre.org](https://cve.mitre.org)
|
* CVE vulnerabilities detection support from [https://cve.mitre.org](https://cve.mitre.org)
|
||||||
|
|
||||||
***WARNING***
|
***WARNING***
|
||||||
--
|
--
|
||||||
It is **extremely important** for you to fully understand each change
|
It is **extremely important** for you to fully understand each change
|
||||||
you make to a MySQL database server. If you don't understand portions
|
you make to a MySQL database server. If you don't understand portions
|
||||||
of the script's output, or if you don't understand the recommendations,
|
of the script's output, or if you don't understand the recommendations,
|
||||||
**you should consult** a knowledgeable DBA or system administrator
|
**you should consult** a knowledgeable DBA or system administrator
|
||||||
that you trust. **Always** test your changes on staging environments, and
|
that you trust. **Always** test your changes on staging environments, and
|
||||||
always keep in mind that improvements in one area can **negatively affect**
|
always keep in mind that improvements in one area can **negatively affect**
|
||||||
MySQL in other areas.
|
MySQL in other areas.
|
||||||
|
|
||||||
**Seriously - please review the FAQ section below.**
|
**Seriously - please review the FAQ section below.**
|
||||||
|
|
||||||
What MySQLTuner is checking exactly ?
|
|
||||||
|
Security recommendations
|
||||||
|
--
|
||||||
|
|
||||||
|
Hi directadmin user!
|
||||||
|
We detected that you run mysqltuner with da_admin's credentials taken from /usr/local/directadmin/conf/my.cnf, which might bring to a password discovery!
|
||||||
|
Read link for more details [Issue #289](https://github.com/major/MySQLTuner-perl/issues/289).
|
||||||
|
|
||||||
|
What MySQLTuner is checking exactly ?
|
||||||
--
|
--
|
||||||
All checks done by **MySQLTuner** are documented in [MySQLTuner Internals](https://github.com/major/MySQLTuner-perl/blob/master/INTERNALS.md) documentation.
|
All checks done by **MySQLTuner** are documented in [MySQLTuner Internals](https://github.com/major/MySQLTuner-perl/blob/master/INTERNALS.md) documentation.
|
||||||
|
|
||||||
|
@ -70,7 +81,7 @@ You can download the entire repository by using 'git clone' followed by the clon
|
||||||
wget https://raw.githubusercontent.com/major/MySQLTuner-perl/master/basic_passwords.txt -O basic_passwords.txt
|
wget https://raw.githubusercontent.com/major/MySQLTuner-perl/master/basic_passwords.txt -O basic_passwords.txt
|
||||||
wget https://raw.githubusercontent.com/major/MySQLTuner-perl/master/vulnerabilities.csv -O vulnerabilities.csv
|
wget https://raw.githubusercontent.com/major/MySQLTuner-perl/master/vulnerabilities.csv -O vulnerabilities.csv
|
||||||
perl mysqltuner.pl
|
perl mysqltuner.pl
|
||||||
|
|
||||||
Of course, you can add the execute bit (`chmod +x mysqltuner.pl`) so you can execute it without calling perl directly.
|
Of course, you can add the execute bit (`chmod +x mysqltuner.pl`) so you can execute it without calling perl directly.
|
||||||
|
|
||||||
Specific usage
|
Specific usage
|
||||||
|
@ -78,17 +89,17 @@ Specific usage
|
||||||
|
|
||||||
__Usage:__ Minimal usage locally
|
__Usage:__ Minimal usage locally
|
||||||
|
|
||||||
perl mysqltuner.pl
|
perl mysqltuner.pl
|
||||||
|
|
||||||
__Usage:__ Minimal usage remotely
|
__Usage:__ Minimal usage remotely
|
||||||
|
|
||||||
perl mysqltuner.pl --host targetDNS_IP --user admin_user --pass admin_password
|
perl mysqltuner.pl --host targetDNS_IP --user admin_user --pass admin_password
|
||||||
|
|
||||||
__Usage:__ Enable maximum output information around MySQL/MariaDb without debugging
|
__Usage:__ Enable maximum output information around MySQL/MariaDb without debugging
|
||||||
|
|
||||||
perl mysqltuner.pl --verbose
|
perl mysqltuner.pl --verbose
|
||||||
perl mysqltuner.pl --buffers --dbstat --idxstat --sysstat --pfstat
|
perl mysqltuner.pl --buffers --dbstat --idxstat --sysstat --pfstat
|
||||||
|
|
||||||
|
|
||||||
__Usage:__ Enable CVE vulnerabilities check for your MariaDB or MySQL version
|
__Usage:__ Enable CVE vulnerabilities check for your MariaDB or MySQL version
|
||||||
|
|
||||||
|
@ -98,7 +109,7 @@ __Usage:__ Write your result in a file with information displayed
|
||||||
|
|
||||||
perl mysqltuner.pl --outputfile /tmp/result_mysqltuner.txt
|
perl mysqltuner.pl --outputfile /tmp/result_mysqltuner.txt
|
||||||
|
|
||||||
__Usage:__ Write your result in a file **without outputting information**
|
__Usage:__ Write your result in a file **without outputting information**
|
||||||
|
|
||||||
perl mysqltuner.pl --silent --outputfile /tmp/result_mysqltuner.txt
|
perl mysqltuner.pl --silent --outputfile /tmp/result_mysqltuner.txt
|
||||||
|
|
||||||
|
@ -106,7 +117,7 @@ __Usage:__ Using template model to customize your reporting file based on [Text:
|
||||||
|
|
||||||
perl mysqltuner.pl --silent --reportfile /tmp/result_mysqltuner.txt --template=/tmp/mymodel.tmpl
|
perl mysqltuner.pl --silent --reportfile /tmp/result_mysqltuner.txt --template=/tmp/mymodel.tmpl
|
||||||
|
|
||||||
__Usage:__ Enable debugging information
|
__Usage:__ Enable debugging information
|
||||||
|
|
||||||
perl mysqltuner.pl --debug
|
perl mysqltuner.pl --debug
|
||||||
|
|
||||||
|
@ -115,7 +126,7 @@ FAQ
|
||||||
|
|
||||||
**Question: Will MySQLTuner fix my slow MySQL server?**
|
**Question: Will MySQLTuner fix my slow MySQL server?**
|
||||||
|
|
||||||
**No.** MySQLTuner is a read only script. It won't write to any configuration files, change the status of any daemons, or call your mother to wish her a happy birthday. It will give you an overview of your server's performance and make some basic recommendations about improvements that you can make after it completes. *Make sure you read the warning above prior to following any recommendations.*
|
**No.** MySQLTuner is a read only script. It won't write to any configuration files, change the status of any daemons, or call your mother to wish her a happy birthday. It will give you an overview of your server's performance and make some basic recommendations for improvements that you can make after it completes. *Make sure you read the warning above prior to following any recommendations.*
|
||||||
|
|
||||||
**Question: Can I fire my DBA now?**
|
**Question: Can I fire my DBA now?**
|
||||||
|
|
||||||
|
@ -128,7 +139,7 @@ The script will try its best to log in via any means possible. It will check fo
|
||||||
[client]
|
[client]
|
||||||
user=someusername
|
user=someusername
|
||||||
pass=thatuserspassword
|
pass=thatuserspassword
|
||||||
|
|
||||||
Once you create it, make sure it's owned by your user and the mode on the file is 0600. This should prevent the prying eyes from getting your database login credentials under normal conditions. If a [T-1000 shows up in a LAPD uniform](https://en.wikipedia.org/wiki/T-1000) and demands your database credentials, you won't have much of an option.
|
Once you create it, make sure it's owned by your user and the mode on the file is 0600. This should prevent the prying eyes from getting your database login credentials under normal conditions. If a [T-1000 shows up in a LAPD uniform](https://en.wikipedia.org/wiki/T-1000) and demands your database credentials, you won't have much of an option.
|
||||||
|
|
||||||
**Question: Is there another way to secure credentials on latest MySQL and MariaDB distributions ?**
|
**Question: Is there another way to secure credentials on latest MySQL and MariaDB distributions ?**
|
||||||
|
@ -136,10 +147,10 @@ Once you create it, make sure it's owned by your user and the mode on the file i
|
||||||
You could use mysql_config_editor utilities.
|
You could use mysql_config_editor utilities.
|
||||||
|
|
||||||
$ mysql_config_editor set --login-path=client --user=someusername --password --host=localhost
|
$ mysql_config_editor set --login-path=client --user=someusername --password --host=localhost
|
||||||
Enter passord: ********
|
Enter password: ********
|
||||||
$
|
$
|
||||||
|
|
||||||
At this time, ~/.mylogin.cnf has been written with appropriated rigth access.
|
After which, ~/.mylogin.cnf will be created with the appropriate access.
|
||||||
|
|
||||||
To get information about stored credentials, use the following command:
|
To get information about stored credentials, use the following command:
|
||||||
|
|
||||||
|
@ -179,9 +190,9 @@ Connection and Authentication
|
||||||
--host <hostname> Connect to a remote host to perform tests (default: localhost)
|
--host <hostname> Connect to a remote host to perform tests (default: localhost)
|
||||||
--socket <socket> Use a different socket for a local connection
|
--socket <socket> Use a different socket for a local connection
|
||||||
--port <port> Port to use for connection (default: 3306)
|
--port <port> Port to use for connection (default: 3306)
|
||||||
--user <username> Username to use for authentication
|
--user <username> Username to use for authentication
|
||||||
--pass <password> Password to use for authentication
|
--pass <password> Password to use for authentication
|
||||||
--defaults-file <path> defaulfs file for credentials
|
--defaults-file <path> defaults file for credentials
|
||||||
|
|
||||||
Since you are using a remote host, use parameters to supply values from the OS
|
Since you are using a remote host, use parameters to supply values from the OS
|
||||||
|
|
||||||
|
@ -195,6 +206,10 @@ If the database has too many tables, or very large table, use this:
|
||||||
--skipsize Don't enumerate tables and their types/sizes (default: on)
|
--skipsize Don't enumerate tables and their types/sizes (default: on)
|
||||||
(Recommended for servers with many tables)
|
(Recommended for servers with many tables)
|
||||||
|
|
||||||
|
**Question: Can I install this project using homebrew on Apple Macintosh?**
|
||||||
|
|
||||||
|
Yes! `brew install mysqltuner` can be used to install this application using [homebrew](https://brew.sh/) on Apple Macintosh.
|
||||||
|
|
||||||
MySQLTuner and Vagrant
|
MySQLTuner and Vagrant
|
||||||
--
|
--
|
||||||
**MySQLTuner** contains following Vagrant configurations:
|
**MySQLTuner** contains following Vagrant configurations:
|
||||||
|
@ -202,8 +217,8 @@ MySQLTuner and Vagrant
|
||||||
* Fedora Core 23 / MariaDB 10.1
|
* Fedora Core 23 / MariaDB 10.1
|
||||||
* Fedora Core 23 / MySQL 5.6
|
* Fedora Core 23 / MySQL 5.6
|
||||||
* Fedora Core 23 / MySQL 5.7
|
* Fedora Core 23 / MySQL 5.7
|
||||||
|
|
||||||
**Vagrant File** are stored in Vagrant subdirectory.
|
**Vagrant File** are stored in Vagrant subdirectory.
|
||||||
* Follow this 2 steps after vagrant installation:
|
* Follow this 2 steps after vagrant installation:
|
||||||
* Rename VagrantFile_for_Mxxx into Vagrantfile
|
* Rename VagrantFile_for_Mxxx into Vagrantfile
|
||||||
* vagrant up
|
* vagrant up
|
||||||
|
@ -228,9 +243,8 @@ MySQLTuner and Vagrant
|
||||||
|
|
||||||
MySQLTuner needs you
|
MySQLTuner needs you
|
||||||
--
|
--
|
||||||
**MySQLTuner** needs contributors for documentation, code and feedbacks..
|
**MySQLTuner** needs contributors for documentation, code and feedback..
|
||||||
|
|
||||||
* Please join us on issue track at [GitHub tracker](https://github.com/major/MySQLTuner-perl/issues)</a>.
|
* Please join us on issue track at [GitHub tracker](https://github.com/major/MySQLTuner-perl/issues).
|
||||||
* Contribution guide is avalaible following [MySQLTuner contributing guide](https://github.com/major/MySQLTuner-perl/blob/master/CONTRIBUTING.md)
|
* Contribution guide is available following [MySQLTuner contributing guide](https://github.com/major/MySQLTuner-perl/blob/master/CONTRIBUTING.md)
|
||||||
* Star **MySQLTuner project** at [MySQLTuner Git Hub Project](https://github.com/major/MySQLTuner-perl)
|
* Star **MySQLTuner project** at [MySQLTuner Git Hub Project](https://github.com/major/MySQLTuner-perl)
|
||||||
|
|
||||||
|
|
22
README.ru.md
22
README.ru.md
|
@ -13,10 +13,11 @@ MySQLTuner-perl
|
||||||
|
|
||||||
**MySQLTuner** поддерживает порядка 300 показателей для MySQL/MariaDB/Percona Server последних версий.
|
**MySQLTuner** поддерживает порядка 300 показателей для MySQL/MariaDB/Percona Server последних версий.
|
||||||
|
|
||||||
**MySQLTuner** поддерживает сбор показателей для множества таких конфигураций, как , , , Linux OS metrics, , , , ...
|
**MySQLTuner** поддерживает сбор показателей для множества таких конфигураций, как [Galera Cluster](http://galeracluster.com/), [TokuDB](https://www.percona.com/software/mysql-database/percona-tokudb), [Performance schema](https://github.com/mysql/mysql-sys), метрики ОС Linux, [InnoDB](http://dev.mysql.com/doc/refman/5.7/en/innodb-storage-engine.html), [MyISAM](http://dev.mysql.com/doc/refman/5.7/en/myisam-storage-engine.html), [Aria](https://mariadb.com/kb/en/mariadb/aria/), ...
|
||||||
|
|
||||||
|
|
||||||
Вы можете найти больше информации об этих показателях на
|
Вы можете найти больше информации об этих показателях на
|
||||||
.
|
[Indicators description](https://github.com/major/MySQLTuner-perl/blob/master/INTERNALS.md).
|
||||||
|
|
||||||
|
|
||||||

|

|
||||||
|
@ -26,7 +27,7 @@ MySQLTuner нуждается в вас:
|
||||||
|
|
||||||
**MySQLTuner** нуждается в вашем вкладе в документацию и код, а так же ждёт обратную связь.
|
**MySQLTuner** нуждается в вашем вкладе в документацию и код, а так же ждёт обратную связь.
|
||||||
|
|
||||||
* Присоединяйтесь, пожалуйста, к нашему трекеру ошибок [GitHub tracker](https://github.com/major/MySQLTuner-perl/issues)</a>.
|
* Присоединяйтесь, пожалуйста, к нашему трекеру ошибок [GitHub tracker](https://github.com/major/MySQLTuner-perl/issues).
|
||||||
* Руководство по поддержке проекта доступно на [MySQLTuner contributing guide](https://github.com/major/MySQLTuner-perl/blob/master/CONTRIBUTING.md)
|
* Руководство по поддержке проекта доступно на [MySQLTuner contributing guide](https://github.com/major/MySQLTuner-perl/blob/master/CONTRIBUTING.md)
|
||||||
* Ставьте "звезды" **проекту MySQLTuner** на [MySQLTuner Git Hub Project](https://github.com/major/MySQLTuner-perl)
|
* Ставьте "звезды" **проекту MySQLTuner** на [MySQLTuner Git Hub Project](https://github.com/major/MySQLTuner-perl)
|
||||||
|
|
||||||
|
@ -61,6 +62,15 @@ MySQLTuner нуждается в вас:
|
||||||
|
|
||||||
**Серьезно - прочитайте раздел ЧаВо, который расположен чуть ниже.**
|
**Серьезно - прочитайте раздел ЧаВо, который расположен чуть ниже.**
|
||||||
|
|
||||||
|
|
||||||
|
Рекомендации по безопасности
|
||||||
|
--
|
||||||
|
|
||||||
|
Здравствуй, пользователь directadmin!
|
||||||
|
Мы обнаружили, что запуск mysqltuner с доступами da_admin, взятыми из файла /usr/local/directadmin/conf/my.cnf, может привести к компрометации пароля!
|
||||||
|
Детали можно прочитать по ссылке [Issue #289](https://github.com/major/MySQLTuner-perl/issues/289).
|
||||||
|
|
||||||
|
|
||||||
Что именно проверяет MySQLTuner?
|
Что именно проверяет MySQLTuner?
|
||||||
--
|
--
|
||||||
Все проверки, что выполняет **MySQLTuner**, задокументированы в [MySQLTuner Internals](https://github.com/major/MySQLTuner-perl/blob/master/INTERNALS.md)
|
Все проверки, что выполняет **MySQLTuner**, задокументированы в [MySQLTuner Internals](https://github.com/major/MySQLTuner-perl/blob/master/INTERNALS.md)
|
||||||
|
@ -199,6 +209,10 @@ __Пример:__ Включение вывода отладочной инфо
|
||||||
--skipsize Don't enumerate tables and their types/sizes (default: on)
|
--skipsize Don't enumerate tables and their types/sizes (default: on)
|
||||||
(Recommended for servers with many tables)
|
(Recommended for servers with many tables)
|
||||||
|
|
||||||
|
**Вопрос: Я могу установить этот проект с помощью homebrew на Apple Macintosh?**
|
||||||
|
|
||||||
|
Да! Вы можете уставновить его командой `brew install mysqltuner` с помощью [homebrew](https://brew.sh/) на Apple Macintosh.
|
||||||
|
|
||||||
MySQLTuner и Vagrant
|
MySQLTuner и Vagrant
|
||||||
--
|
--
|
||||||
**MySQLTuner** содержится в следующих конфигурациях Vagrant:
|
**MySQLTuner** содержится в следующих конфигурациях Vagrant:
|
||||||
|
@ -235,7 +249,7 @@ MySQLTuner нуждается в Вас:
|
||||||
|
|
||||||
**MySQLTuner** нуждается в вашем вкладе в документацию и код, а так же ждёт обратную связь.
|
**MySQLTuner** нуждается в вашем вкладе в документацию и код, а так же ждёт обратную связь.
|
||||||
|
|
||||||
* Присоединяйтесь, пожалуйста, к нашему трекеру ошибок [GitHub tracker](https://github.com/major/MySQLTuner-perl/issues)</a>.
|
* Присоединяйтесь, пожалуйста, к нашему трекеру ошибок [GitHub tracker](https://github.com/major/MySQLTuner-perl/issues).
|
||||||
* Руководство по поддержке проекта доступно на [MySQLTuner contributing guide](https://github.com/major/MySQLTuner-perl/blob/master/CONTRIBUTING.md)
|
* Руководство по поддержке проекта доступно на [MySQLTuner contributing guide](https://github.com/major/MySQLTuner-perl/blob/master/CONTRIBUTING.md)
|
||||||
* Ставьте "звезды" **проекту MySQLTuner** на [MySQLTuner Git Hub Project](https://github.com/major/MySQLTuner-perl)
|
* Ставьте "звезды" **проекту MySQLTuner** на [MySQLTuner Git Hub Project](https://github.com/major/MySQLTuner-perl)
|
||||||
|
|
||||||
|
|
37
USAGE.md
37
USAGE.md
|
@ -1,6 +1,6 @@
|
||||||
# NAME
|
# NAME
|
||||||
|
|
||||||
MySQLTuner 1.6.20 - MySQL High Performance Tuning Script
|
MySQLTuner 1.7.9 - MySQL High Performance Tuning Script
|
||||||
|
|
||||||
# IMPORTANT USAGE GUIDELINES
|
# IMPORTANT USAGE GUIDELINES
|
||||||
|
|
||||||
|
@ -9,17 +9,21 @@ Allow MySQL server to run for at least 24-48 hours before trusting suggestions
|
||||||
Some routines may require root level privileges (script will provide warnings)
|
Some routines may require root level privileges (script will provide warnings)
|
||||||
You must provide the remote server's total memory when connecting to other servers
|
You must provide the remote server's total memory when connecting to other servers
|
||||||
|
|
||||||
# CONNECTION AND AUTHENTIFICATION
|
# CONNECTION AND AUTHENTICATION
|
||||||
|
|
||||||
--host <hostname> Connect to a remote host to perform tests (default: localhost)
|
--host <hostname> Connect to a remote host to perform tests (default: localhost)
|
||||||
--socket <socket> Use a different socket for a local connection
|
--socket <socket> Use a different socket for a local connection
|
||||||
--port <port> Port to use for connection (default: 3306)
|
--port <port> Port to use for connection (default: 3306)
|
||||||
--user <username> Username to use for authentication
|
--user <username> Username to use for authentication
|
||||||
--pass <password> Password to use for authentication
|
--userenv <envvar> Name of env variable which contains username to use for authentication
|
||||||
--mysqladmin <path> Path to a custom mysqladmin executable
|
--pass <password> Password to use for authentication
|
||||||
--mysqlcmd <path> Path to a custom mysql executable
|
--passenv <envvar> Name of env variable which contains password to use for authentication
|
||||||
--defaults-file <path> Path to a custom .my.cnf
|
--ssl-ca <path> Path to public key
|
||||||
=head1 PERFORMANCE AND REPORTING OPTIONS
|
--mysqladmin <path> Path to a custom mysqladmin executable
|
||||||
|
--mysqlcmd <path> Path to a custom mysql executable
|
||||||
|
--defaults-file <path> Path to a custom .my.cnf
|
||||||
|
|
||||||
|
# PERFORMANCE AND REPORTING OPTIONS
|
||||||
|
|
||||||
--skipsize Don't enumerate tables and their types/sizes (default: on)
|
--skipsize Don't enumerate tables and their types/sizes (default: on)
|
||||||
(Recommended for servers with many tables)
|
(Recommended for servers with many tables)
|
||||||
|
@ -40,10 +44,10 @@ You must provide the remote server's total memory when connecting to other serve
|
||||||
--dbstat Print database information
|
--dbstat Print database information
|
||||||
--idxstat Print index information
|
--idxstat Print index information
|
||||||
--sysstat Print system information
|
--sysstat Print system information
|
||||||
--pfstat Print Performance schema
|
--pfstat Print Performance schema
|
||||||
--bannedports Ports banned separated by comma(,)
|
--bannedports Ports banned separated by comma(,)
|
||||||
--maxportallowed Number of ports opened allowed on this hosts
|
--maxportallowed Number of ports opened allowed on this hosts
|
||||||
--cvefile CVE File for vulnerability checks
|
--cvefile <path> CVE File for vulnerability checks
|
||||||
--nocolor Don't print output in color
|
--nocolor Don't print output in color
|
||||||
--json Print result as JSON string
|
--json Print result as JSON string
|
||||||
--buffers Print global and per-thread buffer values
|
--buffers Print global and per-thread buffer values
|
||||||
|
@ -51,7 +55,8 @@ You must provide the remote server's total memory when connecting to other serve
|
||||||
--reportfile <path> Path to a report txt file
|
--reportfile <path> Path to a report txt file
|
||||||
--template <path> Path to a template file
|
--template <path> Path to a template file
|
||||||
--verbose Prints out all options (default: no verbose)
|
--verbose Prints out all options (default: no verbose)
|
||||||
=head1 PERLDOC
|
|
||||||
|
# PERLDOC
|
||||||
|
|
||||||
You can find documentation for this module with the perldoc command.
|
You can find documentation for this module with the perldoc command.
|
||||||
|
|
||||||
|
@ -120,7 +125,7 @@ Maintained by Major Hayden (major\\@mhtx.net) - Licensed under GPL
|
||||||
|
|
||||||
# COPYRIGHT AND LICENSE
|
# COPYRIGHT AND LICENSE
|
||||||
|
|
||||||
Copyright (C) 2006-2015 Major Hayden - major@mhtx.net
|
Copyright (C) 2006-2017 Major Hayden - major@mhtx.net
|
||||||
|
|
||||||
For the latest updates, please visit http://mysqltuner.com/
|
For the latest updates, please visit http://mysqltuner.com/
|
||||||
|
|
||||||
|
@ -138,4 +143,4 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
See the GNU General Public License for more details.
|
See the GNU General Public License for more details.
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License
|
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
99
Vagrant/Vagrantfile
vendored
Normal file
99
Vagrant/Vagrantfile
vendored
Normal file
|
@ -0,0 +1,99 @@
|
||||||
|
# -*- mode: ruby -*-
|
||||||
|
# vi: set ft=ruby :
|
||||||
|
|
||||||
|
# All Vagrant configuration is done below. The "2" in Vagrant.configure
|
||||||
|
# configures the configuration version (we support older styles for
|
||||||
|
# backwards compatibility). Please don't change it unless you know what
|
||||||
|
# you're doing.
|
||||||
|
Vagrant.configure(2) do |config|
|
||||||
|
# The most common configuration options are documented and commented below.
|
||||||
|
# For a complete reference, please see the online documentation at
|
||||||
|
# https://docs.vagrantup.com.
|
||||||
|
|
||||||
|
# Every Vagrant development environment requires a box. You can search for
|
||||||
|
# boxes at https://atlas.hashicorp.com/search.
|
||||||
|
config.vm.box = "fc23-mariadb10-0"
|
||||||
|
config.vm.box_url = "https://download.fedoraproject.org/pub/fedora/linux/releases/23/Cloud/x86_64/Images/Fedora-Cloud-Base-Vagrant-23-20151030.x86_64.vagrant-virtualbox.box"
|
||||||
|
# Disable automatic box update checking. If you disable this, then
|
||||||
|
# boxes will only be checked for updates when the user runs
|
||||||
|
# `vagrant box outdated`. This is not recommended.
|
||||||
|
# config.vm.box_check_update = false
|
||||||
|
config.vbguest.auto_update = true
|
||||||
|
# Create a forwarded port mapping which allows access to a specific port
|
||||||
|
# within the machine from a port on the host machine. In the example below,
|
||||||
|
# accessing "localhost:8080" will access port 80 on the guest machine.
|
||||||
|
# config.vm.network "forwarded_port", guest: 80, host: 8080
|
||||||
|
|
||||||
|
# Create a private network, which allows host-only access to the machine
|
||||||
|
# using a specific IP.
|
||||||
|
# config.vm.network "private_network", ip: "192.168.0.115"
|
||||||
|
config.hostmanager.enabled = true
|
||||||
|
config.hostmanager.manage_host = true
|
||||||
|
config.hostmanager.ignore_private_ip = false
|
||||||
|
config.hostmanager.include_offline = true
|
||||||
|
|
||||||
|
# Create a public network, which generally matched to bridged network.
|
||||||
|
# Bridged networks make the machine appear as another physical device on
|
||||||
|
# your network.
|
||||||
|
config.vm.network "public_network"
|
||||||
|
config.vm.hostname = 'dev.app'
|
||||||
|
config.hostmanager.aliases = %w(dev.app.localdomain dev.app.local)
|
||||||
|
# Share an additional folder to the guest VM. The first argument is
|
||||||
|
# the path on the host to the actual folder. The second argument is
|
||||||
|
# the path on the guest to mount the folder. And the optional third
|
||||||
|
# argument is a set of non-required options.
|
||||||
|
config.vm.synced_folder "./data", "/data"
|
||||||
|
|
||||||
|
# Provider-specific configuration so you can fine-tune various
|
||||||
|
# backing providers for Vagrant. These expose provider-specific options.
|
||||||
|
# Example for VirtualBox:
|
||||||
|
#
|
||||||
|
config.vm.provider "virtualbox" do |vb|
|
||||||
|
# # Display the VirtualBox GUI when booting the machine
|
||||||
|
# vb.gui = false
|
||||||
|
#
|
||||||
|
# # Customize the amount of memory on the VM:
|
||||||
|
vb.memory = "1024"
|
||||||
|
end
|
||||||
|
#
|
||||||
|
# View the documentation for the provider you are using for more
|
||||||
|
# information on available options.
|
||||||
|
|
||||||
|
# Define a Vagrant Push strategy for pushing to Atlas. Other push strategies
|
||||||
|
# such as FTP and Heroku are also available. See the documentation at
|
||||||
|
# https://docs.vagrantup.com/v2/push/atlas.html for more information.
|
||||||
|
# config.push.define "atlas" do |push|
|
||||||
|
# push.app = "YOUR_ATLAS_USERNAME/YOUR_APPLICATION_NAME"
|
||||||
|
# end
|
||||||
|
|
||||||
|
# Enable provisioning with a shell script. Additional provisioners such as
|
||||||
|
# Puppet, Chef, Ansible, Salt, and Docker are also available. Please see the
|
||||||
|
# documentation for more information about their specific syntax and use.
|
||||||
|
config.vm.provision "shell", inline: <<-SHELL
|
||||||
|
sudo yum -y update
|
||||||
|
echo "secret" | sudo passwd --stdin root
|
||||||
|
sudo cp -pr ~vagrant/.ssh /root
|
||||||
|
sudo chown -R root.root /root/.ssh
|
||||||
|
sudo yum -y install git python
|
||||||
|
sudo pip install --upgrade pip
|
||||||
|
if [ ! -d "/data/MySQLTuner-perl" ]; then
|
||||||
|
cd /data
|
||||||
|
sudo git clone https://github.com/major/MySQLTuner-perl.git
|
||||||
|
fi
|
||||||
|
sudo yum -y install perl-WWW-Mechanize-GZip perl-App-cpanminus perl-List-MoreUtils
|
||||||
|
sudo cpanm install File::Util
|
||||||
|
|
||||||
|
sudo yum -y install mariadb mariadb-server wget
|
||||||
|
sudo systemctl start mariadb.service
|
||||||
|
mysql -e 'select version();'
|
||||||
|
cd /data
|
||||||
|
sudo wget "https://launchpad.net/test-db/employees-db-1/1.0.6/+download/employees_db-full-1.0.6.tar.bz2"
|
||||||
|
sudo tar xvjf employees_db-full-1.0.6.tar.bz2
|
||||||
|
cd employees_db
|
||||||
|
cat employees.sql | mysql
|
||||||
|
cd ..
|
||||||
|
cd MySQLTuner-perl
|
||||||
|
perl mysqltuner.pl --idxstat --dbstat
|
||||||
|
SHELL
|
||||||
|
config.vm.provision :hostmanager
|
||||||
|
end
|
|
@ -12,11 +12,7 @@ Vagrant.configure(2) do |config|
|
||||||
|
|
||||||
# Every Vagrant development environment requires a box. You can search for
|
# Every Vagrant development environment requires a box. You can search for
|
||||||
# boxes at https://atlas.hashicorp.com/search.
|
# boxes at https://atlas.hashicorp.com/search.
|
||||||
config.vm.box = "fc23-mariadb10-0"
|
config.vm.box = "centos/7"
|
||||||
config.vm.box_url = "https://download.fedoraproject.org/pub/fedora/linux/releases/23/Cloud/x86_64/Images/Fedora-Cloud-Base-Vagrant-23-20151030.x86_64.vagrant-virtualbox.box"
|
|
||||||
# Disable automatic box update checking. If you disable this, then
|
|
||||||
# boxes will only be checked for updates when the user runs
|
|
||||||
# `vagrant box outdated`. This is not recommended.
|
|
||||||
# config.vm.box_check_update = false
|
# config.vm.box_check_update = false
|
||||||
config.vbguest.auto_update = true
|
config.vbguest.auto_update = true
|
||||||
# Create a forwarded port mapping which allows access to a specific port
|
# Create a forwarded port mapping which allows access to a specific port
|
||||||
|
@ -24,6 +20,12 @@ Vagrant.configure(2) do |config|
|
||||||
# accessing "localhost:8080" will access port 80 on the guest machine.
|
# accessing "localhost:8080" will access port 80 on the guest machine.
|
||||||
# config.vm.network "forwarded_port", guest: 80, host: 8080
|
# config.vm.network "forwarded_port", guest: 80, host: 8080
|
||||||
|
|
||||||
|
if Vagrant.has_plugin?("vagrant-proxyconf")
|
||||||
|
config.proxy.http = "http://10.195.50.51:3128/"
|
||||||
|
config.proxy.https = "http://10.195.50.51:3128/"
|
||||||
|
config.proxy.no_proxy = "localhost,127.0.0.1,.example.com"
|
||||||
|
end
|
||||||
|
|
||||||
# Create a private network, which allows host-only access to the machine
|
# Create a private network, which allows host-only access to the machine
|
||||||
# using a specific IP.
|
# using a specific IP.
|
||||||
# config.vm.network "private_network", ip: "192.168.0.115"
|
# config.vm.network "private_network", ip: "192.168.0.115"
|
||||||
|
@ -74,17 +76,30 @@ Vagrant.configure(2) do |config|
|
||||||
echo "secret" | sudo passwd --stdin root
|
echo "secret" | sudo passwd --stdin root
|
||||||
sudo cp -pr ~vagrant/.ssh /root
|
sudo cp -pr ~vagrant/.ssh /root
|
||||||
sudo chown -R root.root /root/.ssh
|
sudo chown -R root.root /root/.ssh
|
||||||
sudo yum -y install git python
|
|
||||||
|
sudo yum-config-manager --enable base
|
||||||
|
|
||||||
|
echo "[mariadb]" >/tmp/mariadb.repo
|
||||||
|
echo "name = MariaDB" >>/tmp/mariadb.repo
|
||||||
|
echo "baseurl = http://yum.mariadb.org/10.0/centos7-amd64" >> /tmp/mariadb.repo
|
||||||
|
echo "gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB" >> /tmp/mariadb.repo
|
||||||
|
echo "gpgcheck=1" >> /tmp/mariadb.repo
|
||||||
|
sudo cp /tmp/mariadb.repo /etc/yum.repos.d/
|
||||||
|
|
||||||
|
sudo rpm -Uvh http://mirrors.ircam.fr/pub/fedora/epel/7/x86_64/e/epel-release-7-10.noarch.rpm
|
||||||
|
|
||||||
|
|
||||||
|
sudo yum -y install python2-pip git python perl-WWW-Mechanize-GZip perl-App-cpanminus perl-List-MoreUtils MariaDB-server MariaDB-Client wget
|
||||||
|
|
||||||
sudo pip install --upgrade pip
|
sudo pip install --upgrade pip
|
||||||
if [ ! -d "/data/MySQLTuner-perl" ]; then
|
if [ ! -d "/data/MySQLTuner-perl" ]; then
|
||||||
cd /data
|
cd /data
|
||||||
sudo git clone https://github.com/major/MySQLTuner-perl.git
|
sudo git clone https://github.com/major/MySQLTuner-perl.git
|
||||||
fi
|
fi
|
||||||
sudo yum -y install perl-WWW-Mechanize-GZip perl-App-cpanminus perl-List-MoreUtils
|
sudo cpanm install File::Util
|
||||||
sudo cpanm install File::Util
|
|
||||||
|
|
||||||
sudo yum -y install mariadb mariadb-server wget
|
#sudo systemctl start mariadb.service
|
||||||
sudo systemctl start mariadb.service
|
sudo service mysql start
|
||||||
mysql -e 'select version();'
|
mysql -e 'select version();'
|
||||||
cd /data
|
cd /data
|
||||||
sudo wget "https://launchpad.net/test-db/employees-db-1/1.0.6/+download/employees_db-full-1.0.6.tar.bz2"
|
sudo wget "https://launchpad.net/test-db/employees-db-1/1.0.6/+download/employees_db-full-1.0.6.tar.bz2"
|
||||||
|
|
|
@ -1,107 +1,114 @@
|
||||||
# -*- mode: ruby -*-
|
# -*- mode: ruby -*-
|
||||||
# vi: set ft=ruby :
|
# vi: set ft=ruby :
|
||||||
|
|
||||||
# All Vagrant configuration is done below. The "2" in Vagrant.configure
|
# All Vagrant configuration is done below. The "2" in Vagrant.configure
|
||||||
# configures the configuration version (we support older styles for
|
# configures the configuration version (we support older styles for
|
||||||
# backwards compatibility). Please don't change it unless you know what
|
# backwards compatibility). Please don't change it unless you know what
|
||||||
# you're doing.
|
# you're doing.
|
||||||
Vagrant.configure(2) do |config|
|
Vagrant.configure(2) do |config|
|
||||||
# The most common configuration options are documented and commented below.
|
# The most common configuration options are documented and commented below.
|
||||||
# For a complete reference, please see the online documentation at
|
# For a complete reference, please see the online documentation at
|
||||||
# https://docs.vagrantup.com.
|
# https://docs.vagrantup.com.
|
||||||
|
|
||||||
# Every Vagrant development environment requires a box. You can search for
|
# Every Vagrant development environment requires a box. You can search for
|
||||||
# boxes at https://atlas.hashicorp.com/search.
|
# boxes at https://atlas.hashicorp.com/search.
|
||||||
config.vm.box = "fc23-mariadb10-1"
|
config.vm.box = "centos/7"
|
||||||
config.vm.box_url = "https://download.fedoraproject.org/pub/fedora/linux/releases/23/Cloud/x86_64/Images/Fedora-Cloud-Base-Vagrant-23-20151030.x86_64.vagrant-virtualbox.box"
|
# config.vm.box_check_update = false
|
||||||
# Disable automatic box update checking. If you disable this, then
|
config.vbguest.auto_update = true
|
||||||
# boxes will only be checked for updates when the user runs
|
# Create a forwarded port mapping which allows access to a specific port
|
||||||
# `vagrant box outdated`. This is not recommended.
|
# within the machine from a port on the host machine. In the example below,
|
||||||
# config.vm.box_check_update = false
|
# accessing "localhost:8080" will access port 80 on the guest machine.
|
||||||
config.vbguest.auto_update = true
|
# config.vm.network "forwarded_port", guest: 80, host: 8080
|
||||||
# Create a forwarded port mapping which allows access to a specific port
|
|
||||||
# within the machine from a port on the host machine. In the example below,
|
if Vagrant.has_plugin?("vagrant-proxyconf")
|
||||||
# accessing "localhost:8080" will access port 80 on the guest machine.
|
config.proxy.http = "http://10.195.50.51:3128/"
|
||||||
# config.vm.network "forwarded_port", guest: 80, host: 8080
|
config.proxy.https = "http://10.195.50.51:3128/"
|
||||||
|
config.proxy.no_proxy = "localhost,127.0.0.1,.example.com"
|
||||||
# Create a private network, which allows host-only access to the machine
|
end
|
||||||
# using a specific IP.
|
|
||||||
# config.vm.network "private_network", ip: "192.168.0.115"
|
# Create a private network, which allows host-only access to the machine
|
||||||
config.hostmanager.enabled = true
|
# using a specific IP.
|
||||||
config.hostmanager.manage_host = true
|
# config.vm.network "private_network", ip: "192.168.0.115"
|
||||||
config.hostmanager.ignore_private_ip = false
|
config.hostmanager.enabled = true
|
||||||
config.hostmanager.include_offline = true
|
config.hostmanager.manage_host = true
|
||||||
|
config.hostmanager.ignore_private_ip = false
|
||||||
# Create a public network, which generally matched to bridged network.
|
config.hostmanager.include_offline = true
|
||||||
# Bridged networks make the machine appear as another physical device on
|
|
||||||
# your network.
|
# Create a public network, which generally matched to bridged network.
|
||||||
config.vm.network "public_network"
|
# Bridged networks make the machine appear as another physical device on
|
||||||
config.vm.hostname = 'dev.app'
|
# your network.
|
||||||
config.hostmanager.aliases = %w(dev.app.localdomain dev.app.local)
|
config.vm.network "public_network"
|
||||||
# Share an additional folder to the guest VM. The first argument is
|
config.vm.hostname = 'dev.app'
|
||||||
# the path on the host to the actual folder. The second argument is
|
config.hostmanager.aliases = %w(dev.app.localdomain dev.app.local)
|
||||||
# the path on the guest to mount the folder. And the optional third
|
# Share an additional folder to the guest VM. The first argument is
|
||||||
# argument is a set of non-required options.
|
# the path on the host to the actual folder. The second argument is
|
||||||
config.vm.synced_folder "./data", "/data"
|
# the path on the guest to mount the folder. And the optional third
|
||||||
|
# argument is a set of non-required options.
|
||||||
# Provider-specific configuration so you can fine-tune various
|
config.vm.synced_folder "./data", "/data"
|
||||||
# backing providers for Vagrant. These expose provider-specific options.
|
|
||||||
# Example for VirtualBox:
|
# Provider-specific configuration so you can fine-tune various
|
||||||
#
|
# backing providers for Vagrant. These expose provider-specific options.
|
||||||
config.vm.provider "virtualbox" do |vb|
|
# Example for VirtualBox:
|
||||||
# # Display the VirtualBox GUI when booting the machine
|
#
|
||||||
# vb.gui = false
|
config.vm.provider "virtualbox" do |vb|
|
||||||
#
|
# # Display the VirtualBox GUI when booting the machine
|
||||||
# # Customize the amount of memory on the VM:
|
# vb.gui = false
|
||||||
vb.memory = "1024"
|
#
|
||||||
end
|
# # Customize the amount of memory on the VM:
|
||||||
#
|
vb.memory = "1024"
|
||||||
# View the documentation for the provider you are using for more
|
end
|
||||||
# information on available options.
|
#
|
||||||
|
# View the documentation for the provider you are using for more
|
||||||
# Define a Vagrant Push strategy for pushing to Atlas. Other push strategies
|
# information on available options.
|
||||||
# such as FTP and Heroku are also available. See the documentation at
|
|
||||||
# https://docs.vagrantup.com/v2/push/atlas.html for more information.
|
# Define a Vagrant Push strategy for pushing to Atlas. Other push strategies
|
||||||
# config.push.define "atlas" do |push|
|
# such as FTP and Heroku are also available. See the documentation at
|
||||||
# push.app = "YOUR_ATLAS_USERNAME/YOUR_APPLICATION_NAME"
|
# https://docs.vagrantup.com/v2/push/atlas.html for more information.
|
||||||
# end
|
# config.push.define "atlas" do |push|
|
||||||
|
# push.app = "YOUR_ATLAS_USERNAME/YOUR_APPLICATION_NAME"
|
||||||
# Enable provisioning with a shell script. Additional provisioners such as
|
# end
|
||||||
# Puppet, Chef, Ansible, Salt, and Docker are also available. Please see the
|
|
||||||
# documentation for more information about their specific syntax and use.
|
# Enable provisioning with a shell script. Additional provisioners such as
|
||||||
config.vm.provision "shell", inline: <<-SHELL
|
# Puppet, Chef, Ansible, Salt, and Docker are also available. Please see the
|
||||||
sudo yum -y update
|
# documentation for more information about their specific syntax and use.
|
||||||
echo "secret" | sudo passwd --stdin root
|
config.vm.provision "shell", inline: <<-SHELL
|
||||||
sudo cp -pr ~vagrant/.ssh /root
|
sudo yum -y update
|
||||||
sudo chown -R root.root /root/.ssh
|
echo "secret" | sudo passwd --stdin root
|
||||||
sudo yum -y install git python
|
sudo cp -pr ~vagrant/.ssh /root
|
||||||
sudo pip install --upgrade pip
|
sudo chown -R root.root /root/.ssh
|
||||||
if [ ! -d "/data/MySQLTuner-perl" ]; then
|
|
||||||
cd /data
|
sudo yum-config-manager --enable base
|
||||||
sudo git clone https://github.com/major/MySQLTuner-perl.git
|
|
||||||
fi
|
echo "[mariadb]" >/tmp/mariadb.repo
|
||||||
|
echo "name = MariaDB" >>/tmp/mariadb.repo
|
||||||
echo "# MariaDB 10.1 Fedora repository list - created 2016-01-25 13:11 UTC
|
echo "baseurl = http://yum.mariadb.org/10.1/centos7-amd64" >> /tmp/mariadb.repo
|
||||||
# http://mariadb.org/mariadb/repositories/
|
echo "gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB" >> /tmp/mariadb.repo
|
||||||
[mariadb]
|
echo "gpgcheck=1" >> /tmp/mariadb.repo
|
||||||
name = MariaDB
|
sudo cp /tmp/mariadb.repo /etc/yum.repos.d/
|
||||||
baseurl = http://yum.mariadb.org/10.1/fedora23-amd64
|
|
||||||
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
|
sudo rpm -Uvh http://mirrors.ircam.fr/pub/fedora/epel/7/x86_64/e/epel-release-7-10.noarch.rpm
|
||||||
gpgcheck=1" >> /etc/yum.repos.d/mariadb.repo
|
|
||||||
sudo yum -y install perl-WWW-Mechanize-GZip perl-App-cpanminus perl-List-MoreUtils
|
|
||||||
sudo cpanm install File::Util
|
sudo yum -y install python2-pip git python perl-WWW-Mechanize-GZip perl-App-cpanminus perl-List-MoreUtils MariaDB-server MariaDB-Client wget
|
||||||
|
|
||||||
sudo yum -y install MariaDB-server MariaDB-client wget
|
sudo pip install --upgrade pip
|
||||||
sudo systemctl start mariadb.service
|
if [ ! -d "/data/MySQLTuner-perl" ]; then
|
||||||
mysql -e 'select version();'
|
cd /data
|
||||||
cd /data
|
sudo git clone https://github.com/major/MySQLTuner-perl.git
|
||||||
sudo wget "https://launchpad.net/test-db/employees-db-1/1.0.6/+download/employees_db-full-1.0.6.tar.bz2"
|
fi
|
||||||
sudo tar xvjf employees_db-full-1.0.6.tar.bz2
|
sudo cpanm install File::Util
|
||||||
cd employees_db
|
|
||||||
cat employees.sql | mysql
|
#sudo systemctl start mariadb.service
|
||||||
cd ..
|
sudo service mysql start
|
||||||
cd MySQLTuner-perl
|
mysql -e 'select version();'
|
||||||
perl mysqltuner.pl --idxstat --dbstat
|
cd /data
|
||||||
SHELL
|
sudo wget "https://launchpad.net/test-db/employees-db-1/1.0.6/+download/employees_db-full-1.0.6.tar.bz2"
|
||||||
config.vm.provision :hostmanager
|
sudo tar xvjf employees_db-full-1.0.6.tar.bz2
|
||||||
end
|
cd employees_db
|
||||||
|
cat employees.sql | mysql
|
||||||
|
cd ..
|
||||||
|
cd MySQLTuner-perl
|
||||||
|
perl mysqltuner.pl --idxstat --dbstat
|
||||||
|
SHELL
|
||||||
|
config.vm.provision :hostmanager
|
||||||
|
end
|
||||||
|
|
107
Vagrant/Vagrantfile_for_MariaDB10.2
Normal file
107
Vagrant/Vagrantfile_for_MariaDB10.2
Normal file
|
@ -0,0 +1,107 @@
|
||||||
|
# -*- mode: ruby -*-
|
||||||
|
# vi: set ft=ruby :
|
||||||
|
|
||||||
|
# All Vagrant configuration is done below. The "2" in Vagrant.configure
|
||||||
|
# configures the configuration version (we support older styles for
|
||||||
|
# backwards compatibility). Please don't change it unless you know what
|
||||||
|
# you're doing.
|
||||||
|
Vagrant.configure(2) do |config|
|
||||||
|
# The most common configuration options are documented and commented below.
|
||||||
|
# For a complete reference, please see the online documentation at
|
||||||
|
# https://docs.vagrantup.com.
|
||||||
|
|
||||||
|
# Every Vagrant development environment requires a box. You can search for
|
||||||
|
# boxes at https://atlas.hashicorp.com/search.
|
||||||
|
config.vm.box = "fc23-mariadb10-1"
|
||||||
|
config.vm.box_url = "https://download.fedoraproject.org/pub/fedora/linux/releases/23/Cloud/x86_64/Images/Fedora-Cloud-Base-Vagrant-23-20151030.x86_64.vagrant-virtualbox.box"
|
||||||
|
# Disable automatic box update checking. If you disable this, then
|
||||||
|
# boxes will only be checked for updates when the user runs
|
||||||
|
# `vagrant box outdated`. This is not recommended.
|
||||||
|
# config.vm.box_check_update = false
|
||||||
|
config.vbguest.auto_update = true
|
||||||
|
# Create a forwarded port mapping which allows access to a specific port
|
||||||
|
# within the machine from a port on the host machine. In the example below,
|
||||||
|
# accessing "localhost:8080" will access port 80 on the guest machine.
|
||||||
|
# config.vm.network "forwarded_port", guest: 80, host: 8080
|
||||||
|
|
||||||
|
# Create a private network, which allows host-only access to the machine
|
||||||
|
# using a specific IP.
|
||||||
|
# config.vm.network "private_network", ip: "192.168.0.115"
|
||||||
|
config.hostmanager.enabled = true
|
||||||
|
config.hostmanager.manage_host = true
|
||||||
|
config.hostmanager.ignore_private_ip = false
|
||||||
|
config.hostmanager.include_offline = true
|
||||||
|
|
||||||
|
# Create a public network, which generally matched to bridged network.
|
||||||
|
# Bridged networks make the machine appear as another physical device on
|
||||||
|
# your network.
|
||||||
|
config.vm.network "public_network"
|
||||||
|
config.vm.hostname = 'dev.app'
|
||||||
|
config.hostmanager.aliases = %w(dev.app.localdomain dev.app.local)
|
||||||
|
# Share an additional folder to the guest VM. The first argument is
|
||||||
|
# the path on the host to the actual folder. The second argument is
|
||||||
|
# the path on the guest to mount the folder. And the optional third
|
||||||
|
# argument is a set of non-required options.
|
||||||
|
config.vm.synced_folder "./data", "/data"
|
||||||
|
|
||||||
|
# Provider-specific configuration so you can fine-tune various
|
||||||
|
# backing providers for Vagrant. These expose provider-specific options.
|
||||||
|
# Example for VirtualBox:
|
||||||
|
#
|
||||||
|
config.vm.provider "virtualbox" do |vb|
|
||||||
|
# # Display the VirtualBox GUI when booting the machine
|
||||||
|
# vb.gui = false
|
||||||
|
#
|
||||||
|
# # Customize the amount of memory on the VM:
|
||||||
|
vb.memory = "1024"
|
||||||
|
end
|
||||||
|
#
|
||||||
|
# View the documentation for the provider you are using for more
|
||||||
|
# information on available options.
|
||||||
|
|
||||||
|
# Define a Vagrant Push strategy for pushing to Atlas. Other push strategies
|
||||||
|
# such as FTP and Heroku are also available. See the documentation at
|
||||||
|
# https://docs.vagrantup.com/v2/push/atlas.html for more information.
|
||||||
|
# config.push.define "atlas" do |push|
|
||||||
|
# push.app = "YOUR_ATLAS_USERNAME/YOUR_APPLICATION_NAME"
|
||||||
|
# end
|
||||||
|
|
||||||
|
# Enable provisioning with a shell script. Additional provisioners such as
|
||||||
|
# Puppet, Chef, Ansible, Salt, and Docker are also available. Please see the
|
||||||
|
# documentation for more information about their specific syntax and use.
|
||||||
|
config.vm.provision "shell", inline: <<-SHELL
|
||||||
|
sudo yum -y update
|
||||||
|
echo "secret" | sudo passwd --stdin root
|
||||||
|
sudo cp -pr ~vagrant/.ssh /root
|
||||||
|
sudo chown -R root.root /root/.ssh
|
||||||
|
sudo yum -y install git python
|
||||||
|
sudo pip install --upgrade pip
|
||||||
|
if [ ! -d "/data/MySQLTuner-perl" ]; then
|
||||||
|
cd /data
|
||||||
|
sudo git clone https://github.com/major/MySQLTuner-perl.git
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "# MariaDB 10.1 Fedora repository list - created 2016-01-25 13:11 UTC
|
||||||
|
# http://mariadb.org/mariadb/repositories/
|
||||||
|
[mariadb]
|
||||||
|
name = MariaDB
|
||||||
|
baseurl = http://yum.mariadb.org/10.2/fedora23-amd64
|
||||||
|
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
|
||||||
|
gpgcheck=1" >> /etc/yum.repos.d/mariadb.repo
|
||||||
|
sudo yum -y install perl-WWW-Mechanize-GZip perl-App-cpanminus perl-List-MoreUtils
|
||||||
|
sudo cpanm install File::Util
|
||||||
|
|
||||||
|
sudo yum -y install MariaDB-server MariaDB-client wget
|
||||||
|
sudo systemctl start mariadb.service
|
||||||
|
mysql -e 'select version();'
|
||||||
|
cd /data
|
||||||
|
sudo wget "https://launchpad.net/test-db/employees-db-1/1.0.6/+download/employees_db-full-1.0.6.tar.bz2"
|
||||||
|
sudo tar xvjf employees_db-full-1.0.6.tar.bz2
|
||||||
|
cd employees_db
|
||||||
|
cat employees.sql | mysql
|
||||||
|
cd ..
|
||||||
|
cd MySQLTuner-perl
|
||||||
|
perl mysqltuner.pl --idxstat --dbstat
|
||||||
|
SHELL
|
||||||
|
config.vm.provision :hostmanager
|
||||||
|
end
|
106
Vagrant/Vagrantfile_for_MariaDB10.3
Normal file
106
Vagrant/Vagrantfile_for_MariaDB10.3
Normal file
|
@ -0,0 +1,106 @@
|
||||||
|
# -*- mode: ruby -*-
|
||||||
|
# vi: set ft=ruby :
|
||||||
|
|
||||||
|
# All Vagrant configuration is done below. The "2" in Vagrant.configure
|
||||||
|
# configures the configuration version (we support older styles for
|
||||||
|
# backwards compatibility). Please don't change it unless you know what
|
||||||
|
# you're doing.
|
||||||
|
Vagrant.configure(2) do |config|
|
||||||
|
# The most common configuration options are documented and commented below.
|
||||||
|
# For a complete reference, please see the online documentation at
|
||||||
|
# https://docs.vagrantup.com.
|
||||||
|
|
||||||
|
# Every Vagrant development environment requires a box. You can search for
|
||||||
|
# boxes at https://atlas.hashicorp.com/search.
|
||||||
|
config.vm.box = "centos/7"
|
||||||
|
# Disable automatic box update checking. If you disable this, then
|
||||||
|
# boxes will only be checked for updates when the user runs
|
||||||
|
# `vagrant box outdated`. This is not recommended.
|
||||||
|
# config.vm.box_check_update = false
|
||||||
|
config.vbguest.auto_update = true
|
||||||
|
# Create a forwarded port mapping which allows access to a specific port
|
||||||
|
# within the machine from a port on the host machine. In the example below,
|
||||||
|
# accessing "localhost:8080" will access port 80 on the guest machine.
|
||||||
|
# config.vm.network "forwarded_port", guest: 80, host: 8080
|
||||||
|
|
||||||
|
# Create a private network, which allows host-only access to the machine
|
||||||
|
# using a specific IP.
|
||||||
|
# config.vm.network "private_network", ip: "192.168.0.115"
|
||||||
|
config.hostmanager.enabled = true
|
||||||
|
config.hostmanager.manage_host = true
|
||||||
|
config.hostmanager.ignore_private_ip = false
|
||||||
|
config.hostmanager.include_offline = true
|
||||||
|
|
||||||
|
# Create a public network, which generally matched to bridged network.
|
||||||
|
# Bridged networks make the machine appear as another physical device on
|
||||||
|
# your network.
|
||||||
|
config.vm.network "public_network"
|
||||||
|
config.vm.hostname = 'dev.app'
|
||||||
|
config.hostmanager.aliases = %w(dev.app.localdomain dev.app.local)
|
||||||
|
# Share an additional folder to the guest VM. The first argument is
|
||||||
|
# the path on the host to the actual folder. The second argument is
|
||||||
|
# the path on the guest to mount the folder. And the optional third
|
||||||
|
# argument is a set of non-required options.
|
||||||
|
config.vm.synced_folder "./data", "/data"
|
||||||
|
|
||||||
|
# Provider-specific configuration so you can fine-tune various
|
||||||
|
# backing providers for Vagrant. These expose provider-specific options.
|
||||||
|
# Example for VirtualBox:
|
||||||
|
#
|
||||||
|
config.vm.provider "virtualbox" do |vb|
|
||||||
|
# # Display the VirtualBox GUI when booting the machine
|
||||||
|
# vb.gui = false
|
||||||
|
#
|
||||||
|
# # Customize the amount of memory on the VM:
|
||||||
|
vb.memory = "1024"
|
||||||
|
end
|
||||||
|
#
|
||||||
|
# View the documentation for the provider you are using for more
|
||||||
|
# information on available options.
|
||||||
|
|
||||||
|
# Define a Vagrant Push strategy for pushing to Atlas. Other push strategies
|
||||||
|
# such as FTP and Heroku are also available. See the documentation at
|
||||||
|
# https://docs.vagrantup.com/v2/push/atlas.html for more information.
|
||||||
|
# config.push.define "atlas" do |push|
|
||||||
|
# push.app = "YOUR_ATLAS_USERNAME/YOUR_APPLICATION_NAME"
|
||||||
|
# end
|
||||||
|
|
||||||
|
# Enable provisioning with a shell script. Additional provisioners such as
|
||||||
|
# Puppet, Chef, Ansible, Salt, and Docker are also available. Please see the
|
||||||
|
# documentation for more information about their specific syntax and use.
|
||||||
|
config.vm.provision "shell", inline: <<-SHELL
|
||||||
|
sudo yum -y update
|
||||||
|
echo "secret" | sudo passwd --stdin root
|
||||||
|
sudo cp -pr ~vagrant/.ssh /root
|
||||||
|
sudo chown -R root.root /root/.ssh
|
||||||
|
sudo yum -y install git python
|
||||||
|
sudo pip install --upgrade pip
|
||||||
|
if [ ! -d "/data/MySQLTuner-perl" ]; then
|
||||||
|
cd /data
|
||||||
|
sudo git clone https://github.com/major/MySQLTuner-perl.git
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "# MariaDB 10.1 Fedora repository list - created 2016-01-25 13:11 UTC
|
||||||
|
# http://mariadb.org/mariadb/repositories/
|
||||||
|
[mariadb]
|
||||||
|
name = MariaDB
|
||||||
|
baseurl = http://yum.mariadb.org/10.3/fedora23-amd64
|
||||||
|
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
|
||||||
|
gpgcheck=1" >> /etc/yum.repos.d/mariadb.repo
|
||||||
|
sudo yum -y install perl-WWW-Mechanize-GZip perl-App-cpanminus perl-List-MoreUtils
|
||||||
|
sudo cpanm install File::Util
|
||||||
|
|
||||||
|
sudo yum -y install MariaDB-server MariaDB-client wget
|
||||||
|
sudo systemctl start mariadb.service
|
||||||
|
mysql -e 'select version();'
|
||||||
|
cd /data
|
||||||
|
sudo wget "https://launchpad.net/test-db/employees-db-1/1.0.6/+download/employees_db-full-1.0.6.tar.bz2"
|
||||||
|
sudo tar xvjf employees_db-full-1.0.6.tar.bz2
|
||||||
|
cd employees_db
|
||||||
|
cat employees.sql | mysql
|
||||||
|
cd ..
|
||||||
|
cd MySQLTuner-perl
|
||||||
|
perl mysqltuner.pl --idxstat --dbstat
|
||||||
|
SHELL
|
||||||
|
config.vm.provision :hostmanager
|
||||||
|
end
|
|
@ -4,5 +4,5 @@ cp Vagrantfile_for_MariaDB10.0 Vagrantfile
|
||||||
mkdir data
|
mkdir data
|
||||||
vagrant plugin install vagrant-hostmanager
|
vagrant plugin install vagrant-hostmanager
|
||||||
vagrant plugin install vagrant-vbguest
|
vagrant plugin install vagrant-vbguest
|
||||||
vagrant box add --name fc23 https://download.fedoraproject.org/pub/fedora/linux/releases/23/Cloud/x86_64/Images/Fedora-Cloud-Base-Vagrant-23-20151030.x86_64.vagrant-virtualbox.box
|
vagrant plugin install vagrant-proxyconf
|
||||||
vagrant up
|
vagrant --provision up
|
||||||
|
|
12
build/deployOn
Executable file
12
build/deployOn
Executable file
|
@ -0,0 +1,12 @@
|
||||||
|
#!/bin/bash
|
||||||
|
set -xv
|
||||||
|
|
||||||
|
_DIR=$(dirname `readlink -f $0`)
|
||||||
|
|
||||||
|
|
||||||
|
ssh $1 mkdir /images/mysqltuner
|
||||||
|
rsync -avz ${_DIR}/.. $1:/images/mysqltuner
|
||||||
|
|
||||||
|
if [ "$2" = "run" ];then
|
||||||
|
ssh $1 "su - mysql -c 'cd /images/mysqltuner; source /opt/mysql/myqenv myserver1;perl mysqltuner.pl --verbose --color'"
|
||||||
|
fi
|
|
@ -5,7 +5,7 @@ use WWW::Mechanize::GZip;
|
||||||
use File::Util;
|
use File::Util;
|
||||||
use Data::Dumper;
|
use Data::Dumper;
|
||||||
use List::MoreUtils qw(uniq);
|
use List::MoreUtils qw(uniq);
|
||||||
my $verbose;
|
my $verbose=1;
|
||||||
sub AUTOLOAD {
|
sub AUTOLOAD {
|
||||||
use vars qw($AUTOLOAD);
|
use vars qw($AUTOLOAD);
|
||||||
my $cmd = $AUTOLOAD;
|
my $cmd = $AUTOLOAD;
|
||||||
|
@ -40,17 +40,18 @@ $mech->add_handler("response_redirect" => sub { print '#'x80,"\nREDIRECT RESPONS
|
||||||
my $url = 'http://cve.mitre.org/data/downloads/allitems.csv';
|
my $url = 'http://cve.mitre.org/data/downloads/allitems.csv';
|
||||||
my $resp;
|
my $resp;
|
||||||
|
|
||||||
unlink ('cve.csv') if (-f 'cve.csv');
|
unless (-f 'cve.csv') {
|
||||||
|
$resp=$mech->get($url);
|
||||||
|
$mech->save_content( "cve.csv" );
|
||||||
|
}
|
||||||
|
my $f=File::Util->new( readlimit => 152428800);
|
||||||
|
File::Util->flock_rules( qw/ IGNORE/ );
|
||||||
|
|
||||||
$resp=$mech->get($url);
|
|
||||||
$mech->save_content( "cve.csv" );
|
|
||||||
|
|
||||||
my $f=File::Util->new('readlimit' => 100000000, 'use_flock'=>'false');
|
|
||||||
my(@lines) = $f->load_file('cve.csv', '--as-lines');
|
|
||||||
my @versions;
|
my @versions;
|
||||||
my $temp;
|
my $temp;
|
||||||
unlink '../vulnerabilities.csv' if -f '../vulnerabilities.csv';
|
unlink '../vulnerabilities.csv' if -f '../vulnerabilities.csv';
|
||||||
foreach my $line (@lines) {
|
open(CVE, 'cve.csv') or die("Could not open file.");
|
||||||
|
foreach my $line (<CVE>) {
|
||||||
if ($line =~ /(mysql|mariadb)/i
|
if ($line =~ /(mysql|mariadb)/i
|
||||||
and $line =~ /server/i
|
and $line =~ /server/i
|
||||||
and $line =~ /CANDIDATE/i
|
and $line =~ /CANDIDATE/i
|
||||||
|
@ -64,13 +65,15 @@ foreach my $line (@lines) {
|
||||||
|
|
||||||
foreach my $vers (uniq(@versions)) {
|
foreach my $vers (uniq(@versions)) {
|
||||||
my @nb=split('\.', $vers);
|
my @nb=split('\.', $vers);
|
||||||
|
$nb[2]-- if ($line =~ /before/i);
|
||||||
#print $vers."\n".Dumper @nb;
|
#print $vers."\n".Dumper @nb;
|
||||||
#exit 0;
|
#print "$line";
|
||||||
$f->write_file('file' => '../vulnerabilities.csv', 'content' => "$vers;$nb[0];$nb[1];$nb[2];$line\n", 'mode' => 'append');
|
#exit 0 if ($line =~/before/i) ;
|
||||||
|
$f->write_file('file' => '../vulnerabilities.csv', 'content' => "$nb[0].$nb[1].$nb[2];$nb[0];$nb[1];$nb[2];$line", 'mode' => 'append');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
close(CVE);
|
||||||
unlink ('cve.csv') if (-f 'cve.csv');
|
#unlink ('cve.csv') if (-f 'cve.csv');
|
||||||
|
|
||||||
exit(0);
|
exit(0);
|
||||||
|
|
15
build/updateStaff.sh
Normal file
15
build/updateStaff.sh
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
(cd ..
|
||||||
|
echo "* GENERATING USAGE FILE"
|
||||||
|
pod2markdown mysqltuner.pl >USAGE.md
|
||||||
|
echo "* TIDYFY SCRIPT"
|
||||||
|
perltidy -b mysqltuner.pl
|
||||||
|
)
|
||||||
|
echo "* Update CVE list"
|
||||||
|
perl updateCVElist.pl
|
||||||
|
|
||||||
|
git add ../vulnerabilities.csv ../mysqltuner.pl ./USAGE.md
|
||||||
|
git commit -m 'Update Vulnerabilities list
|
||||||
|
Indenting mysqltuner
|
||||||
|
Update Usage information'
|
1291
mysqltuner.pl
1291
mysqltuner.pl
File diff suppressed because it is too large
Load diff
1293
vulnerabilities.csv
1293
vulnerabilities.csv
File diff suppressed because it is too large
Load diff
Loading…
Reference in a new issue