Wednesday, November 18, 2015
How to grow xfs file system after extending the LVM Volume
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/ol-root 36G 33G 3.7G 90% /
devtmpfs 1.6G 0 1.6G 0% /dev
tmpfs 2.0G 1.5G 582M 72% /dev/shm
tmpfs 1.6G 8.8M 1.6G 1% /run
tmpfs 1.6G 0 1.6G 0% /sys/fs/cgroup
/dev/sda1 997M 248M 749M 25% /boot
[root@vmxdb01 ~]# xfs_growfs /dev/mapper/ol-root
meta-data=/dev/mapper/ol-root isize=256 agcount=4, agsize=2355968 blks
= sectsz=512 attr=2, projid32bit=1
= crc=0 finobt=0
data = bsize=4096 blocks=9423872, imaxpct=25
= sunit=0 swidth=0 blks
naming =version 2 bsize=4096 ascii-ci=0 ftype=0
log =internal bsize=4096 blocks=4601, version=2
= sectsz=512 sunit=0 blks, lazy-count=1
realtime =none extsz=4096 blocks=0, rtextents=0
data blocks changed from 9423872 to 12045312
[root@vmxdb01 ~]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/ol-root 46G 33G 14G 71% /
devtmpfs 1.6G 0 1.6G 0% /dev
tmpfs 2.0G 1.5G 582M 72% /dev/shm
tmpfs 1.6G 8.8M 1.6G 1% /run
tmpfs 1.6G 0 1.6G 0% /sys/fs/cgroup
/dev/sda1 997M 248M 749M 25% /boot
Monday, November 9, 2015
Quick Steps on how to setup MariaDB Enterprise Cluster (Galera Cluster)
Repeat below steps on servers “mysql01”, “mysql02” & “mysql03”
[root@mysql01 ~]# groupadd -g 500 mysql
[root@mysql01 ~]# useradd -g mysql -u 500 -m -d /home/mysql mysql
[mysql@mysql01 my]$ cd /my
[mysql@mysql01 my]$ tar zxvf repo/mariadb-enterprise-cluster-10.0.21-linux-x86_64.tar.gz
[mysql@mysql01 my]$ ln -s mariadb-enterprise-cluster-10.0.21-linux-x86_64 mysql
[mysql@mysql01 mysql]$ mkdir /my/data
Follow the steps based on server name. (Sample my.cnf referring to end of this post)
[mysql@mysql01 mysql]$ cp mariadb-enterprise.cnf /my/my.cnf
[mysql@mysql01 mysql]$ ./scripts/mysql_install_db --defaults-file=/my/my.cnf
[mysql@mysql01 my]$ scp my.cnf mysql02:/my
[mysql@mysql01 my]$ scp my.cnf mysql03:/my
[mysql@mysql01 my]$ scp -rp data mysql02:/my/
[mysql@mysql01 my]$ scp -rp data mysql03:/my/
[mysql@mysql01 my]$ /my/mysql/bin/mysqld --defaults-file=/my/my.cnf --wsrep-new-cluster &
[mysql@mysql02 my]$ /my/mysql/bin/mysqld --defaults-file=/my/my.cnf --wsrep_cluster_address=gcomm://192.168.6.61 &
[mysql@mysql03 my]$ /my/mysql/bin/mysqld --defaults-file=/my/my.cnf --wsrep_cluster_address=gcomm://192.168.6.61 &
[mysql@mysql01 my]$ /my/mysql/bin/mysqladmin -u root -S /tmp/mysql.sock shutdown
[mysql@mysql02 my]$ /my/mysql/bin/mysqladmin -u root -S /tmp/mysql.sock shutdown
[mysql@mysql03 my]$ /my/mysql/bin/mysqladmin -u root -S /tmp/mysql.sock shutdown
[mysql@mysql01 my]$ /my/mysql/bin/mysqld --defaults-file=/my/my.cnf --wsrep_cluster_address=gcomm:// &
[mysql@mysql02 my]$ /my/mysql/bin/mysqld --defaults-file=/my/my.cnf --wsrep_cluster_address=gcomm://192.168.6.61,192.168.6.63 &
[mysql@mysql03 my]$ /my/mysql/bin/mysqld --defaults-file=/my/my.cnf --wsrep_cluster_address=gcomm://192.168.6.61,192.168.6.62 &
MariaDB [(none)]> show status like 'wsre%';
+------------------------------+-------------------------------------------------------+
| Variable_name | Value |
+------------------------------+-------------------------------------------------------+
| wsrep_local_state_uuid | ec8dda0f-86f0-11e5-945a-53d2400df46b |
| wsrep_protocol_version | 7 |
| wsrep_last_committed | 0 |
| wsrep_replicated | 0 |
| wsrep_replicated_bytes | 0 |
| wsrep_repl_keys | 0 |
| wsrep_repl_keys_bytes | 0 |
| wsrep_repl_data_bytes | 0 |
| wsrep_repl_other_bytes | 0 |
| wsrep_received | 10 |
| wsrep_received_bytes | 832 |
| wsrep_local_commits | 0 |
| wsrep_local_cert_failures | 0 |
| wsrep_local_replays | 0 |
| wsrep_local_send_queue | 0 |
| wsrep_local_send_queue_max | 1 |
| wsrep_local_send_queue_min | 0 |
| wsrep_local_send_queue_avg | 0.000000 |
| wsrep_local_recv_queue | 0 |
| wsrep_local_recv_queue_max | 1 |
| wsrep_local_recv_queue_min | 0 |
| wsrep_local_recv_queue_avg | 0.000000 |
| wsrep_local_cached_downto | 18446744073709551615 |
| wsrep_flow_control_paused_ns | 0 |
| wsrep_flow_control_paused | 0.000000 |
| wsrep_flow_control_sent | 0 |
| wsrep_flow_control_recv | 0 |
| wsrep_cert_deps_distance | 0.000000 |
| wsrep_apply_oooe | 0.000000 |
| wsrep_apply_oool | 0.000000 |
| wsrep_apply_window | 0.000000 |
| wsrep_commit_oooe | 0.000000 |
| wsrep_commit_oool | 0.000000 |
| wsrep_commit_window | 0.000000 |
| wsrep_local_state | 4 |
| wsrep_local_state_comment | Synced |
| wsrep_cert_index_size | 0 |
| wsrep_causal_reads | 0 |
| wsrep_cert_interval | 0.000000 |
| wsrep_incoming_addresses | 192.168.6.61:3306,192.168.6.62:3306,192.168.6.63:3306 |
| wsrep_evs_delayed | |
| wsrep_evs_evict_list | |
| wsrep_evs_repl_latency | 0/0/0/0/0 |
| wsrep_evs_state | OPERATIONAL |
| wsrep_gcomm_uuid | ec8ccb15-86f0-11e5-9d6e-0632737bbcb8 |
| wsrep_cluster_conf_id | 3 |
| wsrep_cluster_size | 3 |
| wsrep_cluster_state_uuid | ec8dda0f-86f0-11e5-945a-53d2400df46b |
| wsrep_cluster_status | Primary |
| wsrep_connected | ON |
| wsrep_local_bf_aborts | 0 |
| wsrep_local_index | 0 |
| wsrep_provider_name | Galera |
| wsrep_provider_vendor | Codership Oy <info@codership.com> |
| wsrep_provider_version | 25.3.9(r3387) |
| wsrep_ready | ON |
| wsrep_thread_count | 2 |
+------------------------------+-------------------------------------------------------+
57 rows in set (0.00 sec)
Sample “/my/my.cnf” on mysql01.
[mariadb] feedback-user-info='enterprise' ## -- Remove the following line to enable feedback reporting to mariadb.org [mysqld] ########################################### # General optimizer_search_depth = 0 join-buffer-space-limit = 4M # Security # Logging # Replication / Binary logs # InnoDB # Query Cache innodb-open-files = 2048 # MyISAM # Other [mysql] [mysqldump] [myisamchk] # [galera] #After this single-node cluster is started, |
VM Image Clone Problem: eth0 Renamed As eth1
After cloning a Linux image, noticed that Linux server renamed eth0 as eth1.
Further study discovered that this issue caused by previous entries in “70-persistent-net.rules”, after clean up these obsoleted lines related to previous image, it works perfect.
[root@mysql03 ~]# cp /etc/udev/rules.d/70-persistent-net.rules /root/
[root@mysql03 ~]# diff /etc/udev/rules.d/70-persistent-net.rules /root/70-persistent-net.rules
8c8,14
< SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:50:56:26:1e:69", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"
---
> SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:0c:29:8c:f7:1e", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"
>
> # PCI device 0x8086:0x100f (e1000)
> SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:0c:29:0d:4f:31", ATTR{type}=="1", KERNEL=="eth*", NAME="eth1"
>
> # PCI device 0x8086:0x100f (e1000)
> SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:50:56:26:1e:69", ATTR{type}=="1", KERNEL=="eth*", NAME="eth2"
How do I find which rpm package supplies a file I'm looking for?
[mysql@mysql01 lib]$ ldd /my/mysql/lib/libgalera_smm.so
linux-vdso.so.1 => (0x00007fff1affe000)
libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f6d4daa6000)
librt.so.1 => /lib64/librt.so.1 (0x00007f6d4d89e000)
libssl.so.6 => not found
libcrypto.so.6 => not found
libm.so.6 => /lib64/libm.so.6 (0x00007f6d4d619000)
libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00007f6d4d402000)
libc.so.6 => /lib64/libc.so.6 (0x00007f6d4d06e000)
/lib64/ld-linux-x86-64.so.2 (0x0000003094000000)
[mysql@mysql01 lib]$ yum whatprovides 'libssl.so.6'
Loaded plugins: security, ulninfo
openssl098e-0.9.8e-18.0.1.el6_5.2.i686 : A compatibility version of a general cryptography and TLS library
Repo : public_ol6_latest
Matched from:
Other : libssl.so.6
openssl098e-0.9.8e-17.0.1.el6.i686 : A compatibility version of a general cryptography and TLS library
Repo : public_ol6_latest
Matched from:
Other : libssl.so.6
openssl098e-0.9.8e-17.0.1.el6_2.2.i686 : A compatibility version of a general cryptography and TLS library
Repo : public_ol6_latest
Matched from:
Other : libssl.so.6
[mysql@mysql01 lib]$ yum whatprovides 'libcrypto.so.6'
Loaded plugins: security, ulninfo
openssl098e-0.9.8e-18.0.1.el6_5.2.i686 : A compatibility version of a general cryptography and TLS library
Repo : public_ol6_latest
Matched from:
Other : libcrypto.so.6
openssl098e-0.9.8e-17.0.1.el6.i686 : A compatibility version of a general cryptography and TLS library
Repo : public_ol6_latest
Matched from:
Other : libcrypto.so.6
openssl098e-0.9.8e-17.0.1.el6_2.2.i686 : A compatibility version of a general cryptography and TLS library
Repo : public_ol6_latest
Matched from:
Other : libcrypto.so.6
[root@mysql01 ~]# yum install openssl098e
[mysql@mysql01 lib]$ ldd /my/mysql/lib/libgalera_smm.so
linux-vdso.so.1 => (0x00007fff418b9000)
libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f7b6dc57000)
librt.so.1 => /lib64/librt.so.1 (0x00007f7b6da4f000)
libssl.so.6 => /usr/lib64/libssl.so.6 (0x00007f7b6d7ff000)
libcrypto.so.6 => /usr/lib64/libcrypto.so.6 (0x00007f7b6d4a3000)
libm.so.6 => /lib64/libm.so.6 (0x00007f7b6d21f000)
libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00007f7b6d008000)
libc.so.6 => /lib64/libc.so.6 (0x00007f7b6cc74000)
/lib64/ld-linux-x86-64.so.2 (0x0000003094000000)
libgssapi_krb5.so.2 => /lib64/libgssapi_krb5.so.2 (0x00007f7b6ca30000)
libkrb5.so.3 => /lib64/libkrb5.so.3 (0x00007f7b6c748000)
libcom_err.so.2 => /lib64/libcom_err.so.2 (0x00007f7b6c544000)
libk5crypto.so.3 => /lib64/libk5crypto.so.3 (0x00007f7b6c318000)
libdl.so.2 => /lib64/libdl.so.2 (0x00007f7b6c113000)
libz.so.1 => /lib64/libz.so.1 (0x00007f7b6befd000)
libkrb5support.so.0 => /lib64/libkrb5support.so.0 (0x00007f7b6bcf2000)
libkeyutils.so.1 => /lib64/libkeyutils.so.1 (0x00007f7b6baee000)
libresolv.so.2 => /lib64/libresolv.so.2 (0x00007f7b6b8d4000)
libselinux.so.1 => /lib64/libselinux.so.1 (0x00007f7b6b6b4000)