zoukankan      html  css  js  c++  java
  • Mysql分布式中间件,比Mycat强悍的DBLE

    安装

    dble基于mycat,mycat又基于java,所以centos7下需要安装java

    yum install java
    
    [root@wtCentos7 src]# java -version
    openjdk version "1.8.0_312"
    OpenJDK Runtime Environment (build 1.8.0_312-b07)
    OpenJDK 64-Bit Server VM (build 25.312-b07, mixed mode)

    dble运行依赖环境变量,还需要配置java环境变量

    [root@wtCentos7 src]# cd /usr/lib/jvm/jre-1.8.0-openjdk-1.8.0.312.b07-1.el7_9.x86_64/
    
    [root@wtCentos7 jre-1.8.0-openjdk-1.8.0.312.b07-1.el7_9.x86_64]# vim ~/.bashrc
    # .bashrc
    
    # User specific aliases and functions
    
    alias rm='rm -i'
    alias cp='cp -i'
    alias mv='mv -i'
    
    # Source global definitions
    if [ -f /etc/bashrc ]; then
    . /etc/bashrc
    fi
    #加以下两行
    export JAVA_HOME=/usr/lib/jvm/jre-1.8.0-openjdk-1.8.0.312.b07-1.el7_9.x86_64
    export PATH=$PATH:$JAVA_HOME/bin

    dble的运行环境已经备好,接下来去下载DBLE

    //官方文档
    https://actiontech.github.io/dble-docs-cn/0.overview/0.1_dble_overview.html
    //github
    https://github.com/actiontech/dble/releases,找打下图,右击复制下载链接

    //假如出现”无法建立SSL连接“,把https改为http
    https://github.com/actiontech/dble/releases/download/3.21.06.0%2Ftag/dble-3.21.06.0-20210812073019-linux.tar.gz
    [root@wtCentos7 src]# tar -zxvf dble-3.21.06.0-20210812073019-linux.tar.gz

    配置

    解压完之后进入dble目录下的conf目录

    [root@wtCentos7 conf]# ll
    总用量 76
    -rw-rw-r-- 1 2000 2000    0 8月  12 15:16 bootstrap.dynamic.cnf
    -rw-rw-r-- 1 2000 2000 5403 8月  12 15:16 bootstrap_template.cnf
    -rw-rw-r-- 1 2000 2000  304 8月  12 15:16 cacheservice.properties
    -rw-rw-r-- 1 2000 2000  720 8月  12 15:16 cluster_template.cnf
    -rw-rw-r-- 1 2000 2000 1203 8月  12 15:16 dbseq.sql
    -rw-rw-r-- 1 2000 2000 1553 8月  12 15:16 db_template.xml
    -rw-rw-r-- 1 2000 2000  631 8月  12 15:16 ehcache.xml
    -rw-rw-r-- 1 2000 2000 4648 8月  12 15:16 log4j2.xml
    -rw-rw-r-- 1 2000 2000   15 8月  12 15:16 partition-enum.txt
    -rw-rw-r-- 1 2000 2000   88 8月  12 15:16 partition-number-range.txt
    -rw-rw-r-- 1 2000 2000  108 8月  12 15:16 partition-pattern.txt
    -rw-rw-r-- 1 2000 2000  607 8月  12 15:16 sequence_conf.properties
    -rw-rw-r-- 1 2000 2000  267 8月  12 15:16 sequence_db_conf.properties
    -rw-rw-r-- 1 2000 2000 6810 8月  12 15:16 sharding_template.xml
    -rw-rw-r-- 1 2000 2000 6411 8月  12 15:16 template_table.sql
    -rw-rw-r-- 1 2000 2000 1809 8月  12 15:16 user_template.xml

    需要把当前目录下的配置文件复制或者重新命名,因为dble不认带_template的文件,这只是一个备份。但这里是需要改两个文件

    cp bootstrap_template.cnf bootstrap.cnf
    cp cluster_template.cnf cluster.cnf
    cp db_template.xml db.xml
     cp user_template.xml user.xml

    原配置内容图:

    新配置内容图:

    vim user.xml

    managerUser和shardingUser

    managerUser是管理的用户名密码,比如创建数据库

    shardingUser是管理数据的用户名,比如插入数据

    使用 

    //启动
    [root@wtCentos7 dble]# pwd
    /usr/local/src/dble
    [root@wtCentos7 dble]# ./bin/dble start
    Starting dble-server...

    如果启动不了,进入logs目录下,看 wrapper.log文件的报错;启动成功之后,用mysql客户端连接dble

    [root@wtCentos7 logs]# mysql  -P8088 -h127.0.0.1 -uman1 -p654321
    Warning: Using a password on the command line interface can be insecure.
    ERROR 2003 (HY000): Can't connect to MySQL server on '127.0.0.1' (111)

    NND,暂时卡住了,连接不上dble,暂时到这了,回头再研究

  • 相关阅读:
    Spring Boot四:配置文件详解properties
    程序员常去的14个顶级开发社区
    Spring Boot二:创建第一个web工程 hello world
    Java架构工程师知识图
    Java高效开发12个精品库
    华为员工:表面光鲜 工作十年买不起房
    如果你是一个程序员,又要踏足人工智能领域,应该要知道哪些语言
    H5表单提交上传图片
    转:正则表达式
    转载:jsp九大内置对象和四大作用域
  • 原文地址:https://www.cnblogs.com/wt645631686/p/15497616.html
Copyright © 2011-2022 走看看