Introduction
Out of the box, Senzing is configured to use an embedded SQLite database for the entity repository to accelerate getting started. This article describes the steps to configure Senzing to use MariaDB as the entity repository.
CentOS 7 was used in testing the steps outlined herein and the latest version of MariaDB available at the time; 10.3. This article assumes you are already a MariaDB user or familiar with MariaDB, it only briefly covers the installation steps of MariaDB.
For additional MariaDB information:
Install and Basic MariaDB Setup
The following is a brief overview of the steps required to install MariaDB. For full details on installing MariaDB on Linux please see the provided links above.
- Generate the MariaDB repository information
- Setting up MariaDB Repositories
- CentOS -> CentOS 7 (x86_64) -> 10.3 Stable (or latest version)
- Record the MariaDB repository information
- Create a new repository file by pasting in the information generated from the previous step and save the file
sudo vi /etc/yum.repos.d/MariaDB.repo
- Install MariaDB
sudo yum install MariaDB-server MariaDB-client
- Start MariaDB and check the status
sudo systemctl start mariadb
sudo systemctl status mariadb
- If started successfully you will see output similar to the following
- To start MariaDB at system boot
sudo systemctl enable mariadb
- It is highly recommended to harden security settings
sudo mysql_secure_installation
- Set the password for root access
- Answer Y to all questions (unless your organizations policies differ)
Test Connection and Setup a Senzing User
Check the following permissions meet your organisations policies. The user name 'senzing' is used in the following outline, change as appropriate to the user you will be using Senzing with.
mysql -u root -p
- You will be prompted for your new root password
create user 'senzing'@'%' identified by '<user_password>';
- Change <user_password> to your desired password to access MariaDB
grant all privileges on G2.* to 'senzing'@'%';
\q
- Test the new user and login ready to create the Senzing database
mysql -u senzing -p
- You will be prompted for the password you used for <user_password>
Create New Database & Add Senzing Schema
- Create the database to use as the Senzing entity repository
create database G2 character set=utf8 collate=utf8_bin;
show databases;
\q
- Add Senzing schema to the new database
mysql -u senzing -p G2 < /<project_path>/resources/schema/g2core-schema-mysql-create.sql
Where:- senzing = User id previously used in above commands, substitute your user if different
- -p = Will prompt for the password you used for <user_password>
- <project_path> = Your Senzing project path
Configure G2Module.ini
Modify the ini file to reference the new MariaDB database and schema. The file is located in <project_path>/etc/. You can comment out the current lines by prefixing them with # and adding the modified ones below.
-
- G2Module.ini - Change or add a new CONNECTION entry
CONNECTION=mysql://senzing:password4g2@127.0.0.1:3306/?schema=G2
Where:
- senzing = Senzing user
- password4g2 = Password for the Senzing user
- 127.0.0.1 = Senzing database server address
- 3306 = MySQL port number
- G2Module.ini - Change or add a new CONNECTION entry
Configure Database Parameters
Set the database parameters for the Senzing workload. Be sure to stop and start MariaDB for the changes to be effective.
Run a Test Load and Export
Perform a test load of the supplied sample data and perform an export to test the new database setup.
- Source setupEnv
cd <project_path>/python
. ../setupEnv
- Load the sample data
python3 G2Loader.py -P -p demo/sample/project.csv
- Create the export file
python3 G2Export.py
Comments
0 comments
Please sign in to leave a comment.