新聞中心
運(yùn)行滑稽:Redis編譯安裝遇到的錯(cuò)誤

成都創(chuàng)新互聯(lián)公司不只是一家網(wǎng)站建設(shè)的網(wǎng)絡(luò)公司;我們對(duì)營銷、技術(shù)、服務(wù)都有自己獨(dú)特見解,公司采取“創(chuàng)意+綜合+營銷”一體化的方式為您提供更專業(yè)的服務(wù)!我們經(jīng)歷的每一步也許不一定是最完美的,但每一步都有值得深思的意義。我們珍視每一份信任,關(guān)注我們的網(wǎng)站建設(shè)、網(wǎng)站制作質(zhì)量和服務(wù)品質(zhì),在得到用戶滿意的同時(shí),也能得到同行業(yè)的專業(yè)認(rèn)可,能夠?yàn)樾袠I(yè)創(chuàng)新發(fā)展助力。未來將繼續(xù)專注于技術(shù)創(chuàng)新,服務(wù)升級(jí),滿足企業(yè)一站式營銷型網(wǎng)站需求,讓再小的成都品牌網(wǎng)站建設(shè)也能產(chǎn)生價(jià)值!
Redis是一個(gè)快速、高效、穩(wěn)定的鍵/值存儲(chǔ)數(shù)據(jù)庫,被廣泛應(yīng)用于互聯(lián)網(wǎng)產(chǎn)品的緩存以及分布式計(jì)算中。在進(jìn)行Redis開發(fā)或者使用時(shí),我們需要進(jìn)行Redis的編譯安裝。然而,在安裝的過程中,可能會(huì)遇到一些錯(cuò)誤和問題。本文將介紹一些在Redis編譯安裝過程中可能遇到的錯(cuò)誤以及解決方法。
錯(cuò)誤1:MAKE時(shí)出現(xiàn)undefined reference to `__atomic_compare_exchange_16′
當(dāng)執(zhí)行make命令時(shí),可能會(huì)遇到以下錯(cuò)誤:
/src/redis-4.0.14/src/redis-cli.o: In function `cliRefreshPrompt':
redis-cli.c:(.text+0x4c4): undefined reference to `__atomic_compare_exchange_16'
collect2: error: ld returned 1 exit status
make[1]: *** [redis-cli] Error 1
make[1]: Leaving directory `/src/redis-4.0.14/src'
make: *** [all] Error 2
造成該錯(cuò)誤的原因是編譯器缺少libatomic庫。解決該問題的方法是安裝libatomic庫。以Ubuntu為例,執(zhí)行以下命令即可安裝:
sudo apt-get install libatomic-ops-dev
錯(cuò)誤2:error while loading shared libraries: libjemalloc.so.1: cannot open shared object file: No such file or directory
當(dāng)解決了上面的錯(cuò)誤后,可能會(huì)遇到以下錯(cuò)誤:
redis-server: error while loading shared libraries: libjemalloc.so.1: cannot open shared object file: No such file or directory
這是因?yàn)閖emalloc庫沒有安裝或者庫路徑?jīng)]有添加到/etc/ld.so.conf中。解決該問題的方法是安裝jemalloc庫,并將其路徑添加到/etc/ld.so.conf中。
以Ubuntu為例,執(zhí)行以下命令安裝jemalloc庫:
sudo apt-get install libjemalloc-dev
然后將其路徑添加到/etc/ld.so.conf中:
echo "/usr/lib/x86_64-linux-gnu/" | sudo tee -a /etc/ld.so.conf
sudo ldconfig
錯(cuò)誤3:configure: error: no suitable allocator found
執(zhí)行./configure時(shí)可能會(huì)出現(xiàn)以下錯(cuò)誤:
checking for suitable allocator... (none found)
configure: error: no suitable allocator found
該錯(cuò)誤的原因是缺少jemalloc庫。解決該問題的方法同上,即安裝jemalloc庫并將其路徑添加到/etc/ld.so.conf中。
錯(cuò)誤4:make: *** No rule to make target ‘src/makefile.dep’, needed by ‘src/quicklist.o’. Stop.
執(zhí)行make命令時(shí)可能會(huì)出現(xiàn)以下錯(cuò)誤:
make: *** No rule to make target 'src/makefile.dep', needed by 'src/quicklist.o'. Stop.
該錯(cuò)誤的原因是makefile.dep文件不存在。解決該問題的方法是重新生成makefile.dep文件:
make deps
然后再執(zhí)行make命令即可。
錯(cuò)誤5:/usr/bin/ld: cannot find -lssl
執(zhí)行make時(shí)可能會(huì)出現(xiàn)以下錯(cuò)誤:
/usr/bin/ld: cannot find -lssl
collect2: error: ld returned 1 exit status
make[1]: *** [redis-server] Error 1
make[1]: Leaving directory `/src/redis-4.0.14/src'
make: *** [all] Error 2
該錯(cuò)誤的原因是缺少openssl庫。解決該問題的方法是安裝openssl庫,在Ubuntu中執(zhí)行以下命令即可安裝:
sudo apt-get install libssl-dev
總結(jié):
在進(jìn)行Redis的編譯安裝過程中,可能會(huì)遇到一些問題和錯(cuò)誤,例如缺少依賴庫或者缺少某個(gè)文件等等。本文介紹了一些可能遇到的錯(cuò)誤及其解決方法,希望對(duì)大家有所幫助。
成都服務(wù)器租用選創(chuàng)新互聯(lián),先試用再開通。
創(chuàng)新互聯(lián)(www.cdcxhl.com)提供簡(jiǎn)單好用,價(jià)格厚道的香港/美國云服務(wù)器和獨(dú)立服務(wù)器。物理服務(wù)器托管租用:四川成都、綿陽、重慶、貴陽機(jī)房服務(wù)器托管租用。
網(wǎng)頁標(biāo)題:運(yùn)行滑稽Redis編譯安裝遇到的錯(cuò)誤(redis編譯安裝報(bào)錯(cuò))
分享URL:http://fisionsoft.com.cn/article/cojdhjp.html


咨詢
建站咨詢
