天兔監控SQL Azure報錯解決案例

chenfeng發表於2017-10-23
今天新增了兩臺SQL Azure,需要加入到天兔監控裡進行監控,但加完後發現介面裡顯示失敗。


天兔日誌有如下錯誤資訊:


# cat /usr/local/lepus/logs/lepus.log
..............................................................................................
2017-10-23 08:08:15 [WARNING] check sqlserver sc-stable.database.chinacloudapi.cn:1433 : 
(40615, "Cannot open server 'sc-stable' requested by the login. Client with IP address 
'54.222.221.177' is not allowed to access the server.  
To enable access, use the Windows Azure Management Portal or run sp_set_firewall_rule on the master database 
to create a firewall rule for this IP address or address range.  
It may take up to five minutes for this change to take effect.DB-Lib error message 40615, 
severity 14:\nGeneral SQL Server error: Check messages from the SQL Server\nDB-Lib error message 20002, severity 9:\nAdaptive Server connection failed\n")
...............................................................................................


根據日誌內容判斷應該是SQL Azure的防火牆拒絕了來自IP為54.222.221.177的連線。


解決方案:
用Navicat連線SQLServer資料庫,右鍵-->SQL Azure防火牆規則
新增54.222.221.177網段,比如:


新增完後重啟天兔程式後問題得到解決:
[root@c58c333ef639 logs]# lepus stop
lepus processes id 17026 been stop
lepus processes id 17042 been stop
lepus processes id 17370 been stop
lepus processes id 17546 been stop
lepus processes id 17594 been stop
lepus processes id 17625 been stop
[root@c58c333ef639 logs]# /usr/local/sbin/lepus: line 16: 17026 Terminated              nohup python lepus.py &>logs/lepus.log


[root@c58c333ef639 logs]# lepus start
lepus server start success!


再次檢視介面顯示正常:

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/15498/viewspace-2146266/,如需轉載,請註明出處,否則將追究法律責任。

相關文章