您的位置:68399皇家赌场 > 域名注册 > 在centos 7中安装配备k八s集群的步调详解

在centos 7中安装配备k八s集群的步调详解

发布时间:2019-05-12 15:41编辑:域名注册浏览(199)

    sudo vi /var/lib/pgsql/10/data/pg_hba.conf
    
    
    local  all       all                     peer   
    local  replication   all                     peer
    host  all       all       192.168.99.1/24       trust
    host  all       all       0.0.0.0/0          md5
    

    在CentOS上配备多节点Citus集群

    一、在装有节点实施以下步骤

    Step 01 添加Citus Repostory

    # Add Citus repository for package manager
    curl | sudo bash

    Step 0二 安装Citus并且开首化DB

    # install PostgreSQL with Citus extension
    68399皇家赌场 ,sudo yum install -y citus72_10
    # initialize system database (using RHEL 6 vs 7 method as necessary)
    sudo service postgresql-10 initdb || sudo /usr/pgsql-10/bin/postgresql-10-setup initdb
    # preload citus extension
    echo "shared_preload_libraries = 'citus'" | sudo tee -a /var/lib/pgsql/10/data/postgresql.conf

    Step 03 配置postgresql.conf

    sudo vi /var/lib/pgsql/10/data/postgresql.conf

    # Uncomment listen_addresses for the changes to take effect
    listen_addresses = '*'

    Step 04 配置pg_hba.conf

    sudo vi /var/lib/pgsql/10/data/pg_hba.conf

    local  all            all                                          peer     
    local  replication    all                                          peer
    host    all            all            192.168.99.1/24              trust
    host    all            all            0.0.0.0/0                    md5

    Step 05 配置防火墙

      查看

    firewall-cmd --zone=public --query-port=5432/tcp

      增多543贰端口(--permanent长久生效,未有此参数重启后失效)

    firewall-cmd --zone=public --add-port=5432/tcp --permanent

      重新载入

    firewall-cmd --reload

    Step 0陆 运行服务

    # start the db server
    sudo service postgresql-10 restart
    # and make it start automatically when computer does
    sudo chkconfig postgresql-10 on

    Step 07 给急需的数据库安装Citus扩大

    sudo -i -u postgres psql -c "CREATE EXTENSION citus;"

    Step 0捌 设置密码

    postgres=# password postgres          #给postgres用户设置密码
    Enter new password:
    Enter it again:

    二、在coordinator节点额外试行以下步骤

    Step 01 增添worker节点音讯

      增添worker节点的IP地址(大概DNS名称)和端口号到pg_dist_node表。

    sudo -i -u postgres psql -c "SELECT * from master_add_node('192.168.99.101', 5432);"
    sudo -i -u postgres psql -c "SELECT * from master_add_node('192.168.99.102', 5432);"

    Step 0二 验证安装是或不是中标

    sudo -i -u postgres psql -c "SELECT * FROM master_get_active_worker_nodes();"

    Step 0三 起首应用

    sudo -i -u postgres psql

    参照他事他说加以考察资料:

    本文永远更新链接地址:

    一、在有着节点试行以下步骤 Step 0一 增加Citus Repostory # Add Citus repository for package manager curl ...

    上述正是那篇文章的全体内容了,希望本文的开始和结果对咱们的读书恐怕职业有所一定的参照学习价值,借使不寻常大家能够留言交换,多谢大家对剧本之家的支撑。

    表明集群运作平常。

    Step 0伍 配置防火墙

    kubectl create -f a.yaml --validate 
    kubectl create -f b.yaml --validate 
    

    1. 下载并解压

    # start the db server
    sudo service postgresql-10 restart
    # and make it start automatically when computer does
    sudo chkconfig postgresql-10 on
    

    总结

    Redis 集群会把多少存在1个 master 节点,然后在这些 master 和其相应的salve 之间张开数量同步。当读取数据时,也依据一致性哈希算法到相应的 master 节点获取数据。唯有当叁个master 挂掉之后,才会运转多少个一拍即合的 salve 节点,充当 master 。

    sudo -i -u postgres psql -c "SELECT * from master_add_node('192.168.99.101', 5432);"
    sudo -i -u postgres psql -c "SELECT * from master_add_node('192.168.99.102', 5432);"
    
    apiVersion: extensions/v1beta1 
    kind: Deployment 
    metadata: 
     name: my-app
    spec: 
     replicas: 2
     template:
     metadata:
     labels:
     app: my-app
     spec:
     containers:
     - name: my-app
     image: registry.alauda.cn/yubang/paas_base_test
     ports:
     - containerPort: 80
     command: ["/bin/bash", "/var/start.sh"] 
     resources: 
      limits: 
      cpu: 0.5 
      memory: 64Mi 
    

    八. 集群验证

    Step 04 配置pg_hba.conf

    sed -i "s/localhost:2379/10.135.163.237:2379/g" /etc/etcd/etcd.conf
    
    sed -i "s/localhost:2380/10.135.163.237:2380/g" /etc/etcd/etcd.conf
    
    sed -i "s/10.135.163.237:2379/10.135.163.237:2379,http://127.0.0.1:2379/g" /etc/etcd/etcd.conf
    
    
    sed -i "s/127.0.0.1:2379/10.135.163.237:2379/g" /etc/kubernetes/apiserver
    
    sed -i "s/--insecure-bind-address=127.0.0.1/--insecure-bind-address=0.0.0.0/g" /etc/kubernetes/apiserver
    
    sed -i "s/--admission-control=NamespaceLifecycle,NamespaceExists,LimitRanger,SecurityContextDeny,ServiceAccount,ResourceQuota/--admission_control=NamespaceLifecycle,NamespaceExists,LimitRanger,ResourceQuota/g" /etc/kubernetes/apiserver
    
    
    
    sed -i "s/--hostname-override=127.0.0.1/--hostname-override=10.135.163.237/g" /etc/kubernetes/kubelet
    
    
    sed -i "s/127.0.0.1:8080/10.135.163.237:8080/g" /etc/kubernetes/kubelet
    
    
    sed -i "s/--address=127.0.0.1/--address=0.0.0.0/g" /etc/kubernetes/kubelet
    
    
    sed -i "s/127.0.0.1:8080/10.135.163.237:8080/g" /etc/kubernetes/config
    
    sed -i "s/127.0.0.1:2379/10.135.163.237:2379/g" /etc/sysconfig/flanneld 
    
    yum -y install ruby ruby-devel rubygems rpm-build
    gem install redis
    

    Step 0陆 运营服务

    yum-config-manager --add-repo https://docs.docker.com/v1.13/engine/installation/linux/repo_files/centos/docker.repo 
    yum makecache fast 
    yum -y install docker-engine-1.13.1 
    yum install epel-release -y 
    yum remove -y docker-engine* 
    yum install -y kubernetes docker flannel 
    

    介绍安装景况与版本

    您或然感兴趣的稿子:

    • 在centos 7中装置配置k八s集群的步子详解
    • CentOS 七下安装 redis 叁.0.六并配置集群的经过详解
    • 详解centos下搭建redis集群
    • 详解CentOS 陆.伍搭建Redis三.2.八单机布满式集群
    • CentOS下RabbitMq高可用集群景况搭建教程

    除去服务

    68399皇家赌场 1

    sudo -i -u postgres psql -c "SELECT * FROM master_get_active_worker_nodes();"
    

    编辑文件a.yaml

    伍. 起动各类节点

    Step 0贰 安装Citus并且初叶化DB

    systemctl restart kube-apiserver.service 
    

    二. 编译安装

    firewall-cmd --zone=public --add-port=5432/tcp --permanent
    

    安装

    中间,前多少个 ip:port 为第2台机器的节点,剩下多少个为第一台机械。

    # Add Citus repository for package manager
    curl https://install.citusdata.com/community/rpm.sh | sudo bash
    
    sed -i "s/--hostname-override=127.0.0.1/--hostname-override=139.199.0.29/g" /etc/kubernetes/kubelet
    
    
    sed -i "s/127.0.0.1:8080/10.135.163.237:8080/g" /etc/kubernetes/kubelet
    
    
    sed -i "s/--address=127.0.0.1/--address=0.0.0.0/g" /etc/kubernetes/kubelet
    
    sed -i "s/127.0.0.1:8080/10.135.163.237:8080/g" /etc/kubernetes/config
    
    sed -i "s/127.0.0.1:2379/10.135.163.237:2379/g" /etc/sysconfig/flanneld
    
    sed -i "s/--admission-control=NamespaceLifecycle,NamespaceExists,LimitRanger,SecurityContextDeny,ServiceAccount,ResourceQuota/--admission_control=NamespaceLifecycle,NamespaceExists,LimitRanger,ResourceQuota/g" /etc/kubernetes/apiserver
    

    轻便易行说一下规律

    # install PostgreSQL with Citus extension
    sudo yum install -y citus72_10
    # initialize system database (using RHEL 6 vs 7 method as necessary)
    sudo service postgresql-10 initdb || sudo /usr/pgsql-10/bin/postgresql-10-setup initdb
    # preload citus extension
    echo "shared_preload_libraries = 'citus'" | sudo tee -a /var/lib/pgsql/10/data/postgresql.conf
    
    service docker start
    
    for SERVICES in kube-proxy kubelet docker flanneld; do 
      systemctl restart $SERVICES
      systemctl enable $SERVICES
      systemctl status $SERVICES
     done;
    

    Redis 官方提供了 redis-trib.rb 那几个工具,就在解压目录的 src 目录中,第2步中已将它复制到 /usr/local/bin 目录中,能够直接在命令行中使用了。使用上面这一个命令就能够落成安装。

    追加子节点

    随之在其余一台机器上(1玖二.16八.3一.二十),的操作重复以上三步,只是把目录改为700三、700四、700伍,对应的安顿文件也根据那个规则修改就可以

    本文由68399皇家赌场发布于域名注册,转载请注明出处:在centos 7中安装配备k八s集群的步调详解

    关键词: 68399皇家赌场