最美情侣中文字幕电影,在线麻豆精品传媒,在线网站高清黄,久久黄色视频

歡迎光臨散文網(wǎng) 會(huì)員登陸 & 注冊(cè)

遇到mysqladmin flush-hosts報(bào)錯(cuò)解決思路

2023-03-27 11:20 作者:Ushua  | 我要投稿

背景

今天早上遇到有Hue用戶登錄不上,查看集群狀態(tài)服務(wù)有問題。

查看報(bào)錯(cuò)日志如下,應(yīng)該是對(duì)應(yīng)的用戶報(bào)錯(cuò)鏈接太多了,導(dǎo)致報(bào)錯(cuò)。而我們這邊的用戶都是運(yùn)維通過一個(gè)nginx中轉(zhuǎn)過來的,所以都是同一個(gè)ip地址。導(dǎo)致報(bào)這個(gè)錯(cuò)誤。

Processing exception: (1129, "Host 'cdh011' is blocked because of many connection errors; unblock with 'mysqladmin flush-hosts'"): Traceback (most recent call last):

?File "/opt/cloudera/parcels/CDH-5.15.0-1.cdh5.15.0.p0.21/lib/hue/build/env/lib/python2.7/site-packages/Django-1.6.10-py2.7.egg/django/core/handlers/base.py", line 112, in get_response

? ?response = wrapped_callback(request, *callback_args, **callback_kwargs)

?File "/opt/cloudera/parcels/CDH-5.15.0-1.cdh5.15.0.p0.21/lib/hue/build/env/lib/python2.7/site-packages/Django-1.6.10-py2.7.egg/django/db/transaction.py", line 370, in inner

? ?with self:

?File "/opt/cloudera/parcels/CDH-5.15.0-1.cdh5.15.0.p0.21/lib/hue/build/env/lib/python2.7/site-packages/Django-1.6.10-py2.7.egg/django/db/transaction.py", line 237, in __enter__

? ?if not connection.get_autocommit():

?File "/opt/cloudera/parcels/CDH-5.15.0-1.cdh5.15.0.p0.21/lib/hue/build/env/lib/python2.7/site-packages/Django-1.6.10-py2.7.egg/django/db/backends/__init__.py", line 331, in get_autocommit

? ?self.ensure_connection()

?File "/opt/cloudera/parcels/CDH-5.15.0-1.cdh5.15.0.p0.21/lib/hue/build/env/lib/python2.7/site-packages/Django-1.6.10-py2.7.egg/django/db/backends/__init__.py", line 127, in ensure_connection

? ?self.connect()

?File "/opt/cloudera/parcels/CDH-5.15.0-1.cdh5.15.0.p0.21/lib/hue/build/env/lib/python2.7/site-packages/Django-1.6.10-py2.7.egg/django/db/utils.py", line 99, in __exit__

? ?six.reraise(dj_exc_type, dj_exc_value, traceback)

?File "/opt/cloudera/parcels/CDH-5.15.0-1.cdh5.15.0.p0.21/lib/hue/build/env/lib/python2.7/site-packages/Django-1.6.10-py2.7.egg/django/db/backends/__init__.py", line 127, in ensure_connection

? ?self.connect()

?File "/opt/cloudera/parcels/CDH-5.15.0-1.cdh5.15.0.p0.21/lib/hue/build/env/lib/python2.7/site-packages/Django-1.6.10-py2.7.egg/django/db/backends/__init__.py", line 115, in connect

? ?self.connection = self.get_new_connection(conn_params)

?File "/opt/cloudera/parcels/CDH-5.15.0-1.cdh5.15.0.p0.21/lib/hue/build/env/lib/python2.7/site-packages/Django-1.6.10-py2.7.egg/django/db/backends/mysql/base.py", line 435, in get_new_connection

? ?conn = Database.connect(**conn_params)

?File "/opt/cloudera/parcels/CDH-5.15.0-1.cdh5.15.0.p0.21/lib/hue/build/env/lib/python2.7/site-packages/MySQL_python-1.2.5-py2.7-linux-x86_64.egg/MySQLdb/__init__.py", line 81, in Connect

? ?return Connection(*args, **kwargs)

?File "/opt/cloudera/parcels/CDH-5.15.0-1.cdh5.15.0.p0.21/lib/hue/build/env/lib/python2.7/site-packages/MySQL_python-1.2.5-py2.7-linux-x86_64.egg/MySQLdb/connections.py", line 193, in __init__

? ?super(Connection, self).__init__(*args, **kwargs2)

OperationalError: (1129, "Host 'cdh011' is blocked because of many connection errors; unblock with 'mysqladmin flush-hosts'")


解決方案

1.調(diào)整MAX_CONNECT_ERRORS參數(shù)大小

mysql>setglobal max_connect_errors=1000;

2.清理host_cache

  1. MySQL performance_schema下的hosts表和host_cache,host_cache表會(huì)記錄連接客戶端主機(jī)名、IP地址信息和其他連接信息,幫助診斷連接問題;

????????????需要關(guān)注的兩個(gè)列:

????????????SUM_CONNECT_ERRORS:連接錯(cuò)誤數(shù)

????????????COUNT_HANDSHAKE_ERRORS:握手錯(cuò)誤計(jì)數(shù)

????3.調(diào)大connect_timeout參數(shù)

????????????由于網(wǎng)絡(luò)原因或其它一些連接錯(cuò)誤會(huì)導(dǎo)致SUM_CONNECT_ERRORS累加1;

????????????網(wǎng)絡(luò)原因 Lost connection to MySQL server at 'XXX', system error: errno;

????????????網(wǎng)絡(luò)原因可以通過設(shè)置connect_timeout解決

????????????mysql>?show variables like 'connect_timeout';?

??????mysql>setglobal connect_timeout=20;


參考資料

https://www.jianshu.com/p/3a397a358a22


遇到mysqladmin flush-hosts報(bào)錯(cuò)解決思路的評(píng)論 (共 條)

分享到微博請(qǐng)遵守國家法律
哈尔滨市| 通许县| 尼木县| 青阳县| 东乡县| 东乡| 晋宁县| 墨脱县| 新建县| 通州区| 安徽省| 平阴县| 徐水县| 象山县| 荆门市| 上犹县| 陵川县| 湖州市| 华亭县| 新昌县| 昆明市| 巴彦县| 富顺县| 金秀| 滨州市| 巴林右旗| 保亭| 金门县| 大英县| 高要市| 平塘县| 常山县| 仁怀市| 麻阳| 武宣县| 渑池县| 蒙自县| 高雄县| 景谷| 修文县| 灯塔市|