One of the SEQUOIADB series: SEQUOIADB Installation, deployment

Source: Internet
Author: User

Before you analyze or participate in an open source project, it is necessary to understand the purpose of the project build.

Since SEQUOIADB is a NoSQL database product, it inevitably exists in the same functional point of the traditional relational database: Data increment, delete, change and query (CRUD).

First understand how to use, and then on the basis of the use, further analysis of its implementation.

The installation environment already listed in the previous article, as well as the sequoiadb.

With these conditions, then let's move on.

The content of this article is to install and deploy a clustered environment (or an environment that can be a standalone data node, to see personal preferences.) Standalone mode deployment can be obtained from the SEQUOIADB website's Information Center)

Enter the terminal, cut into the storage sequoiadb directory, my directory is the Home (~) directory.

The SEQUOIADB installation package is downloaded and is a tar.gz compressed package that needs to be decompressed first:

TAR-ZXVF sequoiadb-1.10-linux_x86_64-installer.tar.gz

This command extracts the compressed package to the current directory.

Execute the extracted run package:

sudo./sequoiadb-1.10-linux_x86_64-installer.run

This shell command performs a SEQUOIADB installation. In the case of a desktop environment, it is installed by default as a graphical wizard, and if you need the Character Setup wizard, you can perform the installation with the following command:

sudo./sequoiadb-1.10-linux_x86_64-installer.run--mode text--sms false

I'm using the character wizard to install, and in turn,

    1. Language choice, Chinese and English, I choose to be 中文版;
    2. User License Agreement statement, if in doubt open source Choice 2, view the specific content of the agreement;
    3. Confirm the license, select Y;
    4. installation directory, default is /opt/sequoiadb; (excluding ";")
    5. Create DATABASE Administrator account: User name, default is sdbadmin, password, default is sdbadmin, if you need to set the database administrator user name and password, you can enter the corresponding input prompt;
    6. Cluster Management Service port, default is 11790;
    7. Boot from start, I choose Y, confirm boot from start;
    8. OM Server installation and other confirmation, I chose Y, confirm the installation;

Finally, to continue the installation confirmation, you must select Y-ha, confirm that the following characters will appear:

Please wait while the Setup installs SEQUOIADB Server on your computer. Installing 0% ______________ 50% ______________ 100% ###########################

Wait patiently for its installation, and when the installation is complete, it will automatically cut into the shell input state.

Confirm again: During installation, the installer creates a system user for the database administrator, manages and deploys the user database.

Here, the database is installed correctly:)

After the installation is complete, check the database service status and execute the service sdbcm status in the shell

In the right case, the sdbcmd process number, and SDBCM is running , should appear.

[Email protected]:~$ service sdbcm STATUS4991SDBCM is running.

If the SDBCM service does not start, you can manually perform service sdbcm start to start the SDBCM services.

If it still fails, please check the installation process for errors.

SDBCM The service status is correct, you can continue to deploy.

I will deploy a clustered environment on my own machine:

A cataloging node group, also known as the Catalog node group, has two nodes, each node is called the catalog node;

A data node group, referred to as the database node group, has three nodes, each node is called a data node;

A Coordination node group, called the Coord node group, has a node, called the coord node;

I have only one machine, so I'm deploying a pseudo-clustered environment: All data nodes are on one machine and data security is not guaranteed. If used in production systems, the best way is to separate the nodes in the cluster to achieve the purpose of data protection.

The steps are as follows:

I. Prerequisites for creating a cluster

    • Switch to the database administrator account:~$ su sdbadmin;
    • Execute the SEQUOIADB shell program, the program path is /opt/sequoiadb/bin/sdb:
      ~$/opt/sequoiadb/bin/sdb
      into the database shell environment, this environment and mongodb very much like, is a JavaScript execution environment;
    • The cluster Management service connected to the database, in the shell environment, enter:
      > OMA = new oma ("localhost", 11790)
      The first parameter is the local hostname, and the second is the port number of the cluster management service;
    • Once the connection is successful, create a temporary coordination node: enter:
      > Oma.createcoord (18800, "/opt/sequoiadb/database/coord/18800")
      The first parameter is the service port number of the temporary coord node specified, and the second parameter is the configuration file path for the specified temporary coord node;
    • After you create the temporary node successfully, start the temporary coord node:
      > Oma.startnode (18800)
    • Wait for the temporary coord node to start, and then you can connect to the Coord node to continue the deployment:
      > db = new Sdb ("localhost", 18800)

