Add the default gateway on your Suse Linux System

Here we use the route add default gw command. Doing this at the command line dynamically sets the kernels routing table so none local packets are routed to the defined gateway.

This won’t survive any reboots. See below on how to make it permanent. But here, we add the default gateway from the command line.


# route add default gw 10.10.21.1  eth0

Make the default gateway permanent in Suse Linux

This configuration won’t survive a reboot. To make a default route permanent in Suse Linux, you need to add an entry in the /etc/sysconfig/network/routes file as follows:


# echo “default 10.10.21.1 – -” > /etc/sysconfig/network/routes

First – run mysqltuner:

]# ./mysqltuner.pl
 >>  MySQLTuner 1.6.4 - Major Hayden <major@mhtx.net>
 >>  Bug reports, feature requests, and downloads at http://mysqltuner.com/
 >>  Run with '--help' for additional options and output filtering
Please enter your MySQL administrative login: root
Please enter your MySQL administrative password:
[--] Skipped version check for MySQLTuner script
[OK] Currently running supported MySQL version 5.6.29-log
[OK] Operating on 64-bit architecture

-------- Storage Engine Statistics -------------------------------------------
[--] Status: +ARCHIVE +BLACKHOLE +CSV -FEDERATED +InnoDB +MRG_MYISAM
[--] Data in MyISAM tables: 445K (Tables: 9)
[--] Data in InnoDB tables: 204M (Tables: 13)
[!!] Total fragmented tables: 3

-------- Security Recommendations  -------------------------------------------
[OK] There are no anonymous accounts for any database users
[OK] All database users have passwords assigned
[!!] User 'sysadmin@%' hasn't specific host restriction.
[!!] There is no basic password file list!

-------- CVE Security Recommendations  ---------------------------------------
[--] Skipped due to --cvefile option undefined

-------- Performance Metrics -------------------------------------------------
[--] Up for: 17d 19h 48m 54s (1M q [0.865 qps], 87K conn, TX: 39B, RX: 258M)
[--] Reads / Writes: 94% / 6%
[--] Binary logging is enabled (GTID MODE: OFF)
[--] Total buffers: 432.0M global + 6.5M per thread (151 max threads)
[OK] Maximum reached memory usage: 913.0M (49.61% of installed RAM)
[OK] Maximum possible memory usage: 1.4G (76.81% of installed RAM)
[OK] Slow queries: 0% (1/1M)
[OK] Highest usage of available connections: 49% (74/151)
[OK] Aborted connections: 2.80%  (2442/87276)
[!!] Query cache is disabled
[OK] Sorts requiring temporary tables: 0% (0 temp sorts / 271K sorts)
[!!] Temporary tables created on disk: 71% (80K on disk / 114K total)
[OK] Thread cache hit rate: 94% (4K created / 87K connections)
[!!] Table cache hit rate: 2% (115 open / 5K opened)
[OK] Open file limit used: 9% (99/1K)
[OK] Table locks acquired immediately: 100% (1M immediate / 1M locks)
[OK] Binlog cache memory access: 99.95% ( 52384 Memory / 52412 Total)

-------- MyISAM Metrics ------------------------------------------------------
[!!] Key buffer used: 18.3% (49M used / 268M cache)
[OK] Key buffer size / total MyISAM indexes: 256.0M/291.0K
[OK] Read Key buffer hit rate: 100.0% (9M cached / 510 reads)
[!!] Write Key buffer hit rate: 1.4% (1K cached / 1K writes)

-------- InnoDB Metrics ------------------------------------------------------
[--] InnoDB is enabled.
[!!] InnoDB buffer pool / data size: 128.0M/204.8M
[!!] InnoDB buffer pool <= 1G and innodb_buffer_pool_instances(!=1).
&#91;OK&#93; InnoDB Used buffer: 87.50% (7167 used/ 8191 total)
&#91;OK&#93; InnoDB Read buffer efficiency: 99.97% (88883891 hits/ 88912014 total)
&#91;OK&#93; InnoDB Write log efficiency: 96.95% (869671 hits/ 897014 total)
&#91;OK&#93; InnoDB log waits: 0.00% (0 waits / 27343 writes)

-------- ThreadPool Metrics --------------------------------------------------
&#91;--&#93; ThreadPool stat is disabled.

-------- AriaDB Metrics ------------------------------------------------------
&#91;--&#93; AriaDB is disabled.

-------- TokuDB Metrics ------------------------------------------------------
&#91;--&#93; TokuDB is disabled.

-------- Galera Metrics ------------------------------------------------------
&#91;--&#93; Galera is disabled.

-------- Replication Metrics -------------------------------------------------
&#91;--&#93; No replication slave(s) for this server.
&#91;--&#93; This is a standalone server..

-------- Recommendations -----------------------------------------------------
General recommendations:
    Run OPTIMIZE TABLE to defragment tables for better performance
    Restrict Host for user@% to user@SpecificDNSorIp
    When making adjustments, make tmp_table_size/max_heap_table_size equal
    Reduce your SELECT DISTINCT queries which have no LIMIT clause
    Increase table_open_cache gradually to avoid file descriptor limits
    Read this before increasing table_open_cache over 64: http://bit.ly/1mi7c4C
    Beware that open_files_limit (1024) variable
    should be greater than table_open_cache ( 256)
Variables to adjust:
    query_cache_type (=1)
    tmp_table_size (> 16M)
    max_heap_table_size (> 16M)
    table_open_cache (> 256)
    innodb_buffer_pool_size (>= 204M) if possible.
    innodb_buffer_pool_instances (=1)

