2023-01-16 LightDB分布式部署-单机多实例模式.md

news/2024/7/23 10:41:26 标签: 分布式

分布式部署-单机多实例模式" class="anchor" href="#lightdb%E5%88%86%E5%B8%83%E5%BC%8F%E9%83%A8%E7%BD%B2-%E5%8D%95%E6%9C%BA%E5%A4%9A%E5%AE%9E%E4%BE%8B%E6%A8%A1%E5%BC%8F"> LightDB分布式部署-单机多实例模式

  • 分布式部署模式" class="anchor" href="#%E5%88%86%E5%B8%83%E5%BC%8F%E9%83%A8%E7%BD%B2%E6%A8%A1%E5%BC%8F"> 分布式部署模式

# 1.常规模式
    1台服务器作为协调者节点,N(N>1)台服务器作为工作节点,每个节点都按照高可用方式进行部署
    比如,一个协调节点,2个工作节点,
    * 工作节点按照一主一从高可用方式部署,则一共需要[(1+2)*2=6台]服务器
    * 工作节点按照一主一从一witness方式部署,则一共需要[(1+2)*3=9台]服务器    
# 2.多机单实例
    1台服务器作为协调者节点,N(N>1)台服务器作为工作节点,每个节点都按照单机模式部署
# 3.单机多实例
    使用1台服务器同时安装协调者节点和工作节点的实例,所有实例均按照单机模式部署

生产环境仅建议使用常规模式部署。
单机多实例安装时默认创建1个协调节点(CN节点),2个work节点,可以在安装过程中调整work节点数量。
  • 命令行安装过程

[lightdb@localhost lightdb-x-13.8-22.3-7953-el7.x86_64]$ ./install.sh 
Whether to use the graphical user interface (GUI, Make sure DISPLAY is configured, Such as [export DISPLAY=127.0.0.1:0.0])?(Yes or No)
no
Choice a kind of configuration mode!
1: Only install.
2: Install database and Create instance.
3: Developer
Please enter 1 2 or 3(The default is 1):
2
Choice a kind of install mode!

1: Single Mode.
2: High Availability Mode
3: Distributed Mode
Please enter 1, 2 or 3:(The default is 1)
3
Please select distributed mode!
Please enter distributed mode:
1 Normal mode;
2 Multi-server single instance;
3 Single server multi-instance.(Default 1)
3
Specify a path for installing all LightDB software and storing configuration information.
Please enter base location(The default is /usr/local/lightdb):
/usr/local/lightdb-dis
Base Location: /usr/local/lightdb-dis
Install Location: /usr/local/lightdb-dis/lightdb-x/13.8-22.3
Configure the directory and port for the single-node multi-instance.
Please enter the instance location of coordinator node. (Default location /usr/local/lightdb-dis/data) : --- CN节点存储位置

