facebookarchive / oss-performance

Scripts for benchmarking various PHP implementations when running open source software.
Other
131 stars 45 forks source link

Adding a command line parameter "-db-host" to optionally specify a re… #79

Closed kevand900 closed 7 years ago

kevand900 commented 7 years ago

…mote machine to host the mysql database.

This option is to be used with "--i-am-not-benchmarking". Changes were made in PerfOptions.php for the command line parsing, and DatabaseInstaller.php for installing the database. Drupal7, Mediawiki, and Wordpress are the targets which support this feature presently.


--ON THE SERVER RUNNING MYSQL--

Edit my.cnf $sudo vim /etc/mysql.cnf

Comment out '#skip-networking' if present: Change to 'bind-address=0.0.0.0'

Restart the server: $sudo service mariadb stop $sudo service mariadb start

Create a user 'root' with IP of the machine running OSS: MariaDB [(none)]>CREATE USER 'root'@'' IDENTIFIED BY 'root';

Grant Privileges to this user: MariaDB [(none)]>GRANT ALL PRIVILEGES ON . TO 'root'@'' IDENTIFIED BY 'root' WITH GRANT OPTION; MariaDB [(none)]>FLUSH PRIVILEGES;

Make sure there is a user named 'root'@'localhost.localdomain': MariaDB [(none)]>SELECT User, Host FROM mysql.user; +----------+-----------------------+ | User | Host | +----------+-----------------------+ | root | 127.0.0.1 | | wp_bench | 127.0.0.1 | | root | ::1 | | root | localhost | | root | localhost.localdomain | +----------+-----------------------+

Allow remote access through IPTables:

iptables -P INPUT ACCEPT

iptables -F

iptables -A INPUT -i lo -j ACCEPT


ON MACHINE RUNNING OSS Test connection from machine running OSS: $mysql -u root -proot -h


When running OSS, add the command line parameter "db-host=" along with "--i-am-not-benchmarking"


kevand900 commented 7 years ago

Can you please review? Thanks!