sslocal
apt install shadowsocks sslocal -c ss.json -d startss.json: { "server":"45.32.10.1", "server_port":8892, "local_port":1080, "password":"zxzxzxzxzx", "timeout":600, "method":"aes-256-cfb" } proxychains4
apt install proxychains4 vi /etc/proxychains4.conf proxychains4 curl ip.cn # 查看是否代理成功 proxychains bash # 代理整个终端proxychains4.conf: socks5 127.0.0.1 1080 GitHub
polipo可代替proxychains4
apt-get install polipo vi /etc/polipo/config service polipo restart export http_proxy="http://127.0.0.1:8123/" # 可能需要执行 可加入.bashrc/etc/polipo/config: logSyslog = true logFile = /var/log/polipo/polipo.log proxyAddress = "0.0.0.0" socksParentProxy = "127.0.0.1:1080" socksProxyType = socks5 proxyPort = 8123 chunkHighMark = 50331648 objectHighMark = 16384 serverMaxSlots = 64 serverSlots = 16 serverSlots1 = 32 genpac
Read More →
#查看swap比率 cat /proc/sys/vm/swappiness # open /etc/sysctl.conf as root. Then, change or add this line to the file vm.swappiness = 10 # Reboot for the change to take effect. # You can also change the value while your system is still running with sysctl vm.swappiness=10 # You can also clear your swap by running swapoff -a and then swapon -a as root instead of rebooting to achieve the same effect. swapoff -a swapon -a
1. set fileencoding 查看文件编码 2. set fileencdding=utf-8 设置文件编码 按wq保存 3. :e ++enc=cp936 # vim打开文档后,encoding=utf-8(locale决定的),fileencoding=latin1(自动编码判断机制不准导致的),termencoding=空(默认无需转换term编码),显示文件为乱码
rpm -ivh mysql-community-common-5.7.22-1.el7.x86_64.rpm mysql-community-libs-5.7.22-1.el7.x86_64.rpm rpm -ivh mysql-community-client-5.7.22-1.el7.x86_64.rpm mysql-community-server-5.7.22-1.el7.x86_64.rpm mysqld --user=mysql --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data/ --initialize service mysqld start grep 'temporary password' /var/log/mysqld.log mysql -uroot -p ALTER USER 'root'@'localhost' IDENTIFIED BY 'cffEx2016!'; GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'cffEx2016!' WITH GRANT OPTION; 拷贝my.cnf到/etc/目录下 my.cnf 权限为-rw-r--r-- 重启mysql
一、结构 简介:
系统主要通过Keepalived+MySQL双主来实现MySQL-HA,我们必须保证两台MySQL数据库的数据完全一样,基本设计是两台MySQL互为主从关系,通过Keepalived配置虚拟IP,实现当其中的一台MySQL数据库宕机后,应用能够自动切换到另外一台MySQL数据库,保证系统的高可用。
拓扑环境:
OS: Red Hat Enterprise Linux Server release 7.1 (Maipo)
MySQL version: 5.5.59-log MySQL Community Server (GPL)
Keepalived version: keepalived-1.3.5-1.el7.x86_64
MySQL-Vip: 172.28.10.100
MySQL-Master1: 172.28.10.82
MySQL-Master2: 172.28.10.83
结构图:
二、 MySQL环境部署 修改MySQL配置文件
以下为master1数据库的my.cnf配置文件内容,目录为/etc/my.cnf,配置完成后重启数据库
[client] port = 3382 socket = /var/lib/mysql/mysql.sock [mysqld] port = 3382 socket = /var/lib/mysql/mysql.sock skip-external-locking key_buffer_size = 16M max_allowed_packet = 1M table_open_cache = 64 sort_buffer_size = 512K net_buffer_length = 8K read_buffer_size = 256K read_rnd_buffer_size = 512K myisam_sort_buffer_size = 8M log-bin=mysql-bin binlog_format=mixed # master2的server-id改为2 server-id = 1 # 要产生log的数据库 binlog-do-db=pms_db # 不产生log的数据库 binlog-ignore-db=mysql # 要复制的数据库 replicate-do-db=pms_db # 不复制的数据库 replicate-ignore-db=mysql log-bin=mysql-bin innodb_data_home_dir = /var/lib/mysql innodb_data_file_path = ibdata1:10M:autoextend innodb_log_group_home_dir = /var/lib/mysql innodb_buffer_pool_size = 16M innodb_additional_mem_pool_size = 2M innodb_log_file_size = 5M innodb_log_buffer_size = 8M innodb_flush_log_at_trx_commit = 1 innodb_lock_wait_timeout = 50 [mysqldump] quick max_allowed_packet = 16M [mysql] no-auto-rehash [myisamchk] key_buffer_size = 20M sort_buffer_size = 20M read_buffer = 2M write_buffer = 2M [mysqlhotcopy] interactive-timeout 将master1设置为master2的主服务器
Read More →
arp -a 搜索同一网段机器 iptables -L -n -v 查看已添加的iptables规则 清空日志文件: cat /dev/null>/var/log/messages
https://www.linuxidc.com/Linux/2016-07/133234.htm
sestatus
防火墙
接下来就可以针对这个目录通过一些命令查看配置文件在哪了,如下
/usr/bin/mysql –verbose –help | grep -A 1 ‘Default options’