• 阿里云IaaS部署流程


    安装docker:
    curl -sSL https://get.daocloud.io/docker | sh
    systemctl enable docker.service

    安装glances:
    apt-get install glances

    安装postgresql:
    sudo apt-get install postgresql
    sudo -u postgres psql

    以下内容内容都是在 postgres=# 下输入
    ALTER USER postgres WITH PASSWORD '123456'; # 密码设置为123455,有分号才会执行命令

    \q #退出客户端

    sudo -u postgres passwd

    postgresql目录迁移:
    sudo -u postgres psql
    SHOW data_directory;
    sudo systemctl stop postgresql
    sudo systemctl status postgresql

    sudo rsync -av 原始路径 目标路径 (sudo rsync -av /var/lib/postgresql /mnt/volume-nyc1-01)
    备份
    sudo mv /var/lib/postgresql/9.5/main /var/lib/postgresql/9.5/main.bak

    sudo nano /etc/postgresql/9.5/main/postgresql.conf

    . . .
    data_directory = '/mnt/volume-nyc1-01/postgresql/9.5/main'
    . . .

    sudo systemctl start postgresql
    sudo systemctl status postgresql

    postgresql远程访问:
    vim /etc/postgresql/版本号/main/postgresql.conf
    listen_addresses = '*'

    vim /etc/postgresql/版本号/main/pg_hba.conf
    host all all 0.0.0.0/0 md5

    重启服务
    sudo service postgresql restart

    安装redis:
    sudo apt-get install redis-server

    设置远程访问
    sudo vi /etc/redis/redis.conf
    注释掉绑定地址#bind 127.0.0.1
    daemonize yes
    protected-mode no #将yes改为no

    RabbitMQ安装:
    sudo apt-get install erlang-nox
    sudo apt-get update
    sudo apt-get install rabbitmq-server

    启动、停止、重启、状态rabbitMq命令
    sudo rabbitmq-server start
    sudo rabbitmq-server stop
    sudo rabbitmq-server restart
    sudo rabbitmqctl status

    RabbitMQ web管理接口
    启用rabbitmq-management插件:
    sudo rabbitmq-plugins enable rabbitmq_management

    elasticsearch安装:
    sudo apt update
    sudo apt install apt-transport-https ca-certificates wget
    wget -qO - https://artifacts.elastic.co/GPG-KEY-elasticsearch | sudo apt-key add -
    sudo sh -c 'echo "deb https://artifacts.elastic.co/packages/7.x/apt stable main" > /etc/apt/sources.list.d/elastic-7.x.list'
    sudo apt update
    sudo apt install elasticsearch
    sudo systemctl enable --now elasticsearch.service
    cd /usr/share/elasticsearch/
    ./bin/elasticsearch-plugin install https://github.com/medcl/elasticsearch-analysis-ik/releases/download/v7.16.2/elasticsearch-analysis-ik-7.16.2.zip

    elasticsearch配置远程访问
    修改配置文件/config/elasticsearch.yml
    在network的地方设置以下三个配置
    network.bind_host: 0.0.0.0
    network.publish_host: elasticsearch所在的主机的ip
    http.port: 9200

    在discovery的地方,取消下面这个配置的注释
    cluster.initial_master_nodes: ["node-1","node-2"]
    重启
    service elasticsearch restart

    sonarqube 安装:
    docker pull sonarqube
    sudo -u postgres psql
    CREATE DATABASE sonarqube WITH ENCODING = 'UTF8';
    CREATE USER sonarqube WITH PASSWORD 'sonarqube';
    GRANT ALL PRIVILEGES ON DATABASE sonarqube TO sonarqube;
    GRANT ALL PRIVILEGES ON all tables in schema public TO sonarqube;

    docker run --name sonarqube -d sonarqube:latest
    docker cp dc8d9832aee7:/opt/sonarqube/extensions /docker/sonarqube/
    docker cp dc8d9832aee7:/opt/sonarqube/conf /docker/sonarqube/
    docker stop dc8d9832aee7
    docker rm dc8d9832aee7

    docker run --name sonarqube -p 9002:9000 -p 9092:9092 -e SONAR_JDBC_URL="jdbc:postgresql://172.16.4.250:5432/sonarqube?useUnicode=true&characterEncoding=utf-8" -e SONAR_JDBC_USERNAME="sonarqube" -e SONAR_JDBC_PASSWORD="sonarqube" -e SONAR_ES_BOOTSTRAP_CHECKS_DISABLE=true -v /docker/sonarqube/conf:/opt/sonarqube/conf -v /docker/sonarqube/data:/opt/sonarqube/data -v /docker/sonarqube/logs:/opt/sonarqube/logs -v /docker/sonarqube/extensions:/opt/sonarqube/extensions -d sonarqube:latest

    docker update --restart=always sonarqube

    ftp设置:
    sudo apt-get update
    sudo apt-get install vsftpd

    mkdir /home/ftp
    mkdir /home/ftp/data
    sudo chown nobody:nogroup /home/ftp
    chmod -R 777 /home/ftp/data

    useradd ftpuser -g ftp -d /home/ftp -s /sbin/nologin
    passwd ftpuser

    vim /etc/vsftpd.conf
    移除 chroot_local_user=YES 前面的注释
    新增如下内容:
    user_sub_token=ftpuser
    local_root=/home/ftp, 可自行定制,并修改 FTP 根目录
    userlist_enable=YES
    userlist_file=/etc/vsftpd.userlist
    userlist_deny=NO
    vim /etc/vsftpd.userlist
    新增如下内容
    ftpuser

  • 相关阅读:
    c# 利用反射设置属性值
    C#中扩展方法
    Python与Ruby比较
    Python 学习笔记(半ZZ半自己写)
    c# 写的一个类帮助器(动态生成类 动态类 动态属性)
    c#学习python
    LBS中从数据库查询某经纬度2KM范围内的数据 针对大数据量的性能优化
    隐藏ToString等系统自带方法
    C#命名规范
    SQL Server 数值四舍五入,小数点后保留2位
  • 原文地址:https://www.cnblogs.com/renfeng/p/15770336.html
Copyright © 2020-2023  润新知