For research only Click here download
Monthly filing: June 2017
ASP program system installation inspection tool
Permission denied cannot be started after Zabbix Agent configuration is completed
# cat /var/log/zabbix/zabbix_agentd.log 63133:20170601:092700.920 ************************** 63133:20170601:092700.920 using configuration file: /etc/zabbix/zabbix_agentd.conf 63133:20170601:092700.920 cannot set resource limit: [13] Permission denied 63133:20170601:092700.920 cannot disable core dump, exiting... 63137:20170601:092711.171 Starting Zabbix Agent [cong171163]. Zabbix 3.2.6 (revision 67849). 63137:20170601:092711.171 **** Enabled features **** 63137:20170601:092711.171 IPv6 support: YES 63137:20170601:092711.171 TLS support: YES 63137:20170601:092711.171 ************************** ......
# setenforce 0
# vim /etc/selinux/config SELINUX=enforcing
SELINUX=disabled
# ss -tnl State Recv-Q Send-Q Local Address:Port Peer Address:Port LISTEN 0 128 *:22 *:* LISTEN 0 100 127.0.0.1:25 *:* LISTEN 0 128 *:10050 *:* LISTEN 0 80 :::3306 :::* LISTEN 0 128 :::22 :::* LISTEN 0 100 ::1:25 :::* LISTEN 0 128 :::10050 :::*
Zabbix Chinese monitoring server graph chart shows garbled code
"Microsoft Yahei. ttf" is named "msyh. ttf"
define('ZBX_GRAPH_FONT_NAME', 'DejaVuSans'); define('ZBX_FONT_NAME', 'DejaVuSans');
define('ZBX_GRAPH_FONT_NAME', 'msyh'); define('ZBX_FONT_NAME', 'msyh');
Solution for SQL server seriously occupying system CUP resources
sp_who active
MariaDB MaxScale 2.1.3 Read write separation installation configuration of middleware database
Operating system: CentOS Linux release 7.3.1611 (Core)
Database: MariaDB-10.2.6-linux-glibc_214-x86_64
MaxScale server: 10.200.10.55
Master server: 172.16.8.56
Slave server: 172.16.8.57
Slave server: 172.16.8.58
[ root@localhost ~]# groupadd maxscale [ root@localhost ~]# useradd -g maxscale maxscale [ root@localhost ~]# cd /usr/local [ root@localhost local]# wget //downloads.mariadb.com/MaxScale/2.1.3/centos/7server/x86_64/maxscale-2.1.3.centos.7.tar.gz [ root@localhost local]# tar zxvf maxscale-2.1.3.centos.7.tar.gz [ root@localhost local]# ln -s maxscale-2.1.3.centos.7 maxscale [ root@localhost local]# cd maxscale [ root@zhu56 maxscale]# chown -R maxscale var
[ root@localhost ~]# mkdir /var/log/maxscale [ root@localhost ~]# mkdir /var/lib/maxscale [ root@localhost ~]# mkdir /var/run/maxscale [ root@localhost ~]# mkdir /var/cache/maxscale
[ root@localhost ~]# chown maxscale /var/log/maxscale [ root@localhost ~]# chown maxscale /var/lib/maxscale [ root@localhost ~]# chown maxscale /var/run/maxscale [ root@localhost ~]# chown maxscale /var/cache/maxscale
[ root@localhost ~]# cp /usr/local/maxscale/etc/maxscale.cnf.template /etc/maxscale.cnf
MariaDB [(none)]> create user 'jiankongdb'@'%' identified by 'jiankong123'; MariaDB [(none)]> grant SELECT on mysql.user to 'jiankongdb'@'%'; MariaDB [(none)]> GRANT SELECT ON mysql.db TO 'jiankongdb'@'%'; MariaDB [(none)]> GRANT SELECT ON mysql.tables_priv TO 'jiankongdb'@'%'; MariaDB [(none)]> GRANT SHOW DATABASES ON *.* TO 'jiankongdb'@'%'; MariaDB [(none)]> grant REPLICATION CLIENT on *.* to 'jiankongdb'@'%'; MariaDB [(none)]> GRANT replication slave, replication client,SELECT ON *.* TO jiankongdb@'%';
MariaDB [(none)]> SHOW GRANTS FOR'jiankong'@'%';
[ root@localhost ~]# vim /etc/maxscale.cnf # MaxScale documentation on GitHub: # //github.com/mariadb-corporation/MaxScale/blob/2.1/Documentation/Documentation-Contents.md # Global parameters # # Complete list of configuration options: # //github.com/mariadb-corporation/MaxScale/blob/2.1/Documentation/Getting-Started/Configuration-Guide.md #Global configuration [maxscale] threads=1 # Server definitions # # Set the address of the server to the network # address of a MySQL server. # [server1] type=server address=172.16.8.56 port=3306 protocol=MySQLBackend serv_weight=1 [server2] type=server address=172.16.8.57 port=3306 protocol=MySQLBackend serv_weight=3 [server3] type=server address=172.16.8.58 port=3306 protocol=MySQLBackend serv_weight=3 # Monitor for the servers # # This will keep MaxScale aware of the state of the servers. # MySQL Monitor documentation: # //github.com/mariadb-corporation/MaxScale/blob/2.1/Documentation/Monitors/MySQL-Monitor.md #MariaDB status monitoring [MySQL Monitor] type=monitor module=mysqlmon servers=server1,server2,server3 user=jiankong passwd=jiankong123 monitor_interval=10000 Detect_stale_master=true # Even if the slave fails, ensure that the master is responsible for reading and writing # Service definitions # # Service Definition for a read-only service and # a read/write splitting service. # # ReadConnRoute documentation: # //github.com/mariadb-corporation/MaxScale/blob/2.1/Documentation/Routers/ReadConnRoute.md #Read [Read-Only Service] type=service router=readconnroute servers=server1,server2,server3 user=jiankong passwd=jiankong123 router_options=slave Enable_root_user=1 # Allow root user to log in and execute Weightby=serv_weight # Master slave weight # ReadWriteSplit documentation: # //github.com/mariadb-corporation/MaxScale/blob/2.1/Documentation/Routers/ReadWriteSplit.md #Write [Read-Write Service] type=service router=readwritesplit servers=server1,server2,server3 user=jiankong passwd=jiankong123 max_slave_connections=100% Use_sql_variables_in=master # Ensure session consistency Enable_root_user=1 # Allow root login Max_slave_replication_lag=3600 # Allow slave synchronization time to exceed the master synchronization time, and do not route if it exceeds the master synchronization time # This service enables the use of the MaxAdmin interface # MaxScale administration guide: # //github.com/mariadb-corporation/MaxScale/blob/2.1/Documentation/Reference/MaxAdmin.md [MaxAdmin Service] type=service router=cli # Listener definitions for the services # # These listeners represent the ports the # services will listen on. # [Read-Only Listener] type=listener service=Read-Only Service protocol=MySQLClient port=4008 [Read-Write Listener] type=listener service=Read-Write Service protocol=MySQLClient port=4006 [MaxAdmin Listener] type=listener service=MaxAdmin Service protocol=maxscaled socket=default
[ root@localhost ~]# cp /usr/local/maxscale-2.1.3.centos.7/share/maxscale.service /usr/lib/systemd/system/ [ root@localhost ~]# vim /usr/lib/systemd/system/maxscale.service
[ root@localhost ~]# chmod 755 /usr/lib/systemd/system/maxscale.service [ root@localhost ~]# systemctl enable maxscale [ root@localhost ~]# systemctl daemon-reload [ root@localhost ~]# systemctl start maxscale
[ root@localhost ~]#Vi/etc/profile//Add the following content to the last line and exit! PATH=$PATH:/usr/local/maxscale/bin export PATH [ root@localhost ~]#Source/etc/profile//Make its variables take effect immediately
[ root@localhost ~]#Maxadmin//Enter MaxScale> list servers Servers. ---------------+--------------+-------+-------------+----------------- Server | Address | Port | Connections | Status ---------------+--------------+-------+-------------+----------------- server1 | 172.16.8.56 | 3306 | 0 | Master, Running server2 | 172.16.8.57 | 3306 | 0 | Slave, Running server2 | 172.16.8.58 | 3306 | 0 | Slave, Running ---------------+--------------+-------+-------------+-----------------
DirectAdmin Solution for Changing ID and IP Address
# cd /usr/local/directadmin/scripts # ./ getLicense.sh 7353 12345 # service directadmin restart
# cd /usr/local/directadmin/scripts # ./ getLicense.sh 7353 12345 127.0.0.1 # service directadmin restart
# cd /usr/local/directadmin/scripts # ./ ipswap.sh 10.200.10.26 10.200.200.26
# /etc/init.d/httpd restart # /etc/init.d/proftpd restart # /etc/init.d/exim restart # /etc/init.d/dovecot restart
# netstat -antp
# service directadmin restart Stopping DirectAdmin: [FAILED] Starting DirectAdmin: [ OK ] # service directadmin restart Stopping DirectAdmin: [FAILED] Starting DirectAdmin: [ OK ] # service directadmin restart Stopping DirectAdmin: [FAILED]
# whereis directadmin # cd /usr/local/directadmin # ./ directadmin The ip of this machine (10.200.10.26) does not match the ip in the license file Check the value of your ethernet_dev=venet0:1 setting in your /usr/local/directadmin/conf/directadmin.conf file and the output of /sbin/ifconfig
# ifconfig -a # vi conf/directadmin.conf ethernet_dev=venet0:1 change ethernet_dev=venet0:0
# ./ directadmin [ root@hip directadmin]# ./ directadmin Bind Error: Make sure there aren't any copies running in the background Address already in use
# yum install bind dbus dbus-libs -y # mv /etc/init.d/named /etc/init.d/named.bak # wget //www.directadmin.com/named # chmod 755 /etc/init.d/named # /sbin/chkconfig named reset # /etc/init.d/named restart