码迷,mamicode.com
首页 > 数据库 > 详细

单机启动TiDB

时间:2018-01-15 00:14:00      阅读:271      评论:0      收藏:0      [点我收藏+]

标签:nap   recover   2.0   nbsp   cluster   member   权限   orm   efault   

部署目录:

tree -FL 3 

.
|-- pd/
|   |-- bin/
|   |   |-- pd-ctl*
|   |   |-- pd-recover*
|   |   |-- pd-server*
|   |   `-- pd-tso-bench*
|   `-- default.pd/
|       `-- member/
|-- readme
|-- tidb/
|   `-- bin/
|       |-- goyacc*
|       `-- tidb-server*
|-- tikv1/
|   |-- bin/
|   |   |-- bench-tikv*
|   |   |-- build/
|   |   |-- deps/
|   |   |-- examples/
|   |   |-- incremental/
|   |   |-- libtikv.rlib
|   |   |-- native/
|   |   |-- raft/
|   |   |-- tikv-ctl*
|   |   |-- tikv-fail*
|   |   `-- tikv-server*
|   |-- db/
|   |   |-- LOCK
|   |   |-- backup/
|   |   |-- db/
|   |   |-- raft/
|   |   `-- snap/
|   `-- raft/
|-- tikv2/
|   |-- bin/
|   |   |-- bench-tikv*
|   |   |-- build/
|   |   |-- deps/
|   |   |-- examples/
|   |   |-- incremental/
|   |   |-- libtikv.rlib
|   |   |-- native/
|   |   |-- raft/
|   |   |-- tikv-ctl*
|   |   |-- tikv-fail*
|   |   `-- tikv-server*
|   |-- db/
|   |   |-- LOCK
|   |   |-- backup/
|   |   |-- db/
|   |   |-- raft/
|   |   `-- snap/
|   `-- raft/
`-- tikv3/
    |-- bin/
    |   |-- bench-tikv*
    |   |-- build/
    |   |-- deps/
    |   |-- examples/
    |   |-- incremental/
    |   |-- libtikv.rlib
    |   |-- native/
    |   |-- raft/
    |   |-- tikv-ctl*
    |   |-- tikv-fail*
    |   `-- tikv-server*
    |-- db/
    |   |-- LOCK
    |   |-- backup/
    |   |-- db/
    |   |-- raft/
    |   `-- snap/
    `-- raft/
  • (用root权限修)改最大打开文件数: 
echo ‘fs.file-max = 82920‘ >> /etc/sysctl.conf
echo ‘* - nofile 82920‘ >> /etc/security/limits.conf
sysctl -p
重新登录终端会话
  • 启动pd

pd/bin/pd-server

  • 启动tikv

依次进入tikv[1-3]/bin执行:

tikv-server -A 127.0.0.1:9000  -s ../db --pd-endpoints 127.0.0.1:2379

tikv-server -A 127.0.0.1:9001  -s ../db --pd-endpoints 127.0.0.1:2379

tikv-server -A 127.0.0.1:9002  -s ../db --pd-endpoints 127.0.0.1:2379

  • 启动tidb

tidb/bin/bin/tidb-server -store tikv -path ‘127.0.0.1:2379/pd?cluster=1‘ -P 3306

  • 用mysql客户端连接

mysql -uroot -h127.0.0.1

Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.7.1-TiDB-v1.1.0-alpha-424-gcc808a5 MySQL Community Server (Apache License 2.0)

Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type help; or \h for help. Type \c to clear the current input statement.

mysql> show databases;
+--------------------+
| Database           |
+--------------------+
| INFORMATION_SCHEMA |
| PERFORMANCE_SCHEMA |
| mysql              |
| test               |
+--------------------+
4 rows in set (0.01 sec)

 

单机启动TiDB

标签:nap   recover   2.0   nbsp   cluster   member   权限   orm   efault   

原文地址:https://www.cnblogs.com/blogzcan/p/8284710.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!