zoukankan      html  css  js  c++  java
  • kong 网关安装

    下载RPM包
    https://docs.konghq.com/install/centos/?_ga=2.23907002.1080019063.1562941741-764980739.1562941741
    放到/home/download
    cd /home/download
    安装
    yum install kong-1.2.1.el7.noarch.rpm --nogpgcheck
    在PostgreSQL建立database kong
    su postgres
    createdb kong
    创建用户
    create user kong with password 'abc123..'
    用户权限
    Alter database kong owner to kong
    //把新建的数据库权限赋予kong
    Grant all privileges on database kong to kong;

    初始化
    kong config init
    更改配置文件的配置
    /etc/kong/kong.conf

    database = postgres # Determines which of PostgreSQL or Cassandra
    # this node will use as its datastore.
    # Accepted values are `postgres`,
    # `cassandra`, and `off`.
    pg_host = 127.0.0.1 # Host of the Postgres server.
    pg_port = 5432 # Port of the Postgres server.
    pg_timeout = 5000 # Defines the timeout (in ms), for connecting,
    # reading and writing.
    pg_user = kong # Postgres user.
    pg_password = abc123.. # Postgres user's password.
    pg_database = kong # The database name to connect to.
    #pg_schema = # The database schema to use. If unspecified,
    # Kong will respect the `search_path` value of
    # your PostgreSQL instance.
    pg_ssl = off # Toggles client-server TLS connections

    初始化数据库
    /usr/local/bin/kong migrations bootstrap
    启动空
    /usr/local/bin/kong start


    添加自启动服务
    vi /usr/lib/systemd/system/kong.service
    内容
    [Unit]
    Description=kong gateway service
    After=kong.service

    [Service]
    Type=forking
    ExecStart=/usr/local/bin/kong start
    ExecReload=/usr/local/bin/kong restart
    ExecStop=/usr/local/bin/kong stop

    [Install]
    WantedBy=multi-user.target
    保存
    执行
    chmod 754 /usr/lib/systemd/system/kong.service
    systemctl daemon-reload
    systemctl start kong.service
    systemctl enable kong.service

  • 相关阅读:
    ajax翻页效果模仿yii框架
    一个伪ajax图片上传代码的例子
    php下intval()和(int)转换有哪些区别
    php中iconv函数使用方法
    php字符串截取问题
    ASP.net UrlRewrite的防盗链功能
    ASP.NET中application对象
    javascript回车完美实现tab切换功能
    有关c#装箱和拆箱知识整理
    PHP四大安全策略
  • 原文地址:https://www.cnblogs.com/lidezhen/p/11509421.html
Copyright © 2011-2022 走看看