Second, create the Catalog node group

    • Successfully connects to the temporary coord node and starts creating the Catalog node Group:
      > Db.createcatarg ("localhost", 11820, "/opt/sequoiadb/database/cata/11820")

After a successful creation, the database system creates a catalog node group named "Syscataloggroup", at which point the Catalog node group does not yet have nodes and needs to continue to be created.

TIPS: The first parameter is the host name of the server (can be other access to the physical machine, to be distributed), the second parameter is the Catalog node group service port number, the third parameter is the Catalog node group configuration file directory, the system will automatically create the directory;

NOTICE: Because I have only one machine, the port number cannot be reused, so along the 11820, use 11830 and 11840. If conditions permit, with multiple physical machine deployments, you can specify port 11800 as the Catalog node service port, which is also easy to remember and manage. The following is the port number used to create the data node, for the same reason.

Question: Why don't I start with 11810 ? Slowly, there will be answers:)

    • Get the Catalog node group object and enter:
      > catarg = DB.GETRG ("Syscataloggroup")
    • Create the first catalog node and enter:
      > catanode1 = Catarg.createnode ("localhost", 11830, "/opt/sequoiadb/database/cata/11830")
    • Create a second catalog node and enter:

The first parameter of the Tips:creaenode interface is the host name of the physical machine (previously mentioned, can be distributed deployment), the second parameter is the Catalog node service port number, the third parameter is the catalog node configuration file path;

    • After the catalog node is created successfully, it starts the catalog node and enters:
      > Catanode1.start ()
      Wait for the first node to start, enter:
      > Catanode2.start ()
      Wait for a second node to start;

The successful start of the catalog node means that the cluster was created and succeeded by 1/3;

Iii. Creating data node groups and data nodes

    • Input:
      > datarg = Db.createrg ("Datagroup")

TIPS: Where the parameter "Datagroup" is the name of the data node group and can be specified by itself;

    • Next, create the first Data node:
      > Datarg.createnode ("localhost", 11850, "/opt/sequoiadb/database/data/11850")
    • Create a second data node:
      > Datarg.createnode ("localhost", 11860, "/opt/sequoiadb/database/data/11860")
    • Create a third data node:
      > Datarg.createnode ("localhost", 11870, "/opt/sequoiadb/database/data/11870")
    • After the node is created successfully, start the node inside the data group:
      > Datarg.start ()

This time will be a bit long, wait for it:)

After the data node group was started, my cluster environment deployment was 2/3 successful.

Iv. creating coord node groups and Coord nodes

    • To create a coord node group, enter:
      > COORDRG = DB.CREATECOORDRG ()
    • Then create a coord node:
      > Coordrg.createnode ("localhost", 11810, "/opt/sequoiadb/database/coord/11810")

TIPS: Of course, you can create multiple coord nodes, and I just want to create a coord node.

Answer: Finally appeared 11810 port, originally is used in the coordination node!

    • The Coord node group is then still started:
      > Coordrg.start ()

Wait for the Coord node group to start and my DB cluster environment is deployed. Next is some cleanup work.

Five, mop up

    • To delete a temporary coord node:
      > OMA = new oma ("localhost", 11790)
    • To connect to the cluster Management service, Delete the temporary node:
      > Oma.removecoord (18800)

TIPS:18800 is the service port number of the temporary node to be deleted.

Finally, comb the entire environment:

The entire cluster is on a single machine, where:

11810: coord node service port;

11820: Catalog node Group service port;

11830: Catalog node 1 service port;

11840: Catalog node 2 service port;

11850: Data node 1 service port;

11860: Data node 2 service port;

11870: Data node 3 service port.

Thank you for seeing here. The general operation of this question is from SEQUOIADB official website Information Center. Because the conditions are limited, the deployment environment is different, it brings you confusion, please forgive me!

Next article will use SEQUOIADB for simple data operation, please pay attention!

=====>the end<=====

One of the SEQUOIADB series: SEQUOIADB Installation, deployment

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.