EOS智能合約開發(二十二)編譯EOS中MongoDB無法下載問題解決。

由於EOS出新版本了,今天clone了最新版本,開始編譯,之前編譯的時候,也出現過MongoDB無法下載的問題。只能等到晚上網絡狀況比較好的時候,處理。今天,我們就針對這個問題,我們研究一下,如何出來。
問題提出
我們在編譯EOS的時候,執行eosio_build.sh,編譯一段時間後,出現如下問題。

        Checking MongoDB installation.
        MongoDB configuration found at /home/cuijb/opt/mongodb/mongod.conf.

        Checking MongoDB C++ driver installation.
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   617    0   617    0     0    869      0 --:--:-- --:--:-- --:--:--   870
  4 6193k    4  254k    0     0   1443      0  1:13:15  0:03:00  1:10:15     0
  4 6193k    4  254k    0     0    628      0  2:48:19  0:06:54  2:41:25     0
curl: (56) GnuTLS recv error (-54): Error in the pull function.

gzip: stdin: unexpected end of file
tar: 歸檔文件中異常的 EOF
tar: 歸檔文件中異常的 EOF
tar: Error is not recoverable: exiting now
        Unable to unarchive file /tmp/mongo-c-driver-1.10.2.tar.gz.
        Exiting now.

反覆幾次,都是一樣的問題。
我們就找找出現這個問題的編譯腳本是怎麼寫的。分析一下。
打開eos/scripts目錄下的eosio_build_ubuntu.sh
查詢到這裏是下載MongoDB的地方

		STATUS=$(curl -LO -w '%{http_code}' --connect-timeout 30 https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-3.6.3.tgz)
		if [ "${STATUS}" -ne 200 ]; then
			printf "\\tUnable to download MongoDB at this time.\\n"
			printf "\\n\\tExiting now.\\n\\n"
			exit 1;
		fi

我們先去網上,自行下載MongoDB,然後將MongoDB放到 /tmp/下。
下載地址:
https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-3.6.3.tgz
然後註釋掉eosio_build_ubuntu.sh腳本中上面那段話。
重新執行eosio_build.sh
問題搞定。
在編譯的過程中,如果遇到其他無法下載的問題,也是如法炮製,就可以解決問題。希望可以幫到大家。謝謝
這次,我們真針對 Ubuntu16.04版本做處理,其他版本沒有研究。

崔江保
2019年3月19日

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章