两分钟快速安装 ShardingSphere-Proxy(5.2.1)

【经验总结】ShardingSphere5.2.1 + Springboot 分库分表 快速开始 Apache ShardingSphere (本文后续简称“SS”)是一款分布式的数据库生态系统, 可以将任意数据库转换为分布式数据库,并通过数据分片、弹性伸缩、加密等能力对原有数据库进行增强。Apache ShardingSphere 设计哲学为 Database Plus,旨在构建异构数据库上层的标准和生态。它关注如何充分合理地利用数据库的计算和存储能力,而并非实现一个全新的数据库。它站在数据库的上层视角,关注它们之间的协作多于数据库自身。ShardingSphere-JDBC 定位为。 阅读详情
AI摘要

本文详细介绍了如何在本地虚拟机上通过二进制包安装ShardingSphere-Proxy 5.2.1,包括下载、配置、驱动引入及服务启动,适用于Linux和Windows系统,Java JRE 8+。

借本地虚机环境安装 ShardingSphere-Proxy 5.2.1 机会,记录了安装过程,供大家参考。

ShardingSphere 支持多种安装方式,如通过二进制包、使用 Docker 或使用 Helm。本文档介绍如何通过二进制包快速构建 ShardingSphere-Proxy 测试环境,使用版本为 5.2.1。更详细的安装说明,请参考用户手册:使用二进制发布包安装 ShardingSphere-Proxy。

环境要求

  • 操作系统:Linux,Windows
  • Java JRE:8 或以上版本

安装 ShardingSphere-Proxy

通过 5 个步骤完成快速安装:

  1. 下载产品包
  2. 解压产品包
  3. 修改配置文件(server.yaml)
  4. 引入数据库驱动
  5. 启动服务

环境信息如下:

  • 配置:1c/2g
  • 操作系统:CentOS 7.6
  • Java:1.8.0

下载产品包

可通过 wget 方式直接下载到测试机,或点此下载 apache-shardingsphere-5.2.1-shardingsphere-proxy-bin.tar.gz 软件包后,手动上传至测试机。

# cd /opt
# wget https://archive.apache.org/dist/shardingsphere/5.2.1/apache-shardingsphere-5.2.1-shardingsphere-proxy-bin.tar.gz

解压产品包

# pwd 
/opt
# tar xf apache-shardingsphere-5.2.1-shardingsphere-proxy-bin.tar.gz
# cd apache-shardingsphere-5.2.1-shardingsphere-proxy-bin 
# ls
LICENSE  NOTICE  README.txt  bin  conf  lib  licenses

修改配置文件(server.yaml)

先对初始配置文件拷贝备份。

# pwd
/opt/apache-shardingsphere-5.2.1-shardingsphere-proxy-bin
# cp ./conf/server.yaml ./conf/server.yaml.bak

默认的配置文件将不能被直接使用,需要对运行模式和权限配置进行修改。

# pwd
/opt/apache-shardingsphere-5.2.1-shardingsphere-proxy-bin
# vi ./conf/server.yaml
--可将如下内容追加至 server.yaml 末尾

mode:
  type: Standalone
  repository:
    type: JDBC

rules:
  - !AUTHORITY
    users:
      - root@%:root
      - sharding@:sharding
    provider:
      type: ALL_PERMITTED

引入

springboot整合ShardingSphere5.2.1(最新版) 内容包含分表配置文件类型和自定义类型两种方法。无法直接上次代码,疯狂贴图。 阅读详情

相关推荐

ShardingSphere-Proxy CREATE ENCRYPT RULE 语法详解与透明数据加密实战

数据加密是保障数据安全的核心技术,其原理是通过特定算法和密钥将明文信息转换为不可读的密文,防止未授权访问。在数据库层面实现透明加密,能将安全能力下沉至基础设施,对应用层无感知,极大简化了开发与维护。这项技术的核心价值在于平衡安全性与业务便利性,尤其适用于金融、医疗、电商等涉及敏感信息的应用场景。ShardingSphere-Proxy 作为分布式数据库中间件,其 `CREATE ENCRYPT RULE` 语法正是实现透明数据加密的关键,它允许在代理层定义加密规则,自动对指定列进行加解密。本文深入解析了该语

weixin_30653023的博客 429

基于springboot的ShardingSphere5.2.1的分库分表的解决方案之mysql主从的配置(五)

基于springboot的ShardingSphere5.2.1的分库分表的解决方案之mysql主从的配置(五)

笨鸟不会飞 1882

百度API实现人流量数量检测(动态)