Please enter the port of coordinator node. (Default port 5432): --- CN节点端口
5433
Please enter the instance location of worker node. (Default location /usr/local/lightdb-dis/data) : --- work1节点存储位置
/usr/local/lightdb-dis/data1
Please enter the port of worker node. (Default port 5432): --- work1节点端口
5434
Please enter the instance location of worker node. (Default location /usr/local/lightdb-dis/data) : --- work2节点存储位置
/usr/local/lightdb-dis/data2
Please enter the port of worker node. (Default port 5432): --- work2节点端口
5435
Continue to add worker node(1[yes],2[no])?
no
======================================= Instances =======================================
Coordinator Node /usr/local/lightdb-dis/data 5433
Worker Node /usr/local/lightdb-dis/data1 5434
Worker Node /usr/local/lightdb-dis/data2 5435
======================================= Instances =======================================
Please check the instances of Single server multi-instance. 1 continue; 2 clear server config (Default 1)
1
Check system parameters and dependency packages!
========================================= 192.168.121.111 =========================================
NETWORK
name: sem, recommend value: 500,2048000,200,4096, current value: 500,2048000,200,4096, status: OK
name: aio_max_nr, recommend value: 1048576, current value: 1048576, status: OK
name: somaxconn, recommend value: 2000, current value: 2000, status: OK
name: tcp_max_syn_backlog, recommend value: 2000, current value: 2000, status: OK
name: tcp_tw_reuse, recommend value: 1, current value: 1, status: OK
name: tcp_syn_retries, recommend value: 3, current value: 3, status: OK
name: tcp_retries2, recommend value: 5, current value: 5, status: OK
name: tcp_slow_start_after_idle, recommend value: 0, current value: 0, status: OK
PAGE_CACHE
name: dirty_background_ratio, recommend value: 5, current value: 5, status: OK
name: dirty_ratio, recommend value: 40, current value: 40, status: OK
name: dirty_expire_centisecs, recommend value: 500, current value: 500, status: OK
name: dirty_writeback_centisecs, recommend value: 250, current value: 250, status: OK
MEMORY
name: shmmni, recommend value: 4096, current value: 4096, status: OK
name: shmmax, recommend value: 1976979456, current value: 1976979456, status: OK
name: shmall, recommend value: 482661, current value: 482661, status: OK
name: swappiness, recommend value: 5, current value: 5, status: OK
name: overcommit_memory, recommend value: 2, current value: 2, status: OK
name: overcommit_ratio, recommend value: 75, current value: 75, status: OK
FILE_HANDLER
name: file_max, recommend value: 524288, current value: 524288, status: OK
ULIMIT
name: ulimit_core, recommend value: unlimited, current value: unlimited, status: OK
name: ulimit_nofile, recommend value: 8192, current value: 524288, status: OK
Dependency Package
name: JSON-C-0.11 is existed: yes
name: C-ARES-1 is existed: yes
name: LIBNL3 is existed: yes
name: LIBPCAP-1 is existed: yes
name: LIBZSTD-1 is existed: yes
name: LZ4-1 is existed: yes
name: NCURSES-LIBS-5 is existed: yes
name: READLINE-6 is existed: yes
name: SNAPPY-1 is existed: yes
name: UUID-1.6 is existed: yes
name: LIBICU-50 is existed: yes
Choice a kind of Compatible Type!
1: LightdDB(Compatible with PostgreSQL).
2: ORACLE(Compatible with ORACLE).
3: MYSQL(Compatible with MYSQL).
Please enter 1, 2 or 3:(The default is 1)
1
Choice a kind of LightDB workload!
1: OLTP(On-line Transaction Processing).
2: OLAP(On-Line Analytical Processing).
Please enter 1 or 2:(The default is 1)
1
Please configure memory(MB) and character set!
Please enter shared_buffers, Default value is (942): ---  25% * 总物理内存

Please enter effective_cache_size, Default value is (2639): --- 70% * 总物理内存

Please choice a kind of Character Set.
1. UTF8
2. GBK
3. SQL_ASCII
4. LATIN1
The default choice 1(UTF8)
1
Please enter LightDB password!
Please enter original password:

Please enter confirm password:

Do you want to deploy immediately?(Yes or No, The default is yes)
yes
[>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>]100%
Choose whether to install LVS to load balance coordinator node ?(Yes or No,The default is no)
no
Install Finish
  • 查看安装进程

