安装

docker-compose:

https://github.com/pingcap/tidb-docker-compose

pd tikv tidb各单个节点,单个副本,限制内存,cpu等,防止给服务器搞宕机

先使用docker快速安装一个tidb体验一下子

version: '2.1'

services:
pd0:
image: pingcap/pd:latest
ports:
- "2379:2379"
volumes:
- ./config/pd.toml:/pd.toml:ro
- ./data:/data
- ./logs:/logs
command:
- --name=pd0
- --client-urls=http://0.0.0.0:2379
- --peer-urls=http://0.0.0.0:2380
- --advertise-client-urls=http://pd0:2379
- --advertise-peer-urls=http://pd0:2380
- --initial-cluster=pd0=http://pd0:2380
- --data-dir=/data/pd0
- --config=/pd.toml
- --log-file=/logs/pd0.log
restart: on-failure
mem_limit: 2g
cpu_quota: 50000
cpu_period: 20ms
# networks:
# - default
# extra_hosts:
# - "prometheus-dev.xx.com:192.168.100.96" tikv0:
image: pingcap/tikv:latest
ports:
- "20180:20180"
- "20160:20160"
volumes:
- ./config/tikv.toml:/tikv.toml:ro
- ./data:/data
- ./logs:/logs
command:
- --addr=0.0.0.0:20160
- --advertise-addr=tikv0:20160
- --data-dir=/data/tikv0
- --status-addr=0.0.0.0:20180
- --pd=pd0:2379
- --config=/tikv.toml
- --log-file=/logs/tikv0.log
depends_on:
- "pd0"
restart: on-failure
mem_limit: 2g
cpu_quota: 50000
cpu_period: 20ms
# networks:
# - default
# extra_hosts:
# - "prometheus-dev.xx.com:192.168.100.96"
tidb:
image: pingcap/tidb:latest
ports:
- "4000:4000"
- "10080:10080"
volumes:
- ./config/tidb.toml:/tidb.toml:ro
- ./logs:/logs
command:
- --store=tikv
- --path=pd0:2379
- --config=/tidb.toml
- --log-slow-query=/logs/tidb_slow_query.log
- --log-file=/logs/tidb.log
- --advertise-address=tidb
depends_on:
- "tikv0"
restart: on-failure
mem_limit: 2g
cpu_quota: 50000
cpu_period: 20ms
# networks:
# - default
# extra_hosts:
# - "prometheus-dev.xx.com:192.168.100.96" #networks:
# default:
# external: true
# name: gibsdev_default

 可以接入已有的prometheus监控 

修改配置,限制内存为2g

配置

不要使用默认的配置,里面会有废弃的参数

[root@xuliang config]# cat pd.toml
##
[pd-server]
metric-storage = "http://prometheus-dev.xx.com" [replication]
max-replicas = 1 [schedule]
leader-schedule-limit = 4
region-schedule-limit = 2048
replica-schedule-limit = 64
[root@xuliang config]# cat tidb.toml
mem-quota-query = 209715200
oom-use-tmp-storage = true
oom-action = "cancel" [binlog]
enable = true
ignore-error = false [log]
slow-threshold = 300 [performance]
txn-total-size-limit = 204857600
stmt-count-limit = 500000
[root@xuliang config]# cat tikv.toml [raftstore]
sync-log = false
store-pool-size = 4 [readpool]
[readpool.coprocessor]
use-unified-pool = true
[readpool.storage]
use-unified-pool = false
[storage]
reserve-space = 0
[storage.block-cache]
capacity = "2048MB"
[root@xuliang config]#

 

配置主要参数,其他默认,看需要改:

主要参数:副本数,内存,cpu限制等,磁盘。。。

tidb:

txn-total-size-limit = 204857600

tikv:

  capacity = "2048MB" 此参数一定不能大于tikv最大内存,不然会oom

用户管理:

CREATE USER 'benchmark'@'%' IDENTIFIED BY '123456';

GRANT all on gid_test.* to benchmark@'%';

flush privileges;

show grants for 'benchmark';

revoke DROP on gid_test.* from 'benchmark'@'%';

