Skip to main content

Posts

Troubleshoot MySQL performance on LINUX

Troubleshoot mysql performance on LINUX: Execute following for mysql> prompt: TEE /tmp/mysql_output.txt; select benchmark(50000000,(1234*5678/37485-1298+8596^2)); #should take less than 20 seconds show global variables; show master logs; show plugins; show engines; show global status; show global status like '%ndb%'; show engine innodb status\G show slave status\G show engine innodb mutex; show master status; xa recover; show full processlist; /*!50503 select * from information_schema.innodb_trx */; /*!50503 select * from performance_schema.threads */; /*!50503 SELECT EVENT_NAME, SUM_TIMER_WAIT/1000000000 WAIT_MS, COUNT_STAR FROM performance_schema.events_waits_summary_global_by_event_name WHERE SUM_TIMER_WAIT > 0 AND EVENT_NAME LIKE 'wait/synch/mutex/innodb/%' ORDER BY SUM_TIMER_WAIT DESC, COUNT_STAR DESC */; /*!50708 select * from sys.session */; select sleep(60); show global status; show global status like '%ndb%'; show engine innodb status\G show s...

MySQL 8.0.19 install | MySQL 8.0.91 configure

MySQL 8.0.19 install | MySQL 8.0.91 configure: Install MySQL 8.0.19 Community edition: Remove Maria DB packages: # yum remove mariadb-libs.x86_64* Install MySQL 8.0.19 rpm packages: # yum install mysql-community-common-8.0.19-1.el7.x86_64.rpm # yum install mysql-community-libs-8.0.19-1.el7.x86_64.rpm # yum install mysql-community-libs-compat-8.0.19-1.el7.x86_64.rpm # yum install mysql-community-client-8.0.19-1.el7.x86_64.rpm # yum install mysql-community-embedded-compat-8.0.19-1.el7.x86_64.rpm # yum install mysql-community-devel-8.0.19-1.el7.x86_64.rpm # yum install mysql-community-server-8.0.19-1.el7.x86_64.rpm # yum install mysql-shell-8.0.19-1.el7.x86_64.rpm At this point mysql daemon is up and running at default location /var/lib/mysql at default port 3306. If you would like to customize location and port and other configuration parameters, make sure to remove directory /var/lib/mysql and kill the existing mysqld process running. Disab...

Ansible sudo: a password is required

Getting "sudo: a password is required\r\n", "msg": "MODULE FAILURE", "rc": 1} While running following command to run Ansible playbook getting error message "sudo: a password is required\r\n", "msg": "MODULE FAILURE", "rc": 1} $ ansible-playbook <PlayBookFileName> .yml -i <PathToHostFileName>/ hosts Means in a playbook you define to login as one user, and becoming another user while executing command on remote host, which require password as follows. Most of the organization has adopted a policy to use Active Directory to login into Linux server, during these days. remote_user: <ActiveDirectory ID> become_user: root You can use either -K , OR --ask-become-pass and ask for privilege escalation password. And your playbook will be executed successfully. Add option -K as follows $ ansible-playbook <PlayBookFileName>.yml -i <PathToHostFileName>/hosts -K

Docker Swarm Overly Network and MySQL Docker Container

Initialize Swarm on Node 1 # docker swarm init --advertise-addr=10.86.64.236 Swarm initialized: current node (n7w1dp3ub0illangx4qh96kld) is now a manager. # docker network create -d overlay dba_test-overlay vlhzekq8v3kka6t7vns7dhnvc Node1- Add attachable network: # docker network create --driver=overlay --attachable <newtork_name> 7avvbx3tmfg36ae7bipfq0waf Run Docker Container with Overlay network: # docker run -it --name=mysql_8.0.18_1 \ --network <network_name> \ --volume= /mysql/<mysql_version>/<app_name>/data_1 :/var/lib/mysql \ --publish <UserDefinedPortNo> :3306 \ -d mysql/mysql-server: 8.0.18 Retrieve root user password for container mysql_5.7.25_2: # docker logs mysql_8.0.18_1 2>&1 | grep GENERATED [Entrypoint] GENERATED ROOT PASSWORD: 0h7eD]UbfUs&ABjuzfuM@Hogw@w # docker exec -it mysql_8.0.18_1 mysql -uroot –p mysql> alter user 'root'@'localhost' identified by 'root123#';...

Run multiple version of MySQL container on the same virtual host

Run multiple version of MySQL container on the same virtual host: Find out the tag for MySQL version: Visit https://hub.docker.com/r/mysql/mysql-server/   and find out the tag for appropriate version For example for MySQL release 8, tags are - 8.0.18, 8.0, 8, latest MySQL release 5.7, tags are - 5.7.28, 5.7, 5 MySQL release 5.6, tags are - 5.6.46, 5.6 Pull the image from Docker Hub: For MySQL 8.0.16 Community edition Docker image execute following command # docker pull mysql/mysql-server:8.0.16 For MySQL 5.7 Community edition Docker image execute following command # docker pull mysql/mysql-server:5.7.25 For MySQL latest: # docker pull mysql/mysql-server:latest REPOSITORY              TAG                  IMAGE ID             CREATED   ...