[lightdb@localhost lightdb-x-13.8-22.3-7953-el7.x86_64]$ ps aux|grep lightdb
root       1578  0.0  0.0 191892  2348 pts/0    S    09:32   0:00 su - lightdb
lightdb    1579  0.0  0.0 115544  2080 pts/0    S    09:32   0:00 -bash
lightdb    3549 10.0  9.5 1708412 368572 ?      Ss   09:51   0:04 /usr/local/lightdb-dis/lightdb-x/13.8-22.3/bin/lightdb -D /usr/local/lightdb-dis/data
lightdb    3552  0.0  0.1 292232  4696 ?        Ss   09:51   0:00 lightdb: logger 
lightdb    3554  0.0  0.1 1708412 4756 ?        Ss   09:51   0:00 lightdb: checkpointer 
lightdb    3555  0.5  0.2 1709944 11580 ?       Ss   09:51   0:00 lightdb: background writer 
lightdb    3556  0.1  3.5 1708412 136192 ?      Ss   09:51   0:00 lightdb: walwriter 
lightdb    3557  0.0  0.1 1712480 6040 ?        Ss   09:51   0:00 lightdb: autovacuum launcher 
lightdb    3558  0.0  0.1 294772  4856 ?        Ss   09:51   0:00 lightdb: stats collector 
lightdb    3559  0.2  0.3 1713768 14312 ?       Ss   09:51   0:00 lightdb: lt_cron launcher 
lightdb    3560  0.0  0.1 1712404 5756 ?        Ss   09:51   0:00 lightdb: logical replication launcher 
lightdb    3561  0.0  0.4 1714592 15464 ?       Ss   09:51   0:00 lightdb: Canopy Maintenance Daemon: 14198/10 
lightdb    3577 12.5  9.5 1708412 368572 ?      Ss   09:51   0:04 /usr/local/lightdb-dis/lightdb-x/13.8-22.3/bin/lightdb -D /usr/local/lightdb-dis/data1
lightdb    3584  0.0  0.1 292232  4696 ?        Ss   09:51   0:00 lightdb: logger 
lightdb    3586  0.0  0.1 1708412 4756 ?        Ss   09:51   0:00 lightdb: checkpointer 
lightdb    3587  0.5  0.2 1709944 11320 ?       Ss   09:51   0:00 lightdb: background writer 
lightdb    3588  0.1  3.5 1708412 136192 ?      Ss   09:51   0:00 lightdb: walwriter 
lightdb    3589  0.0  0.1 1712480 6044 ?        Ss   09:51   0:00 lightdb: autovacuum launcher 
lightdb    3590  0.0  0.1 294772  4856 ?        Ss   09:51   0:00 lightdb: stats collector 
lightdb    3591  0.3  0.3 1713736 14176 ?       Ss   09:51   0:00 lightdb: lt_cron launcher 
lightdb    3592  0.0  0.1 1712404 5756 ?        Ss   09:51   0:00 lightdb: logical replication launcher 
lightdb    3593  0.0  0.3 1714448 15344 ?       Ss   09:51   0:00 lightdb: Canopy Maintenance Daemon: 14198/10 
lightdb    3608 12.6  9.5 1708420 368576 ?      Ss   09:51   0:04 /usr/local/lightdb-dis/lightdb-x/13.8-22.3/bin/lightdb -D /usr/local/lightdb-dis/data2
lightdb    3618  0.0  0.1 292240  4700 ?        Ss   09:51   0:00 lightdb: logger 
lightdb    3620  0.0  0.1 1708420 4760 ?        Ss   09:51   0:00 lightdb: checkpointer 
lightdb    3621  0.5  0.2 1709952 11064 ?       Ss   09:51   0:00 lightdb: background writer 
lightdb    3622  0.1  3.5 1708420 136196 ?      Ss   09:51   0:00 lightdb: walwriter 
lightdb    3623  0.0  0.1 1712488 6048 ?        Ss   09:51   0:00 lightdb: autovacuum launcher 
lightdb    3624  0.0  0.1 294780  4864 ?        Ss   09:51   0:00 lightdb: stats collector 
lightdb    3625  0.3  0.3 1713744 14076 ?       Ss   09:51   0:00 lightdb: lt_cron launcher 
lightdb    3626  0.0  0.1 1712412 5760 ?        Ss   09:51   0:00 lightdb: logical replication launcher 
lightdb    3627  0.0  0.4 1714456 15608 ?       Ss   09:51   0:00 lightdb: Canopy Maintenance Daemon: 14198/10 
lightdb    3779  0.0  0.4 1716604 15672 ?       Ss   09:51   0:00 lightdb: lightdb postgres 127.0.0.1(56670) idle
lightdb    3780  0.0  0.4 1716596 15660 ?       Ss   09:51   0:00 lightdb: lightdb postgres 127.0.0.1(35000) idle
lightdb    3782  0.0  0.4 1716596 15744 ?       Ss   09:51   0:00 lightdb: lightdb postgres 127.0.0.1(53420) idle
lightdb    3783  0.0  0.4 1716604 15668 ?       Ss   09:51   0:00 lightdb: lightdb postgres 127.0.0.1(56678) idle
lightdb    3784  0.0  0.4 1716596 15660 ?       Ss   09:51   0:00 lightdb: lightdb postgres 127.0.0.1(53424) idle
lightdb    3785  0.0  0.4 1716596 15652 ?       Ss   09:51   0:00 lightdb: lightdb postgres 127.0.0.1(35010) idle
lightdb    3871  0.0  0.0 155448  1872 pts/0    R+   09:52   0:00 ps aux
lightdb    3872  0.0  0.0 112832   984 pts/0    S+   09:52   0:00 grep --color=auto lightdb

- #### 查看安装目录