tidb初体验的更多相关文章

  1. .NET平台开源项目速览(15)文档数据库RavenDB-介绍与初体验

    不知不觉,“.NET平台开源项目速览“系列文章已经15篇了,每一篇都非常受欢迎,可能技术水平不高,但足够入门了.虽然工作很忙,但还是会抽空把自己知道的,已经平时遇到的好的开源项目分享出来.今天就给大家 ...

  2. Xamarin+Prism开发详解四:简单Mac OS 虚拟机安装方法与Visual Studio for Mac 初体验

    Mac OS 虚拟机安装方法 最近把自己的电脑升级了一下SSD固态硬盘,总算是有容量安装Mac 虚拟机了!经过心碎的安装探索,尝试了国内外的各种安装方法,最后在youtube上找到了一个好方法. 简单 ...

  3. Spring之初体验

                                     Spring之初体验 Spring是一个轻量级的Java Web开发框架,以IoC(Inverse of Control 控制反转)和 ...

  4. Xamarin.iOS开发初体验

    aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAKwAAAA+CAIAAAA5/WfHAAAJrklEQVR4nO2c/VdTRxrH+wfdU84pW0

  5. 【腾讯Bugly干货分享】基于 Webpack & Vue & Vue-Router 的 SPA 初体验

    本文来自于腾讯bugly开发者社区,非经作者同意,请勿转载,原文地址:http://dev.qq.com/topic/57d13a57132ff21c38110186 导语 最近这几年的前端圈子,由于 ...

  6. 【Knockout.js 学习体验之旅】(1)ko初体验

    前言 什么,你现在还在看knockout.js?这货都已经落后主流一千年了!赶紧去学Angular.React啊,再不赶紧的话,他们也要变out了哦.身旁的90后小伙伴,嘴里还塞着山东的狗不理大蒜包, ...

  7. 在同一个硬盘上安装多个 Linux 发行版及 Fedora 21 、Fedora 22 初体验

    在同一个硬盘上安装多个 Linux 发行版 以前对多个 Linux 发行版的折腾主要是在虚拟机上完成.我的桌面电脑性能比较强大,玩玩虚拟机没啥问题,但是笔记本电脑就不行了.要在我的笔记本电脑上折腾多个 ...

  8. 百度EChart3初体验

    由于项目需要在首页搞一个订单数量的走势图,经过多方查找,体验,感觉ECharts不错,封装的很细,我们只需要看自己需要那种类型的图表,搞定好自己的json数据就OK.至于说如何体现出来,官网的教程很详 ...

  9. Python导出Excel为Lua/Json/Xml实例教程(二):xlrd初体验

    Python导出Excel为Lua/Json/Xml实例教程(二):xlrd初体验 相关链接: Python导出Excel为Lua/Json/Xml实例教程(一):初识Python Python导出E ...

随机推荐

  1. 对Map进行复合操作(读写)且并发执行时,无法保证业务的行为是正确的,对读写操作进行同步则可以解决。

    ConcurrentHashMap通常只被看做并发效率更高的Map,用来替换其他线程安全的Map容器,比如 Hashtable和Collections.synchronizedMap.线程安全的容器, ...

  2. springboot项目打包成jar包在Linux服务器默认80端口运行

    springboot项目端口设置 在application.properties文件 server.port=80 在application.yml文件 server: port: 80 然后在ide ...

  3. 进位&&大数字符串处理

    Have Fun with Numbers Notice that the number 123456789 is a 9-digit number consisting exactly the nu ...

  4. Portainer中文汉化

    一.概述 Portainer是Docker的图形化管理工具,提供状态显示面板.应用模板快速部署.容器镜像网络数据卷的基本操作(包括上传下载镜像,创建容器等操作).事件日志显示.容器控制台操作.Swar ...

  5. Linux 安装python 模块及库

    转载于https://blog.csdn.net/csdn_am/article/details/79924744 有时我们使用下载python 自带的pip 安装一些工具包时,会报如下错误 找不到满 ...

  6. Mybatis初步认识

    分三层 第一章 1.三层架构 界面层:和用户打交道,接收用户的请求参数明显是处理结果的(jsp,html,servlet) 业务逻辑层:接收了界面层传递的数据,计算逻辑,调用数据库,获取数据 数据访问 ...

  7. 【Arduino学习笔记03】面包板基础知识

    终端带 这里有一块面包板,它后面的黏贴纸被撕去了.你可以看到很多在底部的平行金属条. 金属条的结构:金属条的顶部有一个小夹子.这些夹子能将一条导线或某个部件的引脚固定在塑料洞上,使它们放置在适当的位置 ...

  8. mysql中的基础查询 练习

    #进阶1:基础查询 /* 语法: select 查询列表 from 表名; 类似于:System.out.println(打印东西); 特点: 1.查询列表可以是:表中的字段.常量值.表达式.函数 2 ...

  9. Go语言学习笔记——Go语言的make的理解

    实例:https://tour.go-zh.org/moretypes/10 谢大<Go Web编程>书中的讲解https://github.com/astaxie/build-web-a ...

  10. 关于go中并发的初步理解

    1.一些概念的介绍: 概念 描述 进程 在内存中的程序.有自己独立的独占的虚拟 CPU .虚拟的 Memory.虚拟的 IO devices. (1) 每一进程占用独立的地址空间. 此处的地址空间包括 ...