The traditional database technology based on single machine has been unable to support the access processing of massive data. In this case, the database cluster gausdb 100, which supports the high expansion of the system and strong consistency of the sub database and sub table Sharding architecture, came into being. It is a distributed system with shared nothing architecture. It is composed of many logical nodes with independent and non shared CPU, memory, storage and other system resources.
1. Operating system settings
1.1 kernel parameters
[root@hwd10 ~]# /etc/sysctl.conf kernel.sem = 50100 128256000 50100 2560 net.core.netdev_max_backlog = 1000 net.ipv4.tcp_max_syn_backlog = 2048 kernel.core_pattern = /tmp/core.%p.%e kernel.core_uses_pid = 1 kernel.shmmni = 4096 net.ipv4.ip_local_port_range = 9000 65500 net.core.rmem_default = 262144 net.core.wmem_default = 262144 net.core.rmem_max = 4194304 net.core.wmem_max = 1048576 fs.aio-max-nr = 1048576 fs.file-max = 6815744 [root@hwd10 ~]# sysctl -p [root@hwd10 ~]# vi /etc/profile ulimit -c unlimited [root@hwd10 ~]# source /etc/profile
1.2 disable firewall and SElinux
[root@hwd10 ~]# systemctl disable firewalld Removed symlink /etc/systemd/system/multi-user.target.wants/firewalld.service. Removed symlink /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service. [root@hwd10 ~]# sed -i -e 's,enforcing,disabled,' /etc/selinux/config
When finished, restart the server.
1.3 install software package
[root@hwd10 ~]# yum install -y zlib readline gcc python python-devel perl-ExtUtils-Embed readline-devel zlib-devel lsof
1.4 creating users
[root@hwd10 ~]# groupadd dbgrp [root@hwd10 ~]# useradd -g dbgrp -d /home/omm -m -s /bin/bash omm [root@hwd10 ~]# echo redhat|passwd --stdin omm Changing password for user omm. passwd: all authentication tokens updated successfully.
1.5 create software catalog
[root@hwd10 ~]# mkdir -p /opt/software/gaussdb [root@hwd10 ~]# cd /opt/software/gaussdb/ [root@hwd10 gaussdb]# tar -xzf /tmp/GaussDB_100_1.0.0-DATABASE-REDHAT-64bit.tar.gz
2. Installing gausdb 100
[root@hwd10 gaussdb]# cd GaussDB_100_1.0.0-DATABASE-REDHAT-64bit [root@hwd10 GaussDB_100_1.0.0-DATABASE-REDHAT-64bit]# python install.py -U omm:dbgrp -R /opt/gaussdb/app -D /opt/gaussdb/data -C LSNR_ADDR=127.0.0.1,192.168.120.31 -C LSNR_PORT=1888 Checking runner. Checking parameters. End check parameters. Checking user. End check user. Checking old install. End check old install. Checking kernel parameters. Checking directory. Checking integrality of run file... Decompressing run file. Setting user env. Checking data dir and config file Initialize db instance. Creating database. Creating database succeed. Changing file permission due to security audit. Install successfully, for more detail information see /home/omm/zengineinstall.log.
-U specifies the installation user and user group.
-R specifies the installation directory.
-D specifies the data file directory, which is the GAUSSDATA directory.
-C specifies the configuration parameters. Multiple parameters can be specified. If not specified, follow the default configuration entry in / gsdata/data/cfg/zengine.ini.
After the installation, the database defaults to the startup state.
3. Start and close of database
3.1 start database
[root@hwd10 ~]# su - omm [omm@hwd10 ~]$ cd /opt/gaussdb/app/bin [omm@hwd10 bin]$ python zctl.py -t start Zengine instance has already started.
3.2 close database
[omm@hwd10 bin]$ python zctl.py -t stop Successfully stopped instance.
4. Set user white list
Gausdb 100 supports users to effectively control remote connections by configuring user whitelist, IP whitelist and IP blacklist.
- User white list: you can restrict the specified user to access the database only from the limited IP by adding valid entries of zhba.conf.
- IP whitelist: configure the TCP invited nodes parameter to restrict access to the database from the specified IP.
- IP blacklist: configure the TCP? Excluded? Nodes parameter to restrict access to the database from the specified IP.
The priority of IP blacklist is the highest. If an IP address is configured in user whitelist, IP whitelist and IP blacklist at the same time, the user cannot connect to the database remotely through the IP address.
When user whitelist, IP whitelist and IP blacklist are enabled at the same time:
- Users in the user white list can remotely connect to the database through the IP address in the user white list and the IP address in the IP white list (at the same time, the IP address is not in the black list).
- If the IP address of the client is in the user white list zhba.conf or IP white list, and is not in the IP black list, whether the user is in the user white list or not, the verification is successful and login is allowed.
Edit zhba.conf and add the following:
[omm@hwd10 bin]$ vi /opt/gaussdb/data/cfg/zhba.conf # ZENGINE Client Authentication Configuration File # =================================================== # # This file controls: which hosts are allowed to connect, # which ZENGINE user names they can use. Records take one of these forms: # # host USER ADDRESS # # (The uppercase items must be replaced by actual values.) # # The first field is the connection type: "host" is either a plain or SSL-encrypted TCP/IP socket # # USER can be "sys", a user name # # ADDRESS specifies the set of hosts the record matches. support '*' fuzzy matching # Put your actual configuration here # ---------------------------------- #TYPE #USER ADDRESS # IPv4 local connections: # IPv6 local connections: host * 127.0.0.1,::1 host * 192.168.120.0/24
There are two ways to make it effective: 1. Restart the database; 2. Load the user IP white list online and make it effective immediately. The second method is shown as follows:
5. Create tablespaces and users
Change the sys password as follows:
SQL> alter user sys identified by "abcABC@12"; Succeed.
6. Connect using data studio tools
Note: Data Studio development tools need JDK support (please install JDK yourself)
Be careful:
When centos uses the gaussdb100 installation package of redhat platform for installation, the following error will be reported:
Error: Run package GaussDB_100_1.0.0-RUN-REDHAT-64bit.tar.gz is inconsistent with os system centos.
The solution is to comment out the platform check instructions in the install.py file, namely, lines 572-573, as shown below: