Install RavenDB NoSQL database on Ubuntu 20.04

To
You can download this article in PDF format to support us through the following link.

Download the guide in PDF format

turn off
To

To
To

NoSQL databases are completely different from relational database management systems. NoSQL is in a non-tabular format, and the way of storing data is different from relational tables. Based on their data model, there are many types of NoSQL databases. Mainly include documents, key values, wide columns and graphics. A beautiful feature about them is that they provide flexible modes and can easily handle large amounts of data and high user load expansion.

The world-class RavenDB document database is one of these databases, and it seeks better ways to process information to support powerful 21st century applications. Before starting to install RavenDB, let us briefly look at its features:

  • Cluster-wide ACID transactions
  • Pull copy: Pull copy can easily update the most remote edge unit.
  • Graph API: Looking to the future, predicting data.
  • Distributed counters: RavenDB’s distributed counters allow multiple servers to handle aggregated loads.
  • Restore revision-Database Time Machine: Easily fix database-wide errors.
  • Multi-model architecture
  • Multi-platform
  • High availability
  • Advanced query engine
  • Database management studio
  • Integration with RDBMS
  • Easy to use

System Requirements

RavenDB is written in .NET Core, so it requires the same set of prerequisites as .NET Core.

Now it’s time to install RavenDB.

Step 1: Update the server and install .NET Core Runtime

We will start to install RavenDB by satisfying all requirements. Since it requires .NET Core, let’s continue to quickly install it on Ubuntu 20.04.

Add the Microsoft package signing key to your list of trusted keys and add the package repository. Open a terminal and run the following command:

sudo apt update && sudo apt upgrade
wget https://packages.microsoft.com/config/ubuntu/20.04/packages-microsoft-prod.deb -O packages-microsoft-prod.deb
sudo dpkg -i packages-microsoft-prod.deb

Install runtime

The .NET Core runtime allows you to run applications that are made using .NET Core and do not include a runtime. The following command will install ASP.NET Core Runtime.

sudo apt-get update; 
  sudo apt-get install -y apt-transport-https && 
  sudo apt-get update && 
  sudo apt-get install -y aspnetcore-runtime-3.1

Step 2: Download and install RavenDB on Ubuntu 20.04

Use wget to download the latest stable version of RavenDB, or you can go directly to RavenDB download page And get the Linux version from the platform list. We will use wget in this guide as shown below

cd ~
wget -O ravendb.tar.bz2 https://hibernatingrhinos.com/downloads/RavenDB%20for%20Linux%20x64/latest

Extract file

Run the tar command below to extract the compressed file

tar xvjf ravendb.tar.bz2

Unzipping the above file will create a folder (RavenDB) containing the installation files. At this point, you can start the installation wizard by running the run.ps1 (or run.sh) script.

$ cd ~/RavenDB
$ ./run.sh

Use Ctrl + c to Exit it

Step 3: Configure RavenDB on Ubuntu 20.04

Let’s edit the settings.json file so that we can perform the settings remotely using the browser. Note that when we run the server for the first time, settings.json is created from settings.default.json. Therefore, if settings.json does not exist, edit settings.default.json. Set ServerUrl including the port and security you want RavenDB to listen on. UnsecuredAccess is allowed to be used for PrivateNetwork, PublicNetwork or LocalNetwork to allow insecure access without SSL.

sudo vim ~/RavenDB/Server/settings.json

{
    "ServerUrl": "http://172.21.83.113:8080",
    "Setup.Mode": "Initial",
    "DataDir": "RavenData",
    "Security.UnsecuredAccessAllowed": "PrivateNetwork"
}

If your server is on a public cloud such as AWS, GCP or Azure, please add more lines to the configuration so that you can access RavenDB remotely from your browser. An example is shown below:

{
    "ServerUrl": "http://172.21.83.113:443",
    "Setup.Mode": "Initial",
    "DataDir": "RavenData",
    "PublicServerUrl": "",
    "Security.UnsecuredAccessAllowed": "PrivateNetwork"
}

We set the Security.UnsecuredAccessAllowed field to PublicNetwork, which will allow you to connect remotely. In order to use RavenDB on port 443, run the following command to allow RavenDB to use port 443 (non-root process):

sudo setcap CAP_NET_BIND_SERVICE=+eip ./RavenDB/Server/Raven.Server

Set directory permissions

RavenDB requires write access to the following locations:

  • The folder where the RavenDB server is running
  • Data folder
  • Log folder