百度的这个API还挺好用的,对与不追求高精度的人来说非常适用,结合他官方给的文档,极易上手。 需要做的就是通过API Key和Secret Key获取的access_token。 然后稍微修改下代码就行,但是他给的代码并没有直接从摄像头获取视频,而是读取一个文件夹,那么就需要自己先对摄像头的输出视频进行处理。 识别结果如下,"person_num"是当前画面的人数,in是累计进入的人数,out是累计走出去的人数。 他这个有个缺点就是返回值里边并没有实时返回in和out的值,而是都是0,但是这个图片上有,图片

qq_42479987的博客 3378

电气比例阀采用外置传感器和PID控制器实现化学机械抛光(CMP)的超高精度压力控制

摘要:为大幅度提高现有CMP工艺设备中压力控制的稳定性,在现有电气比例阀这种单回路PID压力调节技术的基础上,本文提出了升级改造方案,即采用串级控制法(双回路PID控制,也称级联控制),通过在现有电气比例阀回路中增加更高精度的压力传感器和PID控制器,可以将研磨抛光压力的稳定性提高一个数量级,从1~2%的稳定性提升到0.1~0.2%。

Shanghai_Eyoung的博客 1290

MCGS 昆仑通态触摸屏 modbus TCP 数据转发

MCGS触摸屏数据转发modbus TCP数据转发

m0_63451859的博客 2万+

吃透Chisel语言.02.Chisel+VS Code+Ubuntu/WSL2开发环境搭建与使用

既然是学Chisel语言,那肯定得先把环境配置好,磨刀不误砍柴工嘛。而且有个测试环境的话,在后期的学习过程中自己去试运行代码段可以加深学习效果。这里推荐使用Ubuntu或者基于WSL2(Windows Subsystem Linux 2)的Ubuntu,本人使用的是WSL2上的Ubuntu 20.04.3 LTS,在使用体验上与Ubuntu几乎没有区别,且能同时使用Windows提供的诸多便利。...

github-3rr0r的博客 8446

Arduino IDE 2.3.2 配置 UNO R4 WIFI 开发环境避坑指南(附LED矩阵驱动测试)

本文详细介绍了如何在Arduino IDE 2.3.2中配置UNO R4 WIFI开发环境,并提供了LED矩阵驱动的实战指南。从开发环境搭建到硬件连接,再到LED矩阵的初始化和弹球动画实现,手把手教你避开常见配置陷阱,最终实现流畅的动画效果。特别适合刚接触UNO R4 WIFI的开发者快速上手。

weixin_28675839的博客 219

Arduino ESP8266通过 RF433数据收发实验

Arduino ESP8266通过 RF433射频模块实现数据收发实验 写这篇文章,折腾了2天,在没有成功之前,一直在摸索和采坑当中,不要问我黑暗和黎明之间有多长。开发很多时候只问结果,不问过程的,在这里分享来之不易的结果,希望后面的人不要采坑,有成功的案例先河,后面与之相关的应用开发只需要套用模板修改即可实现。 实物搭建 RF433模块 我使用的是这个:nodemcu 本案例开发所使用到的库:RadioHead:http://www.airspayce.com/mikem/

perseverance51博客 3804

R语言生存分析之限制性立方样条分析:样条回归、和多项式回归有什么不同?是否存在非线性关系、限制性立方样条cox回归模型

R语言生存分析之限制性立方样条分析:样条回归、和多项式回归有什么不同?是否存在非线性关系、限制性立方样条cox回归模型

statistics+insight+vista+power 633

基于YOLOv8改进的目标检测算法研究及毕设实现全流程指南

在PyTorch中定义改进后的YOLOv8模型。首先,导入相关的库和模块,然后定义骨干网络、颈部和头部的结构。# 这里定义骨干网络的结构,例如使用改进的CSP结构# 卷积层、批归一化层、激活函数等# 更多的卷积层、批归一化层、激活函数等# 其他层...# 其他层的输出...然后,定义颈部和头部的结构,类似地,将注意力机制和特征增强方法集成到模型中。本毕设以YOLOv8为基础,通过集成注意力机制、应用特征增强技术等方法,改进了目标检测算法。

m0_64661770的博客 323

最新的sdio 4.0 spec 协议标准 带书签 高清完整PDF版

Part-E1-SDIO-Specification-Ver4.00-Final-120220.pdf:最新的sdio 4.0 spec 协议标准 带书签 高清完整PDF版,包括SDIO 接口的外设,SDIO 接口官方协议等。

jdk-8u144-linux-x64.tar.gz.

该资源为搭建Linux系统Java环境用,资源的后缀为tar.gz格式的压缩包

精雕软件(JDpaint) 5.5 绿色版

精雕软件(JDpaint) 5.5 绿色版精雕软件(JDpaint) 5.5 绿色版精雕软件(JDpaint) 5.5 绿色版

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

上一篇: Sharding | 数据分片策略:分片键和分片算法的选择
下一篇: MySQL Sharding + 读写分离配置说明
代野
博客等级 码龄16年 126粉丝 60原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值