Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to install and configure OrientDB Community Edition in CentOS 7

2025-02-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

In this issue, the editor will bring you about how to install and configure OrientDB Community Edition in CentOS 7. The article is rich in content and analyzes and describes it from a professional point of view. I hope you can get something after reading this article.

OrientDB is a next-generation multi-model open source NoSQL DBMS. By supporting multiple data models, OrientDB can provide more functionality and flexibility in a scalable, high-performance operational database.

How to install OrientDB Community Edition on a CentOS 7 server instance

precondition

A Vultr CentOS 7 server with sufficient memory. The recommended memory is 2GB or more. Suppose its IP address is 203.0.113.1.

You have logged in to the server instance as sudo.

The server instance has been updated to the latest stable state.

Step 1: installing the OpenJDK 8 package OrientDB requires Java 1.7 or later. In this article, I chose to install the OpenJDK 8 package, as follows:

Sudo yum install-y java-1.8.0-openjdk-devel

After installing OpenJDK 8, use the following command to verify the results:

Java-version

If there is no error, the output should be similar to:

Openjdk version "1.8.0141"

OpenJDK Runtime Environment (build 1.8.0_141-b16)

OpenJDK 64-Bit Server VM (build 25.141-b16, mixed mode)

Next, you need to set the javahome environment variable:

Echo "JAVA_HOME=$ (readlink-f / usr/bin/java | sed" sjanbinpool java usr/bin/java: ")" | sudo tee-a / etc/profile

Source / etc/profile

Step 2: install OrientDB

Download the latest stable version of OrientDB Community Edition from the official OrientDB download page and from the official OrientDB download page:

Cd

Wget https://bit.ly/orientdb-ce-imps-2-2-26-linux-O orientdb-community-importers-2.2.26.tar.gz

Extract the downloaded archive to the / opt directory:

Sudo tar-zxvf orientdb-community-importers-2.2.26.tar.gz-C / opt

Create a soft link to simplify daily use and future updates:

Sudo ln-s / opt/orientdb-community-importers-2.2.26/ / opt/orientdb

Step 3 (optional): configure a targeted OrientDB community version to reduce memory

Although the smooth running OrientDB community version requires your machine to have 2GB or more memory, you can still deploy it to a server with less memory.

To do this, use the

Vi

Open the / opt/orientdb/bin/server.sh file with a text editor:

Sudo vi / opt/orientdb/bin/server.sh

Find:

ORIENTDB_OPTS_MEMORY= "- Xms2G-Xmx2G"

As you can see, the Xms and Xmx parameters specify the initial and maximum memory allocation pool for the Java virtual machine when running OrientDB. To reduce memory usage for OrientDB, you can modify the following lines:

ORIENTDB_OPTS_MEMORY= "- Xms256m-Xmx512m"

Note: the value of Xms should not be less than 128m, otherwise the OrientDB server will not start.

Save and exit:

: wq!

Step 4: start the OrientDB server manually

By executing in the SSH terminal window

/ opt/orientdb/bin/server.sh

Script, you can manually start the OrientDB server:

Sudo / opt/orientdb/bin/server.sh

Because this is the first time you have run the OrientDB server, the script will ask you to set a password for the directed root user, such as here

Yourpasswordhere

. . If you leave the password field blank, the script automatically generates a password for the OrientDBroot user. The credentials created here will be used for authentication when you log in using a binary connection (OrientDB console) or a web connection (OrientDB Studio).

If the OrientDB server is started correctly, you will see a message line:

2017-08-22 04 INFO OrientDB Server is active 02 09 065 V2.2.26 (build ae9fcb9c075e1d74560a336a96b57d3661234c7b). [OServer]

Whenever you want to exit, press ctrl-c to stop the OrientDB server.

Step 5: connect to the OrientDB server

When the OrientDB server is up and running, it listens on port 2424 (for binary connections) and port 2480 (for HTTP connections). This means that you can not only use OrientDB's console, but also use a web browser to connect to a running OrientDB server.

Option 1: use an OrientDB console

Keep the server's SSH connection .sh script running properly, and then establish a second SSH connection on the same server instance.

In the second SSH console window, start the OrientDB console on the server using the following command:

Sudo / opt/orientdb/bin/console.sh

In the shell of the console, connect to the OrientDB server as follows:

Orientdb > connect remote:127.0.0.1 root yourpasswordhere

If you successfully connect to the OrientDB server, you will see the following output:

Connecting to remote Server instance [remote:127.0.0.1] with user 'root'...OK

Orientdb {server=remote:127.0.0.1/} >

When finished, type exit to exit the OrientDB console.

Note: you can also use the local

Console.sh (on Linux)

Or

Console.bat (on Windows)

The script connects to the OrientDB server. In this case, you need to allow inbound traffic on server port 2424.

Sudo firewall-cmd-zone=public-permanent-add-port=2424/tcp

Sudo firewall-cmd-reload

Option 2: through a web browser

A more intuitive way to connect to an OrientDB server is to use a web browser.

First, you need to open port 2480 of the OrientDB server, as follows:

Sudo firewall-cmd-zone=public-permanent-add-port=2480/tcp

Sudo firewall-cmd-reload

Next, point your favorite web browser to http://www.banwagongvps.com, and you will be redirected to a page called OrientDB Studio. On this page, you can log in using the root credentials you set earlier.

In the OrientDB Studio web interface, you can do almost everything you can do in the OrientDB console. You are free to navigate the system and test your query.

Step 6: configure OrientDB as a server

In step 2, we have installed OrientDB in the / opt/orientdb-community-importers-2.2.26 directory. But so far, all these files are just a bunch of scripts that can only be executed manually. In order to set up the operating server, OrientDB needs to be configured as a system-level daemon that will be started in the system boot.

1) in the first terminal window, press ctrl-c to stop the OrientDB server.

2) create a dedicated user locator that belongs to the OrientDB group and is used to run the OrientDB server:

Sudo useradd-r orientdb-s / sbin/nologin

3) change the ownership of the OrientDB directory:

Sudo chown-R orientdb:orientdb / opt/orientdb-community-importers-2.2.26

4) use

Vi

The editor opens the / opt/orientdb/bin/orientdb.sh file:

Sudo vi / opt/orientdb/bin/orientdb.sh

Locate the following line:

ORIENTDB_DIR= "YOUR_ORIENTDB_INSTALLATION_PATH"

ORIENTDB_USER= "USER_YOU_WANT_ORIENTDB_RUN_WITH"

Replace with the following:

ORIENTDB_DIR= "/ opt/orientdb"

ORIENTDB_USER= "orientdb"

Save and exit:

: wq!

5) to prevent unauthorized access to the configuration of OrientDB, you need to modify the permissions on the configuration file as follows:

Sudo chmod 640 / opt/orientdb/config/orientdb-server-config.xml

6) create a systemd startup script to manage the OrientDB service:

Sudo cp / opt/orientdb/bin/orientdb.service / etc/systemd/system

Open this file using the vi editor:

Sudo vi / etc/systemd/system/orientdb.service

Locate the following line:

User=ORIENTDB_USER

Group=ORIENTDB_GROUP

ExecStart=$ORIENTDB_HOME/bin/server.sh

Replace with the following:

User=orientdb

Group=orientdb

Save and exit:

: wq!

Start and enable the OrientDB service:

ExecStart=/opt/orientdb/bin/server.sh

In this way, OrientDB will automatically start the system boot.

This is how to install and configure OrientDB Community Edition in CentOS 7. If you happen to have similar doubts, please refer to the above analysis to understand. If you want to know more about it, you are welcome to follow the industry information channel.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report