Code Monkey home page Code Monkey logo

kingshard's Introduction

kingshard dockerfile

安装kingshard镜像

docker build -t kingshard .

运行kingshard镜像

docker run -d -p 9696:9696 -p 9797:9797 kingshard

安装MySQL镜像

docker pull docker.io/mysql

运行MySQL镜像

docker run -p 3306:3306 --name mysql_3306 -e MYSQL_ROOT_PASSWORD=root -d docker.io/mysql
docker run -p 3307:3306 --name mysql_3307 -e MYSQL_ROOT_PASSWORD=root -d docker.io/mysql

建数据库

mysql -h 127.0.0.1 -P 3306 -u root -proot -e "create database kingshard;"
mysql -h 127.0.0.1 -P 3307 -u root -proot -e "create database kingshard;

创建分表

for i in `seq 0 3`;do /usr/bin/mysql -h 127.0.0.1 -P 3306 -u root -proot kingshard -e "CREATE TABLE IF NOT EXISTS test_shard_hash_000"${i}" ( id BIGINT(64) UNSIGNED  NOT NULL, str VARCHAR(256), f DOUBLE, e enum('test1', 'test2'), u tinyint unsigned, i tinyint, ni tinyint, PRIMARY KEY (id)) ENGINE=InnoDB DEFAULT CHARSET=utf8;";done
for i in `seq 4 7`;do /usr/bin/mysql -h 127.0.0.1 -P 3307 -u root -proot kingshard -e "CREATE TABLE IF NOT EXISTS test_shard_hash_000"${i}" ( id BIGINT(64) UNSIGNED  NOT NULL, str VARCHAR(256), f DOUBLE, e enum('test1', 'test2'), u tinyint unsigned, i tinyint, ni tinyint, PRIMARY KEY (id)) ENGINE=InnoDB DEFAULT CHARSET=utf8;";done

插入数据

for i in `seq 1 200`;do mysql -h 127.0.0.1 -P 9696 -u kingshard -pkingshard kingshard -e "insert into test_shard_hash (id, str, f, e, u, i) values(${i}, 'abc$i', 3.14, 'test1', 255, -127)";done

kingshard's People

Contributors

gaosy87 avatar

Stargazers

 avatar  avatar

Watchers

 avatar

kingshard's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.