[lightdb@localhost lightdb-dis]$ cd /usr/local/lightdb-dis/ [lightdb@localhost lightdb-dis]$ ll 总用量 12 drwx------ 21 lightdb lightdb 4096 1月 16 09:51 data drwx------ 21 lightdb lightdb 4096 1月 16 09:51 data1 drwx------ 21 lightdb lightdb 4096 1月 16 09:51 data2 drwxrwxr-x 9 lightdb lightdb 140 1月 16 09:50 jdk drwxrwxr-x 3 lightdb lightdb 23 1月 16 09:49 lightdb-x drwxrwxr-x 3 lightdb lightdb 22 1月 16 09:50 lt_data drwxrwxr-x 3 lightdb lightdb 22 1月 16 09:50 lt_data1 drwxrwxr-x 3 lightdb lightdb 22 1月 16 09:51 lt_data2 drwxrwxr-x 3 lightdb lightdb 107 1月 16 09:50 uninstall [lightdb@localhost lightdb-dis]$

- #### 数据库访问
```sql
[lightdb@localhost ~]$ ltsql -h localhost -p 5433
[lightdb@localhost ~]$ ltsql -h localhost -p 5434
[lightdb@localhost ~]$ ltsql -h localhost -p 5435
  • 数据库停止

[lightdb@localhost lightdb-dis]$ lt_ctl -D ./data stop
waiting for server to shut down.... done
server stopped
[lightdb@localhost lightdb-dis]$ 
[lightdb@localhost lightdb-dis]$ lt_ctl -D ./data1 stop
waiting for server to shut down.... done
server stopped
[lightdb@localhost lightdb-dis]$ lt_ctl -D ./data2 stop
waiting for server to shut down.... done
server stopped

http://www.niftyadmin.cn/n/476740.html

相关文章

[Python笔记]pyhton提取华为云mySQL数据表

一、安装或引入pymysql (一)安装:pip install pymysql (二)引入:import pymysql 二、定义数据库访问函数 (一)定义连接接口函数 #定义数据库连接函数 def dbConnect(hostname,username,password,database):db = pymysql.connect(host=hostname,user=username,pass…

ThinkPHP-Shop2020版本的商城CMS前端SQL注入

0x01、漏洞名描述 ThinkPHP-Shop2020版本的商城CMS前端SQL注入 0x02、fofa "ThinkPHP-Shop"0x03、POC http://x.x.x.x//mobile/index/index2/id/1* 0x04、漏洞复现

Visual C++中的虚函数和纯虚函数(对比学习法之一)

我是荔园微风,作为一名在IT界整整25年的老兵,今天来说说Visual C中的虚函数和纯虚函数。该系列帖子全部使用我本人自创的对比学习法。也就是当C学不下去的时候,就用JAVA实现同样的代码,然后再用对比的方法把C学会。 直接说虚函数…

Django框架实现简单的接口开发

前提创建一个Django项目&#xff0c;目录如下&#xff1a; Django框架上进行GET请求接口开发示例: 1.在上面项目结构目录Template下&#xff0c;新建一个login.html页面&#xff0c;定义表单提交请求的方式为post&#xff0c;具体代码如下。 <!DOCTYPE HTML> <html …

Android 冷启动优化的3个小案例

背景 为了提高App的冷启动耗时&#xff0c;除了在常规的业务侧进行耗时代码优化之外&#xff0c;为了进一步缩短启动耗时&#xff0c;需要在纯技术测做一些优化探索&#xff0c;本期我们从类预加载、Retrofit 、ARouter方面进行了进一步的优化。从测试数据上来看&#xff0c;这…

[游戏开发][Unity]出包真机运行花屏(已解决)

花屏真机截屏 原因 原因是启动项目时的第一个场景没有相机是 Skybox或者SolidColor模式&#xff0c;我的启动场景只有一个UI相机&#xff0c;且Clear Flags是DepthOnly 解释&#xff1a; https://blog.csdn.net/yanchezuo/article/details/79002318

代码随想录day31

455.分发饼干 思路&#xff1a;用大的饼干尽量去喂胃口大的小孩。当然也可以用小的饼干尽量去喂胃口小的饼干。 注意从后向前遍历。 class Solution { public:int findContentChildren(vector<int>& g, vector<int>& s) {sort(g.begin(),g.end());sort(s.…

解读中国与西方Web3的区别:揭示误解与真相

摘要&#xff1a;中国和西方在对待Web3的态度和实践中存在着明显的差异。本文将深入探讨中国与西方Web3之间的区别&#xff0c;解读其中的误解&#xff0c;并揭示真相&#xff0c;旨在帮助读者更好地理解和评估这两种不同的Web3模式。 Web3作为下一代互联网的发展方向&#xff…