Here is what you should do. First run this query



mysql> SELECT CEILING(Total_InnoDB_Bytes*1.6/POWER(1024,3)) RIBPS FROM
    -> (SELECT SUM(data_length+index_length) Total_InnoDB_Bytes
    -> FROM information_schema.tables WHERE engine='InnoDB') A;
+-------+
| RIBPS |
+-------+
|     1 |
+-------+
1 row in set (0.08 sec)

This will give you the RIBPS, Recommended InnoDB Buffer Pool Size (in GB)based on all InnoDB Data and Indexes with an additional 60%.

After the restart, run mysql for a week or two. Then, run this query:


SELECT (PagesData*PageSize)/POWER(1024,3) DataGB FROM
(SELECT variable_value PagesData
FROM information_schema.global_status
WHERE variable_name='Innodb_buffer_pool_pages_data') A,
(SELECT variable_value PageSize
FROM information_schema.global_status
WHERE variable_name='Innodb_page_size') B;

This will give you how many actual pages of InnoDB data reside in the InnoDB Buffer Pool.

CentOS 7 minimal systems, use the commands “ip addr” and “ip link” to find the details of a network interface card. To know the statistics use “ip -s link”.

To view the details of the network interface cards, enter the following commands:

# ip addr

To view the statistics of your network interfaces, enter the command:


# ip link

OR


# ip -s link

How do I enable and use “ifconfig” Command in CentOS 7 minimal servers?


# yum provides ifconfig


# yum install net-tools

Timestamped bash history logging may be a great idea for logging changes. An example would look like this:

 
Mar 28 15:08:26 database root: root@192.168.1.1 [10882]: shutdown -r now [0]
Mar 28 15:08:31 database root: root@192.168.1.1 [10882]: cd /var/log [0]

This can be done by adding 2 lines to the root .bashrc file or as a custom file in /etc/profile.d/ folder:

 
whoami="$(whoami)@$(echo $SSH_CONNECTION | awk '{print $1}')"
export PROMPT_COMMAND='RETRN_VAL=$?;logger -p local6.debug "$whoami [$$]: $(history 1 | sed "s/^[ ]*[0-9]\+[ ]*//" ) [$RETRN_VAL]"'

then a single line added to /etc/rsyslog.conf:

 
local6.*                /var/log/bash.log

After this all commands will be logged to the /var/log/bash.log file.

UPDATE wp_options SET option_value = replace(option_value, ‘http://www.oldurl’, ‘http://www.newurl’) WHERE option_name = ‘home’ OR option_name = ‘siteurl’;

UPDATE wp_posts SET guid = replace(guid, ‘http://www.oldurl’,’http://www.newurl’);

UPDATE wp_posts SET post_content = replace(post_content, ‘http://www.oldurl’, ‘http://www.newurl’);

UPDATE wp_postmeta SET meta_value = replace(meta_value,’http://www.oldurl’,’http://www.newurl’);

mysql> UPDATE wp_options SET option_value = replace(option_value, ‘http://www.oldurl’, ‘http://www.newurl’) WHERE option_name = ‘home’ OR option_name = ‘siteurl’;
Query OK, 0 rows affected (0.00 sec)
Rows matched: 2 Changed: 0 Warnings: 0

mysql> UPDATE wp_posts SET guid = replace(guid, ‘http://www.oldurl’,’http://www.newurl’);
Query OK, 0 rows affected (0.02 sec)
Rows matched: 964 Changed: 0 Warnings: 0

mysql> UPDATE wp_posts SET post_content = replace(post_content, ‘http://www.oldurl’, ‘http://www.newurl’);
Query OK, 0 rows affected (0.05 sec)
Rows matched: 964 Changed: 0 Warnings: 0

mysql> UPDATE wp_postmeta SET meta_value = replace(meta_value,’http://www.oldurl’,’http://www.newurl’);g
Query OK, 0 rows affected (0.01 sec)
Rows matched: 686 Changed: 0 Warnings: 0

Source: https://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=2109922

Virtual machine loses network connectivity intermittently
In the Windows Event Viewer (Expand Windows Logs and select System), you see entries similar to:

Intel(R) 82574L Gigabit Network Connection Network link is disconnected

or

Intel(R) 82574L Gigabit Network Connection Network link has been established at 1Gbps full duplex
This issue would occur in these environments:
The virtual machine is Windows2012 or Windows 2012 R2
The virtual machine is using E1000 or E1000E driver

Cause

This issue occurs due to the driver bundled with Microsoft Windows 2012.
Resolution
VMware is investigating this issue with the partners.

Currently, there is no resolution

To work around this issue, use VMXNET3 instead of E1000 or E1000e driver.

# mysql -u root -p 
MariaDB [(none)]> wp_database -e "EXPLAIN SELECT * FROM posts"
 EXPLAIN SELECT * FROM 2qGr3sjm_posts;
+------+-------------+----------------+------+---------------+------+---------+------+------+-------+
| id   | select_type | table          | type | possible_keys | key  | key_len | ref  | rows | Extra |
+------+-------------+----------------+------+---------------+------+---------+------+------+-------+
|    1 | SIMPLE      |          posts | ALL  | NULL          | NULL | NULL    | NULL | 2519 |       |
+------+-------------+----------------+------+---------------+------+---------+------+------+-------+

Or from command line

#  mysql -u root -p wp_database -e "EXPLAIN SELECT * FROM posts"