ProxySQL配置之MySQL服务器配置
备注:文章编写时间201904-201905期间,后续官方在github的更新没有被写入
MySQL服务器配置 [MySQL Server Configuration]
一、在ProxySQL中配置后端MySQL服务器[Configuring Backend MySQL Servers in ProxySQL]
MySQL服务器的配置在mysql_servers表和mysql_replication_hostgroups表(可选)中。
友情提醒:在阅读下部分之前,请确保了解了ProxySQL使用的多层配置系统。
特别注意:
1)如果没有运行LOAD MYSQL SERVERS TO RUNTIME,那么mysql_servers和mysql_replication_hostgroups表中的更改不会生效;
2)如果没有运行SAVE MYSQL SERVERS TO DISK 保存配置到的磁盘,那么mysql_servers和mysql_replication_hostgroups表中的更改
将在重启/崩溃后丢失。
对mysql_servers和mysql_replication_hostgroups的更改将被视为编辑配置文件而不会被保存或让服务重新加载。
二、将mysql服务器配置从MEMORY层复制到RUNTIME层 [Copying mysql servers from memory to runtime]
将MySQL服务器和复制主机组配置信息从MEMORY层数据库加载到RUNTIME层的数据结构在中:
Admin> LOAD MYSQL SERVERS TO RUNTIME;
其他可被接受的别名操作:
Admin> LOAD MYSQL SERVERS TO RUN;
Admin> LOAD MYSQL SERVERS FROM MEM;
Admin> LOAD MYSQL SERVERS FROM MEMORY;
三、将mysql服务器配置从MEMORY层持久化到DISK层[Copying mysql servers from memory to disk]
将MySQL服务器和复制主机组配置信息从MEMORY层数据库保留到DISK的数据库上:
Admin> SAVE MYSQL SERVERS TO DISK;
其他可被接受的别名操作:
Admin> SAVE MYSQL SERVERS FROM MEM;
Admin> SAVE MYSQL SERVERS FROM MEMORY;
四、将mysql服务器配置从RUNTIME层拷贝到MEMORY层[Copying mysql servers from runtime to memory]
将MySQL服务器和复制主机组配置信息从RUNTIME层数据结构保留到MEMORY数据库:
Admin> SAVE MYSQL SERVERS TO MEMORY;
其他可被接受的别名操作:
Admin> SAVE MYSQL SERVERS TO MEM;
Admin> SAVE MYSQL SERVERS FROM RUN;
Admin> SAVE MYSQL SERVERS FROM RUNTIME;
五、将mysql服务器从DISK层复制到MEMORY层[Copying mysql servers from disk to memory]
将MySQL服务器和复制主机组配置信息从DISK层数据库加载到MEMORY层数据库:
Admin> LOAD MYSQL SERVERS TO MEMORY;
其他可被接受的别名操作:
Admin> LOAD MYSQL SERVERS TO MEM;
Admin> LOAD MYSQL SERVERS FROM DISK;
六、新增服务器[Adding a new server]
如果要添加新服务器,必须在mysql_servers表中插入新行以记录相关配置信息。注意,该表有几列是有默认值的。
以下添加了一个具有所有默认配置的新后端(服务器):
Admin> SELECT * FROM mysql_servers;
Empty set (0.00 sec)
Admin> INSERT INTO mysql_servers (hostname) VALUES ('127.0.0.1');
Query OK, 1 row affected (0.00 sec)
Admin> SELECT * FROM mysql_servers\G
*************************** 1. row ***************************
hostgroup_id: 0
hostname: 127.0.0.1
port: 3306
gtid_port: 0
status: ONLINE
weight: 1
compression: 0
max_connections: 1000
max_replication_lag: 0
use_ssl: 0
max_latency_ms: 0
comment:
1 row in set (0.00 sec)
七、将新服务器添加到主机组[Adding new servers to a hostgroup]
Admin> SELECT hostgroup_id,hostname,port FROM mysql_servers;
+--------------+-----------+------+
| hostgroup_id | hostname | port |
+--------------+-----------+------+
| 0 | 127.0.0.1 | 3306 |
+--------------+-----------+------+
1 row in set (0.00 sec)
INSERT INTO mysql_servers (hostgroup_id, hostname ,port)
VALUES (1, '127.0.0.1' ,24801), (1, '127.0.0.1' ,24802), (1,'127.0.0.1' ,24803);
Query OK, 3 rows affected (0.00 sec)
Admin> SELECT hostgroup_id,hostname,port FROM mysql_servers;
+--------------+-----------+-------+
| hostgroup_id | hostname | port |
+--------------+-----------+-------+
| 0 | 127.0.0.1 | 3306 |
| 1 | 127.0.0.1 | 24801 |
| 1 | 127.0.0.1 | 24802 |
| 1 | 127.0.0.1 | 24803 |
+--------------+-----------+-------+
4 rows in set (0.00 sec)
八、配置与后端的连接数限制[Limiting the number of connections to a backend]
Admin> SELECT hostgroup_id,hostname,port,max_connections FROM mysql_servers;
+--------------+-----------+-------+-----------------+
| hostgroup_id | hostname | port | max_connections |
+--------------+-----------+-------+-----------------+
| 0 | 127.0.0.1 | 3306 | 1000 |
| 1 | 127.0.0.1 | 24801 | 1000 |
| 1 | 127.0.0.1 | 24802 | 1000 |
| 1 | 127.0.0.1 | 24803 | 1000 |
+--------------+-----------+-------+-----------------+
4 rows in set (0.00 sec)
Admin> UPDATE mysql_servers SET max_connections=10 WHERE hostname='127.0.0.1' AND port=24802;
Query OK, 1 row affected (0.00 sec)
Admin> SELECT hostgroup_id,hostname,port,max_connections FROM mysql_servers;
+--------------+-----------+-------+-----------------+
| hostgroup_id | hostname | port | max_connections |
+--------------+-----------+-------+-----------------+
| 0 | 127.0.0.1 | 3306 | 1000 |
| 1 | 127.0.0.1 | 24801 | 1000 |
| 1 | 127.0.0.1 | 24802 | 10 |
| 1 | 127.0.0.1 | 24803 | 1000 |
+--------------+-----------+-------+-----------------+
4 rows in set (0.00 sec)
九、通过改变后端的权重来确定流量的优先级[Prioritizing traffic by changing the weight of a backend]
特别注意:权重仅在主机组内起作用,值越大被分到的流量的几率越多!!
Admin> SELECT hostgroup_id,hostname,port,weight FROM mysql_servers;
+--------------+-----------+-------+--------+
| hostgroup_id | hostname | port | weight |
+--------------+-----------+-------+--------+
| 0 | 127.0.0.1 | 3306 | 1 |
| 1 | 127.0.0.1 | 24801 | 1 |
| 1 | 127.0.0.1 | 24802 | 1 |
| 1 | 127.0.0.1 | 24803 | 1 |
+--------------+-----------+-------+--------+
4 rows in set (0.00 sec)
Admin> UPDATE mysql_servers SET weight=1000 WHERE port IN (24803) AND hostgroup_id=1;
Query OK, 1 row affected (0.00 sec)
Admin> SELECT hostgroup_id,hostname,port,weight FROM mysql_servers;
+--------------+-----------+-------+--------+
| hostgroup_id | hostname | port | weight |
+--------------+-----------+-------+--------+
| 0 | 127.0.0.1 | 3306 | 1 |
| 1 | 127.0.0.1 | 24801 | 1 |
| 1 | 127.0.0.1 | 24802 | 1 |
| 1 | 127.0.0.1 | 24803 | 1000 |
+--------------+-----------+-------+--------+
4 rows in set (0.00 sec)
十、对特定后端使用SSL连接[Using SSL connections for a specific backend]
此示例显示如何为后端配置SSL(一个状态值而已),(但这不是全局配置SSL,全局请移步SSL configuration)。
Admin> SELECT hostgroup_id,hostname,port,use_ssl FROM mysql_servers;
+--------------+-----------+-------+---------+
| hostgroup_id | hostname | port | use_ssl |
+--------------+-----------+-------+---------+
| 0 | 127.0.0.1 | 3306 | 0 |
| 1 | 127.0.0.1 | 24801 | 0 |
| 1 | 127.0.0.1 | 24802 | 0 |
| 1 | 127.0.0.1 | 24803 | 0 |
+--------------+-----------+-------+---------+
4 rows in set (0.00 sec)
Admin> UPDATE mysql_servers SET use_ssl=1 WHERE hostname='127.0.0.1' AND port=3306;
Query OK, 1 row affected (0.00 sec)
Admin> SELECT hostgroup_id,hostname,port,use_ssl FROM mysql_servers;
+--------------+-----------+-------+---------+
| hostgroup_id | hostname | port | use_ssl |
+--------------+-----------+-------+---------+
| 0 | 127.0.0.1 | 3306 | 1 |
| 1 | 127.0.0.1 | 24801 | 0 |
| 1 | 127.0.0.1 | 24802 | 0 |
| 1 | 127.0.0.1 | 24803 | 0 |
+--------------+-----------+-------+---------+
4 rows in set (0.00 sec)
十一、配置自动忽略(有复制延时的SLAVE)的延时阀值 [Automatically shunning slaves with replication lag]
Admin> SELECT hostgroup_id,hostname,port,max_replication_lag FROM mysql_servers;
+--------------+-----------+-------+---------------------+
| hostgroup_id | hostname | port | max_replication_lag |
+--------------+-----------+-------+---------------------+
| 0 | 127.0.0.1 | 3306 | 0 |
| 1 | 127.0.0.1 | 24801 | 0 |
| 1 | 127.0.0.1 | 24802 | 0 |
| 1 | 127.0.0.1 | 24803 | 0 |
+--------------+-----------+-------+---------------------+
4 rows in set (0.00 sec)
Admin> UPDATE mysql_servers SET max_replication_lag=30 WHERE hostname='127.0.0.1' AND port=24803;
Query OK, 1 row affected (0.00 sec)
Admin> SELECT hostgroup_id,hostname,port,max_replication_lag FROM mysql_servers;
+--------------+-----------+-------+---------------------+
| hostgroup_id | hostname | port | max_replication_lag |
+--------------+-----------+-------+---------------------+
| 0 | 127.0.0.1 | 3306 | 0 |
| 1 | 127.0.0.1 | 24801 | 0 |
| 1 | 127.0.0.1 | 24802 | 0 |
| 1 | 127.0.0.1 | 24803 | 30 |
+--------------+-----------+-------+---------------------+
4 rows in set (0.00 sec)
使用此配置后,只有在主从复制延迟超过30秒的情况下,SLAVE才会被自动的暂时忽略。
如果max_replication_lag列设置为零(SET max_replication_lag = 0),则Monitor模块根本不会检查复制延迟,
即使复制延迟超过了阈值。更多信息请参阅参数mysql-monitor_slave_lag_when_null。
十二、将同一个服务器添加到两个不同的主机组[Adding a server to two different hostgroups]
mysql_servers表上的主键为(hostgroup_id,hostname,port);这意味着同一服务器可以存在于两个不同的主机组中。
Admin> SELECT hostgroup_id,hostname,port,weight,max_replication_lag FROM mysql_servers;
+--------------+-----------+-------+--------+---------------------+
| hostgroup_id | hostname | port | weight | max_replication_lag |
+--------------+-----------+-------+--------+---------------------+
| 0 | 127.0.0.1 | 3306 | 1 | 0 |
| 1 | 127.0.0.1 | 24801 | 1 | 0 |
| 1 | 127.0.0.1 | 24802 | 1 | 0 |
| 1 | 127.0.0.1 | 24803 | 1000 | 30 |
+--------------+-----------+-------+--------+---------------------+
4 rows in set (0.00 sec)
Admin> INSERT INTO mysql_servers(hostgroup_id,hostname,port) VALUES (1,'127.0.0.1',3306);
Query OK, 1 row affected (0.00 sec)
Admin> SELECT hostgroup_id,hostname,port,weight,max_replication_lag FROM mysql_servers;
+--------------+-----------+-------+--------+---------------------+
| hostgroup_id | hostname | port | weight | max_replication_lag |
+--------------+-----------+-------+--------+---------------------+
| 0 | 127.0.0.1 | 3306 | 1 | 0 |
| 1 | 127.0.0.1 | 24801 | 1 | 0 |
| 1 | 127.0.0.1 | 24802 | 1 | 0 |
| 1 | 127.0.0.1 | 24803 | 1000 | 30 |
| 1 | 127.0.0.1 | 3306 | 1 | 0 |
+--------------+-----------+-------+--------+---------------------+
5 rows in set (0.00 sec)
Admin> UPDATE mysql_servers SET max_replication_lag=30, weight=1000;
Query OK, 5 rows affected (0.00 sec)
Admin> UPDATE mysql_servers SET weight=1 WHERE hostname='127.0.0.1' AND hostgroup_id=1 AND port=3306;
Query OK, 1 row affected (0.00 sec)
Admin> SELECT hostgroup_id,hostname,port,weight,max_replication_lag FROM mysql_servers;
+--------------+-----------+-------+--------+---------------------+
| hostgroup_id | hostname | port | weight | max_replication_lag |
+--------------+-----------+-------+--------+---------------------+
| 0 | 127.0.0.1 | 3306 | 1000 | 30 |
| 1 | 127.0.0.1 | 24801 | 1000 | 30 |
| 1 | 127.0.0.1 | 24802 | 1000 | 30 |
| 1 | 127.0.0.1 | 24803 | 1000 | 30 |
| 1 | 127.0.0.1 | 3306 | 1 | 30 |
+--------------+-----------+-------+--------+---------------------+
5 rows in set (0.00 sec)
在上面的示例中,对于hostgroup为1的组来说,如果配置为提供读取流量,则99.95%的流量将发送到权重为1000的24801、24802和24803
这3台服务器上,而0.05%的流量将正常发送到3306上。如果24801、24802和24803这3台服务器都不可用,那么所有的读取流量都将
发往3306上。
注意:max_replication_lag仅适用于SLAVE节点。如果服务器未启用复制功能,则Monitor不会执行任何操作。
十三、在后端服务器上启用压缩[Enable compression on a backend server]
要启用压缩,只需将mysql_servers.compression列设置为非零值就足够了。
请注意:
1、压缩功能仅在将该设置加载到RUNTIME层后新建立的连接上生效,之前已有连接不生效。
2、这里的压缩是指ProxySQL作为Client与后端MySQL进行通信时,使用的对数据进行压缩的功能,类似MySQL客户端的–compress选项。
MySQL 压缩协议适合的场景是 MySQL 的服务器端和客户端之间传输的数据量很大,或者可用带宽不高的情况,典型的场景有如下两个 :
1> 查询大量的数据,带宽不够(比如导出数据的时候)
2> 复制的时候 binlog 量太大,启用 slave_compressed_protocol 参数进行日志压缩复制。
Admin> SELECT hostgroup_id,hostname,port,compression FROM mysql_servers;
+--------------+-----------+-------+-------------+
| hostgroup_id | hostname | port | compression |
+--------------+-----------+-------+-------------+
| 0 | 127.0.0.1 | 3306 | 0 |
| 1 | 127.0.0.1 | 24801 | 0 |
| 1 | 127.0.0.1 | 24802 | 0 |
| 1 | 127.0.0.1 | 24803 | 0 |
| 1 | 127.0.0.1 | 3306 | 0 |
+--------------+-----------+-------+-------------+
5 rows in set (0.00 sec)
Admin> UPDATE mysql_servers SET compression=1 WHERE hostname='127.0.0.1' AND port=24802 AND hostgroup_id=1;
Query OK, 1 row affected (0.00 sec)
Admin> SELECT hostgroup_id,hostname,port,compression FROM mysql_servers;
+--------------+-----------+-------+-------------+
| hostgroup_id | hostname | port | compression |
+--------------+-----------+-------+-------------+
| 0 | 127.0.0.1 | 3306 | 0 |
| 1 | 127.0.0.1 | 24801 | 0 |
| 1 | 127.0.0.1 | 24802 | 1 |
| 1 | 127.0.0.1 | 24803 | 0 |
| 1 | 127.0.0.1 | 3306 | 0 |
+--------------+-----------+-------+-------------+
5 rows in set (0.00 sec)
十四、安全的禁用后端服务器[Gracefully disabling a backend server]
要安全的禁用后端服务器,需要将其状态更改为 OFFLINE_SOFT 即可。其上活动事务和连接仍将可用,但此后不会向该节点发送新流量。
Admin> SELECT hostgroup_id,hostname,port,status FROM mysql_servers;
+--------------+-----------+-------+--------+
| hostgroup_id | hostname | port | status |
+--------------+-----------+-------+--------+
| 0 | 127.0.0.1 | 3306 | ONLINE |
| 1 | 127.0.0.1 | 24801 | ONLINE |
| 1 | 127.0.0.1 | 24802 | ONLINE |
| 1 | 127.0.0.1 | 24803 | ONLINE |
| 1 | 127.0.0.1 | 3306 | ONLINE |
+--------------+-----------+-------+--------+
5 rows in set (0.00 sec)
Admin> UPDATE mysql_servers SET status='OFFLINE_SOFT' WHERE hostname='127.0.0.1' AND port=24802 AND hostgroup_id=1;
Query OK, 1 row affected (0.00 sec)
Admin> SELECT hostgroup_id,hostname,port,status FROM mysql_servers;
+--------------+-----------+-------+--------------+
| hostgroup_id | hostname | port | status |
+--------------+-----------+-------+--------------+
| 0 | 127.0.0.1 | 3306 | ONLINE |
| 1 | 127.0.0.1 | 24801 | ONLINE |
| 1 | 127.0.0.1 | 24802 | OFFLINE_SOFT |
| 1 | 127.0.0.1 | 24803 | ONLINE |
| 1 | 127.0.0.1 | 3306 | ONLINE |
+--------------+-----------+-------+--------------+
5 rows in set (0.00 sec)
十五、即刻禁用后端服务器[Immediately disabling a backend server]
要立即禁用后端服务器,需要将其状态更改为 OFFLINE_HARD 即可。此后,所有当前流量将立即终止,并且不会发送新流量到该节点。
Admin> SELECT hostgroup_id,hostname,port,status FROM mysql_servers;
+--------------+-----------+-------+--------------+
| hostgroup_id | hostname | port | status |
+--------------+-----------+-------+--------------+
| 0 | 127.0.0.1 | 3306 | ONLINE |
| 1 | 127.0.0.1 | 24801 | ONLINE |
| 1 | 127.0.0.1 | 24802 | OFFLINE_SOFT |
| 1 | 127.0.0.1 | 24803 | ONLINE |
| 1 | 127.0.0.1 | 3306 | ONLINE |
+--------------+-----------+-------+--------------+
5 rows in set (0.01 sec)
Admin> UPDATE mysql_servers SET status='OFFLINE_HARD' WHERE hostname='127.0.0.1' AND port=24801 AND hostgroup_id=1;
Query OK, 1 row affected (0.00 sec)
Admin> SELECT hostgroup_id,hostname,port,status FROM mysql_servers;
+--------------+-----------+-------+--------------+
| hostgroup_id | hostname | port | status |
+--------------+-----------+-------+--------------+
| 0 | 127.0.0.1 | 3306 | ONLINE |
| 1 | 127.0.0.1 | 24801 | OFFLINE_HARD |
| 1 | 127.0.0.1 | 24802 | OFFLINE_SOFT |
| 1 | 127.0.0.1 | 24803 | ONLINE |
| 1 | 127.0.0.1 | 3306 | ONLINE |
+--------------+-----------+-------+--------------+
5 rows in set (0.00 sec)
十六、重新启用脱机/禁用的后端服务器[Re-enabling an offline / disabled backend server]
要将离线的后端重新启用,只需将其状态更改回 ONLINE 就足够了。
Admin> SELECT hostgroup_id,hostname,port,status FROM mysql_servers;
+--------------+-----------+-------+--------------+
| hostgroup_id | hostname | port | status |
+--------------+-----------+-------+--------------+
| 0 | 127.0.0.1 | 3306 | ONLINE |
| 1 | 127.0.0.1 | 24801 | OFFLINE_HARD |
| 1 | 127.0.0.1 | 24802 | OFFLINE_SOFT |
| 1 | 127.0.0.1 | 24803 | ONLINE |
| 1 | 127.0.0.1 | 3306 | ONLINE |
+--------------+-----------+-------+--------------+
5 rows in set (0.00 sec)
Admin> UPDATE mysql_servers SET status='ONLINE' WHERE status NOT IN ('ONLINE'); ==>这里用了NOT,可根据实际情况修改过滤条件
Query OK, 2 rows affected (0.00 sec)
Admin> SELECT hostgroup_id,hostname,port,status FROM mysql_servers;
+--------------+-----------+-------+--------+
| hostgroup_id | hostname | port | status |
+--------------+-----------+-------+--------+
| 0 | 127.0.0.1 | 3306 | ONLINE |
| 1 | 127.0.0.1 | 24801 | ONLINE |
| 1 | 127.0.0.1 | 24802 | ONLINE |
| 1 | 127.0.0.1 | 24803 | ONLINE |
| 1 | 127.0.0.1 | 3306 | ONLINE |
+--------------+-----------+-------+--------+
5 rows in set (0.00 sec)
十七、删除后端服务器[Removing a backend server]
ProxySQL允许将一个后端服务器彻底的删除,只需要将其从mysql_servers表中完全删除即可。
Admin> SELECT hostgroup_id,hostname,port,status FROM mysql_servers;
+--------------+-----------+-------+--------+
| hostgroup_id | hostname | port | status |
+--------------+-----------+-------+--------+
| 0 | 127.0.0.1 | 3306 | ONLINE |
| 1 | 127.0.0.1 | 24801 | ONLINE |
| 1 | 127.0.0.1 | 24802 | ONLINE |
| 1 | 127.0.0.1 | 24803 | ONLINE |
| 1 | 127.0.0.1 | 3306 | ONLINE |
+--------------+-----------+-------+--------+
5 rows in set (0.00 sec)
注意:虽然可以直接执行删除操作,但是为了操作的平滑、安全,数据的完整、可控,还是建议先修改状态让其软下线,等待其上执行的所有SQL都结束后再执行后面的删除动作。
Admin> UPDATE mysql_servers SET status='OFFLINE_SOFT' WHERE hostgroup_id=1 AND port IN (3306,24802,24803);
Query OK, 3 rows affected (0.00 sec)
Admin> SELECT hostgroup_id,hostname,port,status FROM mysql_servers;
+--------------+-----------+-------+--------------+
| hostgroup_id | hostname | port | status |
+--------------+-----------+-------+--------------+
| 0 | 127.0.0.1 | 3306 | ONLINE |
| 1 | 127.0.0.1 | 24801 | ONLINE |
| 1 | 127.0.0.1 | 24802 | OFFLINE_SOFT |
| 1 | 127.0.0.1 | 24803 | OFFLINE_SOFT |
| 1 | 127.0.0.1 | 3306 | OFFLINE_SOFT |
+--------------+-----------+-------+--------------+
5 rows in set (0.00 sec)
Admin> DELETE FROM mysql_servers WHERE hostgroup_id=1 AND port IN (3306,24802,24803);
Query OK, 3 rows affected (0.00 sec)
Admin> SELECT hostgroup_id,hostname,port,status FROM mysql_servers;
+--------------+-----------+-------+--------+
| hostgroup_id | hostname | port | status |
+--------------+-----------+-------+--------+
| 0 | 127.0.0.1 | 3306 | ONLINE |
| 1 | 127.0.0.1 | 24801 | ONLINE |
+--------------+-----------+-------+--------+
2 rows in set (0.00 sec)
在ProxySQL内部,直接删除后端服务和将其设置为OFFLINE_HARD的方式相同。当执行LOAD MYSQL SERVERS TO RUNTIME时,
Hostgroup_Manager将检测到后端服务器已被删除,并在内部将其标记为OFFLINE_HARD。
ProxySQL配置之MySQL服务器配置的更多相关文章
- ProxySQL 配置详解及读写分离(+GTID)等功能说明 (完整篇)
ProxySQL是灵活强大的MySQL代理层, 是一个能实实在在用在生产环境的MySQL中间件,可以实现读写分离,支持 Query 路由功能,支持动态指定某个 SQL 进行 cache,支持动态加载配 ...
- 如何配置远程mysql服务器
如何配置远程mysql服务器 分配用户权限 可以先看一下目前的用户权限状况: use mysql; select host,user,password from user; 然后分配新的权限给某一用户 ...
- laravel5 数据库配置(MySQL)
laravel5 数据库配置(MySQL) 首先有一个安装完成可以运行的laravel框架. 配置database.php 进入laravel根目录. 在config目录下找到database.php ...
- [mysql]brew 安装 配置 操作 mysql(中文问题)
mac 下卸载mysqldmg mac下mysql的DMG格式安装内有安装文件,却没有卸载文件--很郁闷的事. 网上搜了一下,发现给的方法原来得手动去删. 很多文章记述要删的文件不完整,后来在stac ...
- ubuntu中为hive配置远程MYSQL database
一.安装mysql $ sudo apt-get install mysql-server 启动守护进程 $ sudo service mysql start 二.配置mysql服务与连接器 1.安装 ...
- cas+tomcat+shiro实现单点登录-3-CAS服务器深入配置(连接MYSQL)
目录 1.tomcat添加https安全协议 2.下载cas server端部署到tomcat上 3.CAS服务器深入配置(连接MYSQL) 4.Apache Shiro 集成Cas作为cas cli ...
- MySQL基础配置之mysql的默认字符编码的设置(my.ini设置字符编码) - 转载
MySQL基础配置之mysql的默认字符编码的设置(my.ini设置字符编码) MySQL的默认编码是Latin1,不支持中文,那么如何修改MySQL的默认编码呢,下面以设置UTF-8为例来说明. 需 ...
- mycat配置实现mysql读写分离
需要先把mysql的主从复制配置好,然后才可以开始mycat的配置 m ysql主从复制配置:https://www.cnblogs.com/renjianjun/p/9093062.html myc ...
- Centos7 安装配置优化mysql(mariadb分支)
1.说明 由于在centos7的yum仓库中没有mysql,centos7用mariadb替代了mysql. mariadb是mysql源代码的一个分支, mysql被ORACLE闭源,而mariad ...
随机推荐
- string的底层实现
String底层实现 string在C++也是一个重要的知识,但是想要用好它,就要知道它的底层是如何写的,才能更好的用好这个string,那么这次就来实现string的底层,但是string的接口功能 ...
- Tomcat 安装及配置,创建动态的web工程
Tomcat可以认为是对Servlet标准的实现,是一个具体的Servlet容器. 1) 将Tomcat的安装包解压到磁盘的任意位(非中文无空格) 2) Tomcat服务的 ...
- docker for window WSL 2 installation is incomplete 错误,导致docker无法启动
1.错误截图如下: 2.错误原因:由于wsl2版本旧,根据提示让我们手动更新包,去微软官网下载最新wsl2后,安装完成重启即可解决. 3.下载地址:download地址
- java后端接受Vue传递的List
Failed to resolve argument 1 of type 'java.util.List' org.springframework.web.bind.MissingServletReq ...
- 地址解析协议(ARP) 分析
什么是ARP协议 ARP(A ddress R esolution P rotocol)- 地址解析协议 ,用于将IP地址解析为MAC地址.复杂来说,ARP用于32位IPv4地址和以太网的48位MAC ...
- GDOI 2022 普及组游记
To LuoguDAY -1 期中考成绩下来了,全无了除了历史 (96) 和生物 (95) 还能看,剩下的-,语文 101.5 ,少错一道选择和断句就 107.5 了,居然比雌兔还低 数学少错一道选择 ...
- .Net之时间轮算法(终极版)定时任务
TimeWheelDemo 一个基于时间轮原理的定时器 对时间轮的理解 其实我是有一篇文章(.Net 之时间轮算法(终极版))针对时间轮的理论理解的,但是,我想,为啥我看完时间轮原理后,会采用这样的方 ...
- python将命令输出写入文件或临时缓存
python将命令输出写入文件 将文件写入到对应文件,方便后期处理或保存 def write_file(file_path): with open(file=file_path, mode=" ...
- 什么是双网口以太网IO模块
MXXXE系列远程IO模块工业级设计,适用于工业物联网和自动化控制系统,MxxxE工业以太网远程 I/O 配备 2 个mac层数据交换芯片的以太网端口,允许数据通过可扩展的菊花链以太网远程 I/O 阵 ...
- Nginx 浏览器缓存配置指令
# 浏览器缓存 # 当浏览器第一次访问服务器资源的时候,服务器返回到浏览器后,浏览器进行缓存 # 缓存的大概内容有: # 1.缓存过期的日期和时间 # 2.设置和缓存相关的配置信息 # 3.请求资源最 ...