I-MongoDB 4.4, uyifaka njani kwiinguqulelo zamva nje ze-LTS Ubuntu

Malunga ne-mongoDB 4.4

Kwinqaku elilandelayo siza kujonga indlela yokufaka iMongoDB kwi-Ubuntu. Yinkqubo ye database ejolise kuxwebhu, umthombo osekwe kwitekhnoloji I-NoSQL. Oku kuyahambelana nophuhliso lwesicelo sewebhu sangoku. Ibandakanya izinto ezinje ngokuguquguquka, iilwimi ezibuzayo, izikhombisi zesekondari, nokunye okuninzi. Ukongeza, ibonelela ngokusasazeka okukhulu kunye nokusebenza ukwenza usetyenziso lwangoku olunolwazi olunamandla.

IMondoDB endaweni yokugcina idatha kwiitafile, njengoko kusenziwa kulwazi lweedatha, igcina kubume bedatha ye-BSON (inkcazo efana neJSON) ngeschema esinamandla. Oku kwenza ukudityaniswa kwedatha kwizicelo ezithile kube lula kwaye kukhawuleze.

I-MongoDB yinkqubo yedatha ilungele ukusetyenziswa kwimveliso kunye nokusebenza okuninzi. Olu hlobo lwedatha lusetyenziswa ngokubanzi kumzi mveliso. Ikhowudi yayo yemithombo iyafumaneka kwiinkqubo zokusebenza ezinje; Gnu / Linux, Windows, OSX kunye neSolaris.

Kule migca ilandelayo siza kubona ukuba sinokwenza njani faka iMongoDB 4.4 kwiinguqulelo ezintathu zokugqibela ze-Ubuntu LTS, usebenzisa umphathi wepakeji efanelekileyo.

Faka iMongoDB 4.4

Inkxaso yeqonga

Ushicilelo loLuntu lweMongoDB 4.4 luqukethe ezi nguqulelo ze-Ubuntu LTS zilandelayo (Inkxaso yexesha elideI-64-bit: 20.04 LTS ('Focal'), 18.04 LTS ('Bionic'), 16.04 LTS ('Xenial')

Indawo ehlala i-Ubuntu yokugcina enika okanye inokubonelela ngohlobo oludlulileyo lweMongoDB. Ngesi sizathu Siza kufaka ingxelo yokugqibela yale nkqubo yedatha kwindawo yayo esemthethweni.

Yongeza indawo ekugcinwa kuyo iMongoDB kwi-Ubuntu

Ukufaka uhlobo lwamva nje lweMongoDB yoHlelo loLuntu kwi-Ubuntu, Kufuneka sifake ukuxhomekeka okuyimfuneko. Ukwenza njalo, kuya kufuneka sivule kuphela i-terminal (Ctrl + Alt + T) kwaye sisebenzise le miyalelo ilandelayo:

sudo apt update

sudo apt install dirmngr gnupg apt-transport-https ca-certificates software-properties-common

Siyaqhubeka ukungenisa isitshixo se-GPG esidlangalaleni kwi-MongoDB. Oku kusetyenziswa yinkqubo yolawulo lwephakheji kwaye siza kuyongeza usebenzisa wget ukusuka kwisiphelo sendlela (Ctrl + Alt + T):

ukungenisa isitshixo se-gpg repo MongoDB 4.4

wget -qO - https://www.mongodb.org/static/pgp/server-4.4.asc | sudo apt-key add -

Emveni kwalonto Siza kwenza ifayile ye-mongodb-org-4.4.list eya kuthi iqulethe iinkcukacha zokugcina iMongoDB yokugcina ingxelo yoBuntu esiyisebenzisayo. Le fayile iya kubekwa kulawulo /etc/apt/source.list.d/. Ukuyila, kuya kufuneka siphumeze lo myalelo ulandelayo kwisiphelo sendlela (Ctrl + Alt + T), ngokuxhomekeke kuhlobo lwenkqubo yethu:

Ubuntu 20.04 (ejolise)

yongeza i-repo ye-Ubuntu 20.04

echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu focal/mongodb-org/4.4 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-4.4.list

Ubuntu 18.04 (iBionic)

echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu bionic/mongodb-org/4.4 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-4.4.list

Ubuntu 16.04 (Xenial)

echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/4.4 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-4.4.list

Ngoku siza kuya Hlaziya uluhlu lwesoftware ekhoyo ukusuka koovimba:

sudo apt update

Faka indawo yedatha ye-MongoDB 4.4 kwi-Ubuntu

Ngoku ukuba indawo yokugcina iMongoDB yenziwe, sinako faka ingxelo yokugqibela ezinzileyo ukusebenzisa lo myalelo ulandelayo kwisiphelo sendlela (Ctrl + Alt + T):

faka i-mongodb-org

sudo apt install mongodb-org

Ngexesha lofakelo ifayile yoqwalaselo iyakwenziwa /etc/mongod.conf, isikhombisi sedatha / var / lib / mongodngomkhombandlela welog / var / log / mongodb.

Ngokuzenzekelayo, iMongoDB isebenza phantsi kweakhawunti yomsebenzisi we-mongodb. Ukuba sitshintsha umsebenzisi, kufuneka sitshintshe nemvume kwidatha kunye neerekhodi zemikhombandlela, ukunika ukufikelela kwezi zikhombisi.

Ukuqala kweMongoDB

Ngoku sinako qala kwaye uqinisekise inkqubo ye-mongod ukusebenzisa le miyalelo ilandelayo:

inqanaba lesimo

sudo systemctl start mongod
sudo systemctl status mongod

inqanaba lenkonzo ye-mongod

sudo service mongod start
sudo service mongod status

Qala iqokobhe le-mongo

Ukuba yonke into ichanekile, sinako qala iqokobhe le-mongo ngaphandle kokhetho lokunxibelelana ne-mongodb eqhuba kumamkeli wasekhaya usebenzisa izibuko elingagqibekanga 27017:

Ukuqala kwegobolondo ye-mongo

mongo

Khupha ngaphandle

ukuba susa ngokupheleleyo iMongoDB, kubandakanya usetyenziso lweMongoDB, iifayile zoqwalaselo, kunye nayo nayiphi na imikhombandlela enedatha kunye nelogKwisiphelo sendlela (Ctrl + Alt + T) kuya kufuneka senze le miyalelo ilandelayo:

sudo service mongod stop

sudo apt-get purge mongodb-org*

sudo rm -r /var/log/mongodb

sudo rm -r /var/lib/mongodb

Kwaye ngale nto sele sine-MongoDB kwi-Ubuntu. Ngolwazi oluthe kratya malunga nokucwangciswa kunye nokusetyenziswa kweMongoDB 4.4, abasebenzisi banokudibana maxwebhu enikezelwa kwiwebhusayithi yeprojekthi.


Umxholo wenqaku uyabambelela kwimigaqo yethu imigaqo yokuziphatha yokuhlela. Ukuxela impazamo cofa apha.

Yiba ngowokuqala ukuphawula

Shiya uluvo lwakho

Idilesi yakho ye email aziyi kupapashwa.

*

*

  1. Uxanduva lwedatha: UMiguel Ángel Gatón
  2. Injongo yedatha: Ulawulo lwe-SPAM, ulawulo lwezimvo.
  3. Umthetho: Imvume yakho
  4. Unxibelelwano lwedatha: Idatha ayizukuhanjiswa kubantu besithathu ngaphandle koxanduva lomthetho.
  5. Ukugcinwa kweenkcukacha
  6. Amalungelo: Ngalo naliphi na ixesha unganciphisa, uphinde uphinde ucime ulwazi lwakho.

bool(yinyani)