目录:
  1. citus介绍
    1. citus配置步骤
      1. docker-compose.yml

        配置分布式数据库citus

        阅读时间:全文 319 字,预估用时 2 分钟
        创作日期:2017-06-02
        文章标签:
        上篇文章:burp_suite
        下篇文章:Django的执行流程
         
        BEGIN

        citus介绍

        citus全称citusdata,是postgresql的一个插件用来实现大数据分区,从而实现分布式数据库,通过分区键达到高效能索引,实现数据的高效率读取

        官方介绍:Citus is a distributed database that scales across commodity servers using transparent sharding and replication. Citus extends the underlying database rather than forking it, giving developers and enterprises the power and familiarity of a relational database. As an extension, Citus supports new PostgreSQL releases, and allows you to benefit from new features while maintaining compatibility with existing PostgreSQL tools.

        项目地址:https://github.com/citusdata/citus 🔗

        citus配置步骤

        1. 安装 Docker Community Edition 和 Docker Compose
        curl -sSL https://get.docker.com/ | sh
        sudo usermod -aG docker $USER && exec sg docker newgrp `id -gn`
        sudo systemctl start docker
        #已经安装好docker从这里运行
        sudo curl -sSL https://github.com/docker/compose/releases/download/1.11.2/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose
        sudo chmod +x /usr/local/bin/docker-compose
        1. 下载docker file文件并pull image
        curl -sSLO https://raw.githubusercontent.com/citusdata/docker/master/docker-compose.yml
        docker-compose -p citus up -d
        1. 执行命令: docker exec -it citus_master psql -U postgres
        2. 退出集群: docker-compose -p citus down

        docker-compose.yml

        version: '2'
        
        services:
          master:
            container_name: 'citus_master'
            image: 'citusdata/citus:6.2.1'
            ports: ['5432:5432']
            labels: ['com.citusdata.role=Master']
            volumes: ['/var/run/postgresql']
          worker:
            image: 'citusdata/citus:6.2.1'
            labels: ['com.citusdata.role=Worker']
          config:
            container_name: 'citus_config'
            image: 'citusdata/workerlist-gen:2.0.0'
            volumes: ['/var/run/docker.sock:/tmp/docker.sock']
            volumes_from: ['master']

        其中:

        1. container_name:容器名。
        2. image:镜像来源,会自动到docker hub查找并下载此镜像。
        3. ports:向外暴露的端口与本机端口的映射:前一个为本机端口,后一个为容器暴露的端口。
        4. labels:容器的标签。
        5. volumes:路径作为分区的挂载地址。
        FINISH
        上篇文章:burp_suite
        下篇文章:Django的执行流程

        随机文章
        人生倒计时
        default