dmesg用來顯示內核環緩衝區(kernel-ring buffer)內容,內核將各類消息存放在這裏。在系統引導時,內核將與硬件和模塊初始化相關的信息填到這個緩衝區中。內核環緩衝區中的消息對於診斷系統問題 一般很是有用。在運行dmesg時,它顯示大量信息。一般經過less或grep使用管道查看dmesg的輸出,這樣能夠更容易找到待查信息。
linux
開機信息亦保存在/var/log目錄中,名稱爲dmesg的文件裏。
web
參 數: docker
-c 顯示信息後,清除ring buffer中的內容。 ubuntu
-s <緩衝區大小> 預設置爲8196,恰好等於ring buffer的大小。 vim
-n 設置記錄信息的層級。
服務器
-T 以當前時間的方式顯示時間信息,而不是圖1所示的開機時間
websocket
-d 顯示dmesg中兩條打印信息的時間間隔
cookie
最底下有個帖子,寫了幾個例子,很是不錯.講下我本身經過dmesg解決kurento一個bug.
app
Kurento的核心是媒體服務器,它被命名爲Kurento媒體服務器(**KMS**)。Kurento媒體服務器的媒體處理能力是插件式的,意思是它的功能都是能夠被激活和關閉插件模塊。並且,開發者能夠無縫地建立額外的模塊來擴展Kurento媒體服務器並動態插入。 Kurento媒體服務器提供即時可用的組通訊,混合,轉碼,錄製和播放。另外,它還提供一些高級的媒體處理模塊,包括有計算機視覺,虛擬現實,透鏡等。
less
部署過程以下:
1.必須是ubuntu的環境
2. 安裝kurento echo "deb http://ubuntu.kurento.org xenial kms6" | sudo tee /etc/apt/sources.list.d/kurento.list wget -O - http://ubuntu.kurento.org/kurento.gpg.key | sudo apt-key add - sudo apt-get update sudo apt-get install kurento-server
3. 安裝完成後修改配置文件 /etc/kurento/modules/kurento/WebRtcEndpoint.conf.ini 若是kurento-media-server部署在公網則不須要配置 添加 turnURL=user:password@address:port; 例如 turnURL=kurento:kurento@60.247.2.214:3478;
4. 啓動: sudo /etc/init.d/kurento-media-server-6.0 start
一切都很順利,沒有報錯,netstat能夠看到正在監聽端口:
root@im1:/app/logs/group_call# netstat -tunlp|grep 8888
tcp6 0 0 :::8888 :::* LISTEN 31224/kurento-media
可是telnet 127.0.0.1 8888 ,卻沒法連通,訪問超時.查看kurento的log:
2019-01-09 10:41:46,346857 31224 [0x00007f619a08c880] info KurentoServerMethods ServerMethods.cpp:89 ServerMethods() Not enough resources exception will be raised when resources reach 0.800000
2019-01-09 10:41:46,347738 31224 [0x00007f618f2d9700] debug KurentoWorkerPool WorkerPool.cpp:39 workerThreadLoop() Working thread starting
2019-01-09 10:41:46,347830 31224 [0x00007f618ead8700] debug KurentoWorkerPool WorkerPool.cpp:39 workerThreadLoop() Working thread starting
2019-01-09 10:41:46,347925 31224 [0x00007f619a08c880] info KurentoWebSocketTransport WebSocketTransport.cpp:209 WebSocketTransport() Secure websocket server not enabled
2019-01-09 10:41:46,349760 31224 [0x00007f619a08c880] info KurentoMediaServer main.cpp:256 main() Mediaserver started 2019-01-09 10:45:46,348005 31224 [0x00007f6187fff700] debug KurentoMediaSet MediaSet.cpp:122 doGarbageCollection() Running garbage collector
日誌中沒有任何錯誤,或者異常.
三.解決過程
1.防火牆關閉,仍是不行
2.重裝,重啓,仍是不行
3.關閉kurento服務,用nc起一個端口,發現是8888可使用的
root@im1:~# nc -lv 8888
4.換同個內網的服務器,仍是不行,試了下本身在騰訊雲的服務器,一點問題都沒有,懷疑是否是操做系統的關係
5.用docker搭建kurento,使用—net=host,由於kurento必須綁定外網地址,因此必定要用host模式.結果仍是同樣,能netstat端口8888,就是telnet不通.
6.打開dmesg -T,發現log:
[三 1月 9 10:32:06 2019] TCP: request_sock_TCP: Possible SYN flooding on port 8888. Dropping request. Check SNMP counters.
7.修改vim /etc/sysctl.conf,加入net.ipv4.tcp_syncookies = 1
8.終於能夠telnet 8888,發現kurento服務也正常了.
PS: linux dmesg命令參數及用法詳解(linux顯示開機信息命令)
https://blog.csdn.net/zhongyhc/article/details/8909905