1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380
| [root@mysql8 playbooks]# pwd /usr/local/dbops/mysql_ansible/playbooks [root@mysql8 playbooks]# ansible-playbook single_node.yml
PLAY [Deploy single-node MySQL server using binary installation] ************************************************************************************************************************************
TASK [Gathering Facts] ****************************************************************************************************************************************************************************** ok: [192.168.6.162]
TASK [Check if password meets complexity requirements] ********************************************************************************************************************************************** ok: [192.168.6.162] => (item=None) ok: [192.168.6.162] => (item=None) ok: [192.168.6.162] => (item=None) ok: [192.168.6.162] => (item=None) ok: [192.168.6.162] => (item=None) ok: [192.168.6.162] => (item=None) ok: [192.168.6.162]
TASK [Print custom error message] ******************************************************************************************************************************************************************* skipping: [192.168.6.162]
TASK [Validate fcs_ setting are 0 or 1] ************************************************************************************************************************************************************* skipping: [192.168.6.162] => (item=fcs_skip_db_mount_verification) skipping: [192.168.6.162] => (item=fcs_skip_check_ntpd_or_chrony_running) skipping: [192.168.6.162] => (item=fcs_auto_download_mysql) skipping: [192.168.6.162] => (item=fcs_create_mysql_fast_login) skipping: [192.168.6.162] => (item=fcs_backup_script_create_backup_user) skipping: [192.168.6.162] => (item=fcs_mysql_use_jemalloc) skipping: [192.168.6.162] => (item=fcs_use_greatsql_ha)
TASK [Validate mysql_port is within range] ********************************************************************************************************************************************************** skipping: [192.168.6.162]
TASK [Validate mysql_version is within range] ******************************************************************************************************************************************************* skipping: [192.168.6.162]
TASK [Validate mysql_version is within range] ******************************************************************************************************************************************************* skipping: [192.168.6.162]
TASK [Validate db_type is a valid option] *********************************************************************************************************************************************************** skipping: [192.168.6.162]
TASK [Validate server_specs is a valid option] ****************************************************************************************************************************************************** skipping: [192.168.6.162]
TASK [Check if mysql-8.4.0-linux-glibc2.17-x86_64-minimal.tar.xz exists in ../downloads/ (local)] *************************************************************************************************** changed: [192.168.6.162]
TASK [Set the OS type variable] ********************************************************************************************************************************************************************* ok: [192.168.6.162]
TASK [Print the OS type] **************************************************************************************************************************************************************************** ok: [192.168.6.162] => { "msg": "The OS type of host 192.168.6.162 is CentOS7" }
TASK [Assert if OS type is supported] *************************************************************************************************************************************************************** ok: [192.168.6.162] => { "changed": false, "msg": "All assertions passed" }
TASK [Check for Python 3] *************************************************************************************************************************************************************************** ok: [192.168.6.162]
TASK [Check for Python 2] *************************************************************************************************************************************************************************** ok: [192.168.6.162]
TASK [Set Python interpreter] *********************************************************************************************************************************************************************** ok: [192.168.6.162]
TASK [Print the Python interpreter] ***************************************************************************************************************************************************************** ok: [192.168.6.162] => { "msg": "The Python interpreter of host 192.168.6.162 is /usr/bin/python2" }
TASK [Set server_specs_processor_count and server_specs_memtotal_gb based on server_specs] ********************************************************************************************************** skipping: [192.168.6.162]
TASK [Gen random MySQL server_id] ******************************************************************************************************************************************************************* ok: [192.168.6.162]
TASK [Collect mysql_server_id to a list on localhost] *********************************************************************************************************************************************** ok: [192.168.6.162]
TASK [Check for duplicate mysql_server_id] ********************************************************************************************************************************************************** ok: [192.168.6.162] => { "changed": false, "msg": "All assertions passed" }
TASK [Generate random UUID if mgr_use_random_uuid is set to 1] ************************************************************************************************************************************** changed: [192.168.6.162]
TASK [set_fact] ************************************************************************************************************************************************************************************* ok: [192.168.6.162]
TASK [Display the list of target hosts and additional information] ********************************************************************************************************************************** ok: [192.168.6.162] => { "msg": [ "Hosts to be affected by Deploy single-node MySQL server using binary installation: 192.168.6.162", "DB type: mysql", "MySQL port: 3306", "MySQL version: 8.4.0", "Server specs: auto", "Roles to be executed: ../roles/pre_check_and_set, ../roles/mysql_server" ] }
TASK [Prompt user for confirmation] ***************************************************************************************************************************************************************** [Prompt user for confirmation] This will perform Deploy single-node MySQL server using binary installation on the displayed hosts. Please type 'confirm' to continue or press Ctrl+C to cancel.: ok: [192.168.6.162]
TASK [Check if user confirmed] ********************************************************************************************************************************************************************** skipping: [192.168.6.162]
TASK [Include role] *********************************************************************************************************************************************************************************
TASK [../roles/pre_check_and_set : Check yum and install libselinux-python3] ************************************************************************************************************************ ok: [192.168.6.162]
TASK [../roles/pre_check_and_set : Install ncurses-compat-libs if necessary] ************************************************************************************************************************ skipping: [192.168.6.162]
TASK [../roles/pre_check_and_set : Intall tar for openEuler20] ************************************************************************************************************************************** ok: [192.168.6.162]
TASK [../roles/pre_check_and_set : Set SeLinux disabled] ******************************************************************************************************************************************** [WARNING]: SELinux state change will take effect next reboot ok: [192.168.6.162]
TASK [../roles/pre_check_and_set : Stop and Disabled Firewalld] ************************************************************************************************************************************* ok: [192.168.6.162]
TASK [../roles/pre_check_and_set : Gather service facts] ******************************************************************************************************************************************** skipping: [192.168.6.162]
TASK [../roles/pre_check_and_set : Assert NTP or Chrony is running and only one is enabled] ********************************************************************************************************* skipping: [192.168.6.162]
TASK [../roles/pre_check_and_set : Check whether NUMA is turned off] ******************************************************************************************************************************** fatal: [192.168.6.162]: FAILED! => {"changed": false, "cmd": ["grep", "-q", "numa=off", "/proc/cmdline"], "delta": "0:00:00.004868", "end": "2024-08-23 16:07:01.721770", "msg": "non-zero return code", "rc": 1, "start": "2024-08-23 16:07:01.716902", "stderr": "", "stderr_lines": [], "stdout": "", "stdout_lines": []} ...ignoring
TASK [../roles/pre_check_and_set : Show warning if NUMA is not turned off] ************************************************************************************************************************** ok: [192.168.6.162] => { "msg": "Warning: NUMA is not turned off." }
TASK [../roles/pre_check_and_set : Update sysctl configuration file] ******************************************************************************************************************************** ok: [192.168.6.162]
TASK [../roles/pre_check_and_set : Reload sysctl] *************************************************************************************************************************************************** changed: [192.168.6.162]
TASK [../roles/pre_check_and_set : Extract parent directories of mysql_data_dir_base] *************************************************************************************************************** skipping: [192.168.6.162]
TASK [../roles/pre_check_and_set : Remove root '/' from parent directories list] ******************************************************************************************************************** skipping: [192.168.6.162]
TASK [../roles/pre_check_and_set : Check if mount points exist for pre_check_and_set__mysql_data_dir_base_parents list] ***************************************************************************** skipping: [192.168.6.162]
TASK [../roles/pre_check_and_set : Find the first matching mount point for mysql_data_dir_base and its parents] ************************************************************************************* skipping: [192.168.6.162] => (item={'block_used': 35061, 'uuid': '3d53107e-ce12-4c21-a78d-82f97fef2750', 'size_total': 1063256064, 'block_total': 259584, 'mount': '/boot', 'block_available': 224523, 'size_available': 919646208, 'fstype': 'xfs', 'inode_total': 524288, 'options': 'rw,seclabel,relatime,attr2,inode64,noquota', 'device': '/dev/sda1', 'inode_used': 326, 'block_size': 4096, 'inode_available': 523962}) skipping: [192.168.6.162] => (item={'block_used': 4980714, 'uuid': '2020-11-02-15-15-23-00', 'size_total': 10200502272, 'block_total': 4980714, 'mount': '/mnt', 'block_available': 0, 'size_available': 0, 'fstype': 'iso9660', 'inode_total': 0, 'options': 'ro,relatime', 'device': '/dev/sr0', 'inode_used': 0, 'block_size': 2048, 'inode_available': 0}) skipping: [192.168.6.162] => (item={'block_used': 379986, 'uuid': '3342f530-81a3-43d8-8405-5f4ecb2d6389', 'size_total': 97658605568, 'block_total': 23842433, 'mount': '/', 'block_available': 23462447, 'size_available': 96102182912, 'fstype': 'xfs', 'inode_total': 47708160, 'options': 'rw,seclabel,relatime,attr2,inode64,noquota', 'device': '/dev/mapper/centos-root', 'inode_used': 34255, 'block_size': 4096, 'inode_available': 47673905})
TASK [../roles/pre_check_and_set : Debug output for mount point] ************************************************************************************************************************************ skipping: [192.168.6.162]
TASK [../roles/pre_check_and_set : Assert mount point is using xfs filesystem] ********************************************************************************************************************** skipping: [192.168.6.162]
TASK [../roles/pre_check_and_set : If it is a physical machine, double network card binding is required] ******************************************************************************************** ok: [192.168.6.162] => { "msg": "ens192" }
TASK [../roles/pre_check_and_set : If it is a physical machine, double network card binding is required] ******************************************************************************************** skipping: [192.168.6.162]
TASK [../roles/pre_check_and_set : Add network interface alias to a temporary file] ***************************************************************************************************************** changed: [192.168.6.162]
TASK [../roles/pre_check_and_set : Fetch copy] ****************************************************************************************************************************************************** changed: [192.168.6.162]
TASK [../roles/pre_check_and_set : Append file /tmp/net_aliases.txt (delegate to 127.0.0.1)] ******************************************************************************************************** ok: [192.168.6.162]
TASK [../roles/pre_check_and_set : Check if shell output is 1] ************************************************************************************************************************************** ok: [192.168.6.162] => { "changed": false, "msg": "All assertions passed" }
TASK [../roles/pre_check_and_set : Delete /tmp/net_aliases.txt] ************************************************************************************************************************************* changed: [192.168.6.162]
TASK [../roles/pre_check_and_set : Delete /tmp/ssh/ (delegate to 127.0.0.1)] ************************************************************************************************************************ changed: [192.168.6.162]
TASK [../roles/mysql_server : Check if flag exists or not] ****************************************************************************************************************************************** ok: [192.168.6.162]
TASK [../roles/mysql_server : Fail if flag exists] ************************************************************************************************************************************************** skipping: [192.168.6.162]
TASK [../roles/mysql_server : Check port not in use —— mysql port 3306] ***************************************************************************************************************************** ok: [192.168.6.162]
TASK [../roles/mysql_server : Ensure group "mysql" exists] ****************************************************************************************************************************************** ok: [192.168.6.162]
TASK [../roles/mysql_server : Create mysql user] **************************************************************************************************************************************************** changed: [192.168.6.162]
TASK [../roles/mysql_server : Create mysql directories] ********************************************************************************************************************************************* ok: [192.168.6.162] => (item=/database/mysql/etc) ok: [192.168.6.162] => (item=/database/mysql/data) ok: [192.168.6.162] => (item=/database/mysql/tmp) ok: [192.168.6.162] => (item=/database/mysql/run) ok: [192.168.6.162] => (item=/database/mysql/log/binlog) ok: [192.168.6.162] => (item=/database/mysql/log/redolog) ok: [192.168.6.162] => (item=/database/mysql/log/relaylog) ok: [192.168.6.162] => (item=/database/mysql/etc/3306) ok: [192.168.6.162] => (item=/database/mysql/data/3306) ok: [192.168.6.162] => (item=/database/mysql/tmp/3306) ok: [192.168.6.162] => (item=/database/mysql/log/binlog/3306) ok: [192.168.6.162] => (item=/database/mysql/log/redolog/3306) ok: [192.168.6.162] => (item=/database/mysql/log/relaylog/3306) ok: [192.168.6.162] => (item=/database/mysql/base/8.4.0)
TASK [../roles/mysql_server : Config /etc/my.cnf for mysql-5.7.x] *********************************************************************************************************************************** skipping: [192.168.6.162]
TASK [../roles/mysql_server : Config /etc/my.cnf for mysql-8.0.x] *********************************************************************************************************************************** skipping: [192.168.6.162]
TASK [../roles/mysql_server : Config /etc/my.cnf for mysql-8.4.x] *********************************************************************************************************************************** changed: [192.168.6.162]
TASK [../roles/mysql_server : Config /etc/my.cnf for percona-5.7.x] ********************************************************************************************************************************* skipping: [192.168.6.162]
TASK [../roles/mysql_server : Config /etc/my.cnf for percona-8.0.x] ********************************************************************************************************************************* skipping: [192.168.6.162]
TASK [../roles/mysql_server : Config /etc/my.cnf for greatsql-5.7.x] ******************************************************************************************************************************** skipping: [192.168.6.162]
TASK [../roles/mysql_server : Config /etc/my.cnf for greatsql-8.0.x] ******************************************************************************************************************************** skipping: [192.168.6.162]
TASK [../roles/mysql_server : Install libaio and numactl] ******************************************************************************************************************************************* ok: [192.168.6.162] => (item={'name': 'libaio'}) ok: [192.168.6.162] => (item={'name': 'numactl'})
TASK [../roles/mysql_server : Install jemalloc using yum] ******************************************************************************************************************************************* skipping: [192.168.6.162]
TASK [../roles/mysql_server : Set jemalloc rpm file name based on OS] ******************************************************************************************************************************* skipping: [192.168.6.162]
TASK [../roles/mysql_server : Copy jemalloc rpm to target server] *********************************************************************************************************************************** skipping: [192.168.6.162]
TASK [../roles/mysql_server : Install jemalloc from local file] ************************************************************************************************************************************* skipping: [192.168.6.162]
TASK [../roles/mysql_server : Check if jemalloc installation failed] ******************************************************************************************************************************** skipping: [192.168.6.162]
TASK [../roles/mysql_server : Check if MySQL package exists locally(local)] ************************************************************************************************************************* ok: [192.168.6.162]
TASK [../roles/mysql_server : Fail if MySQL package not found and auto download is disabled(local)] ************************************************************************************************* skipping: [192.168.6.162]
TASK [../roles/mysql_server : Download MySQL binary tarball if not found locally and auto download is enabled(local)] ******************************************************************************* skipping: [192.168.6.162]
TASK [../roles/mysql_server : Download GreatSQL binary tarball if not found locally and auto download is enabled(local)] **************************************************************************** skipping: [192.168.6.162]
TASK [../roles/mysql_server : Transfer MySQL install package to remote host] ************************************************************************************************************************ changed: [192.168.6.162]
TASK [../roles/mysql_server : Unarchive MySQL install package to /database/mysql/base/8.4.0] ******************************************************************************************************** changed: [192.168.6.162]
TASK [../roles/mysql_server : Touch unarchive_mysql_package_finished file] ************************************************************************************************************************** changed: [192.168.6.162]
TASK [../roles/mysql_server : Change owner to mysql user] ******************************************************************************************************************************************* changed: [192.168.6.162]
TASK [../roles/mysql_server : Make link /database/mysql/mysql-xx.yy.gz to /usr/local/mysql] ********************************************************************************************************* changed: [192.168.6.162]
TASK [../roles/mysql_server : Export mysql share object (*.os)] ************************************************************************************************************************************* changed: [192.168.6.162]
TASK [../roles/mysql_server : Load share object] **************************************************************************************************************************************************** ok: [192.168.6.162]
TASK [../roles/mysql_server : Export path env variable] ********************************************************************************************************************************************* changed: [192.168.6.162]
TASK [../roles/mysql_server : Export path env to /root/.bashrc] ************************************************************************************************************************************* changed: [192.168.6.162]
TASK [../roles/mysql_server : Export path env to /home/mysql/.bashrc] ******************************************************************************************************************************* changed: [192.168.6.162]
TASK [../roles/mysql_server : Remove /usr/include/mysql] ******************************************************************************************************************************************** ok: [192.168.6.162]
TASK [../roles/mysql_server : Export include file to /usr/include/mysql] **************************************************************************************************************************** changed: [192.168.6.162]
TASK [../roles/mysql_server : Create symbolic links for libssl.so and libcrypto.so] ***************************************************************************************************************** skipping: [192.168.6.162] => (item={'src': 'libssl.so.10', 'dest': 'libssl.so'}) skipping: [192.168.6.162] => (item={'src': 'libcrypto.so.10', 'dest': 'libcrypto.so'})
TASK [../roles/mysql_server : Initialize-insecure for mysql-5.7.x] ********************************************************************************************************************************** skipping: [192.168.6.162]
TASK [../roles/mysql_server : Initialize-insecure for mysql-8.0.x or mysql-8.4.x] ******************************************************************************************************************* changed: [192.168.6.162]
TASK [../roles/mysql_server : Create systemd config file] ******************************************************************************************************************************************* changed: [192.168.6.162]
TASK [../roles/mysql_server : Start mysql(sytemctl)] ************************************************************************************************************************************************ changed: [192.168.6.162]
TASK [../roles/mysql_server : Config mysql.service start up on boot] ******************************************************************************************************************************** changed: [192.168.6.162]
TASK [../roles/mysql_server : Mysql status] ********************************************************************************************************************************************************* ok: [192.168.6.162]
TASK [../roles/mysql_server : Transfer sql statement to remote] ************************************************************************************************************************************* changed: [192.168.6.162]
TASK [../roles/mysql_server : Make mysql secure] **************************************************************************************************************************************************** changed: [192.168.6.162]
TASK [../roles/mysql_server : Remove temp file /tmp/make_mysql_secure.sql] ************************************************************************************************************************** changed: [192.168.6.162]
TASK [../roles/mysql_server : Ensure expect is installed] ******************************************************************************************************************************************* changed: [192.168.6.162]
TASK [../roles/mysql_server : Transfer expect script to remote host] ******************************************************************************************************************************** changed: [192.168.6.162]
TASK [../roles/mysql_server : Execute expect script to set MySQL login-path] ************************************************************************************************************************ [WARNING]: Module remote_tmp /home/mysql/.ansible/tmp did not exist and was created with a mode of 0700, this may cause issues when running as another user. To avoid this, create the remote_tmp dir with the correct permissions manually ok: [192.168.6.162]
TASK [../roles/mysql_server : Set up alias in .bashrc named —— db3306] ****************************************************************************************************************************** changed: [192.168.6.162]
TASK [../roles/mysql_server : Remove expect script from remote host] ******************************************************************************************************************************** changed: [192.168.6.162]
TASK [../roles/mysql_server : Touch single_finish.flag] ********************************************************************************************************************************************* changed: [192.168.6.162]
PLAY RECAP ****************************************************************************************************************************************************************************************** 192.168.6.162 : ok=66 changed=31 unreachable=0 failed=0 skipped=36 rescued=0 ignored=1
Playbook run took 0 days, 0 hours, 1 minutes, 42 seconds
|