Modify the firewall to allow the new RavenDB port

If you are running a firewall, consider adding a port configured with RavenDB for listening.

sudo ufw allow 8080

Step 4: Configure RavenDB as a service on Ubuntu 20.04

Now, we will set up and start the RavenDB service.

Open the terminal with super user privileges and create the file /etc/systemd/system/ravendb.service with the following content:

sudo vim /etc/systemd/system/ravendb.service

[Unit]
Description=RavenDB v4.0
After=network.target

[Service]
LimitCORE=infinity
LimitNOFILE=65536
LimitRSS=infinity
LimitAS=infinity
User=root                          ##<==Add the user you would wish to run the service
Restart=on-failure
Type=simple
ExecStart=/path/to/RavenDB/run.sh  ##<==Enter the path where your run.sh is found here

[Install]
WantedBy=multi-user.target

After adding the new file, reload the daemon, start and enable the ravendb service, as shown below:

sudo systemctl daemon-reload
sudo systemctl enable ravendb.service
sudo systemctl start ravendb.service

Check its status:

$ systemctl status ravendb.service
● ravendb.service - RavenDB v4.0
     Loaded: loaded (/etc/systemd/system/ravendb.service; enabled; vendor preset: enabled)
     Active: active (running) since Sun 2020-07-19 20:31:36 EAT; 5min ago
   Main PID: 43408 (run.sh)
      Tasks: 23 (limit: 1035)
     Memory: 39.7M
     CGroup: /system.slice/ravendb.service
             ├─43408 /bin/bash /home/tech/RavenDB/run.sh
             └─43435 ./Raven.Server --browser

Run RavenDB installation wizard

So far, everything should be working properly, and we are ready to run the RavenDB installation wizard. Point your browser to the URL configured in step 3. In this guide, we will use http://172.21.83.113:8080. Follow the screenshot below to get RavenDB

RavenDB End User License Agreement

Scroll through the end of the license agreement and click "accept"

RavenDB installation wizard

Depending on the level of security required, there are 3 options. The first is to use the LetsEncrypt certificate to set up, the second is to provide our own certificate, and the third is without any certificate. Since I currently do not have a certificate, we will continue to use the "unsafe" option. Please note that if you want to add a new node to create a cluster, you can use "Cluster setup"The same is true for the option. Choose the security option that best meets your needs here.

Install RavenDB NoSQL database on Ubuntu 20.04

Unsafe mode settings

Enter the port and IP address from which you want to access Studio. Accept the risk and click "next"

Install RavenDB NoSQL database on Ubuntu 20.04

Restart the server

The configuration should now be complete​​. Click "Restart the server"

Install RavenDB NoSQL database on Ubuntu 20.04

Enter the studio

If all goes well, you should move to the studio. If you use your own certificate, the browser will ask you to authenticate.

Install RavenDB NoSQL database on Ubuntu 20.04

Step 5: Create a database

Once in RavsnDB, we can easily create a sample database. Click on "database"

Install RavenDB NoSQL database on Ubuntu 20.04

Then "New database"

Install RavenDB NoSQL database on Ubuntu 20.04

in conclusion

In RavenDB, you can do many things. Talk about creating documents, adding data, encrypting, creating clusters and hooking it up to your API. RavenDB documentation It's a good place to get all the detailed information. They even provide sample data that you can use to test the application. It is very cool and the interface is great. It is worth thinking about:

"It was gone yesterday. Tomorrow has not arrived yet. We only have today. Let's start."-Mother Teresa

Database-related courses:


The ultimate MySQL training camp: from SQL beginners to experts

The ultimate MySQL training camp: from SQL beginners to experts

★★★★★
(42457)

$ 16.20

$ 173.52

In stock

Buy now

Install RavenDB NoSQL database on Ubuntu 20.04Udemy.com


MongoDB-Complete Developer's Guide 2020

MongoDB-Complete Developer's Guide 2020

★★★★★
(8667)

$ 17.35

$ 190.88

In stock

Buy now

Install RavenDB NoSQL database on Ubuntu 20.04Udemy.com

If you are interested in other NoSQL settings, please check the following:

How to install MongoDB 4 on Debian 10 (Buster)

How to install MongoDB 4 on RHEL 8 / CentOS 8

How to install MongoDB 4 on CentOS 7

Use Prometheus and Grafana to monitor MySQL and MongoDB-PMM

To
You can download this article in PDF format to support us through the following link.

Download the guide in PDF format

turn off
To

To
To

Sidebar