openEuler 20.03 LTS安装单病种前置机

# 下载配置文件包
cd /opt
wget https://interface-soft.oss-cn-hangzhou.aliyuncs.com/manual-package/config.tar.gz

解压配置包,包含 mongodb.conf, nginx.conf, mongod.conf

sudo yum install tar -y
tar -xzf config.tar.gz

服务器初始化

  1. 关闭服务器防火墙
    systemctl stop firewalld
    systemctl disable firewalld
    
  2. 关闭SELINUX
    setenforce 0
    sed -i 's/SELINUX=enforcing/SELINUX=disabled/g' /etc/sysconfig/selinux
    
  3. 替换repo源
    cd /etc/yum.repos.d
    vi openEuler.repo
    vi openEuler_x86_64.repo
    
    openEuler.repo 配置示例:
    #generic-repos is licensed under the Mulan PSL v2.
    #You can use this software according to the terms and conditions of the Mulan PSL v2.
    #You may obtain a copy of Mulan PSL v2 at:
    #    http://license.coscl.org.cn/MulanPSL2
    #THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR
    #IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR
    #PURPOSE.
    #See the Mulan PSL v2 for more details.
    
    [OS]
    name=OS
    baseurl=http://repo.openeuler.org/openEuler-20.03-LTS/OS/$basearch/
    enabled=1
    gpgcheck=1
    gpgkey=http://repo.openeuler.org/openEuler-20.03-LTS/OS/$basearch/RPM-GPG-KEY-openEuler
    
    [everything]
    name=everything
    baseurl=http://repo.openeuler.org/openEuler-20.03-LTS/everything/$basearch/
    enabled=1
    gpgcheck=1
    gpgkey=http://repo.openeuler.org/openEuler-20.03-LTS/everything/$basearch/RPM-GPG-KEY-openEuler
    
    [EPOL]
    name=EPOL
    baseurl=http://repo.openeuler.org/openEuler-20.03-LTS/EPOL/$basearch/
    enabled=1
    gpgcheck=1
    gpgkey=http://repo.openeuler.org/openEuler-20.03-LTS/OS/$basearch/RPM-GPG-KEY-openEuler
    
    [debuginfo]
    name=debuginfo
    baseurl=http://repo.openeuler.org/openEuler-20.03-LTS/debuginfo/$basearch/
    enabled=1
    gpgcheck=1
    gpgkey=http://repo.openeuler.org/openEuler-20.03-LTS/debuginfo/$basearch/RPM-GPG-KEY-openEuler
    
    [source]
    name=source
    baseurl=http://repo.openeuler.org/openEuler-20.03-LTS/source/
    enabled=1
    gpgcheck=1
    gpgkey=http://repo.openeuler.org/openEuler-20.03-LTS/source/RPM-GPG-KEY-openEuler
    
    [update]
    name=update
    baseurl=http://repo.openeuler.org/openEuler-20.03-LTS/update/$basearch/
    enabled=1
    gpgcheck=1
    gpgkey=http://repo.openeuler.org/openEuler-20.03-LTS/OS/$basearch/RPM-GPG-KEY-openEuler
    

生成缓存

yum makecache

安装常用依赖包

yum install wget vim openssh-clients lrzsz gcc gcc-c++ curl curl-devel openssl openssl-devel readline-devel pcre-devel vim-enhanced net-tools -y

nginx安装说明

版本:nginx version: nginx/1.20.2

  1. 进入前置机/opt目录进行nginx安装包下载:
    cd /opt
    wget https://event-soft.oss-cn-hangzhou.aliyuncs.com/manual-package/nginx-1.20.2.tar.gz
    
  2. 安装依赖环境
    yum install -y pcre pcre-devel openssl openssl-devel gd gd-devel zlib zlib-devel gcc gcc-c++ automake
    
  3. 解压nginx源文件
    tar -zxvf nginx-1.20.2.tar.gz
    
  4. 将源码转移至/home/nginx目录
    mv nginx-1.20.2 /home/nginx
    
  5. 进入目录,编译安装nginx
    cd /home/nginx
    ./configure
    make && make install
    
  6. 替换nginx配置文件
    cp -f /opt/config/nginx.conf /usr/local/nginx/conf/
    
  7. 启动nginx
    /usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf
    
  8. 将nginx启动加入开机自启动
    echo "/usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf" >> /etc/rc.local
    

JDK安装说明

版本:Java version: 1.8.0_181

  1. 安装包下载:
    cd /opt
    wget https://interface-soft.oss-cn-hangzhou.aliyuncs.com/manual-package/jdk-8u181-linux-x64.tar.gz
    
  2. 解压jdk
    tar -zxvf jdk-8u181-linux-x64.tar.gz -C /usr/local
    

配置环境变量

cat >> /etc/profile <<EOF
export JAVA_HOME=/usr/local/jdk1.8.0_181
export CLASSPATH=.:\$JAVA_HOME/jre/lib/rt.jar:\$JAVA_HOME/lib/dt.jar:\$JAVA_HOME/lib/tools.jar
export PATH=\$PATH:\$JAVA_HOME/bin
EOF

使java环境生效

source /etc/profile

检查jdk是否生效

java -version

MongoDB安装说明

  1. 安装包下载:
    wget https://interface-soft.oss-cn-hangzhou.aliyuncs.com/manual-package/mongodb-linux-x86_64-3.0.6.tgz
    
  2. 解压源文件
    tar -zxvf mongodb-linux-x86_64-3.0.6.tgz
    
  3. 将mongodb命令增加到 /usr/local/bin 目录下
    cp -f mongodb-linux-x86_64-3.0.6/bin/* /usr/local/bin
    chmod +x /usr/local/bin/*
    
  4. 创建数据库存放路径和日志存放路径
    mkdir -p /data/db/
    mkdir -p /data/logs/
    
  5. 将下载的配置文件中的 mongod.conf 放置在 /etc/ 目录下
    cp /opt/config/mongod.conf /etc
    
  6. 启动mongodb
    mongod -f /etc/mongod.conf
    
  7. 连接mongodb,设置用户
    /usr/local/bin/mongo 127.0.0.1:27017/admin --eval 'db.createUser({user:"admin", pwd:"adminpassword", roles:[{ role:"userAdminAnyDatabase", db:"admin" },{ role:"readWriteAnyDatabase", db:"admin" }]})'
    
  8. 更改mongodb配置,开启mongodb认证功能
    sed -i 's/#//g' /etc/mongod.conf
    
  9. 重启mongodb服务
    kill -9 `cat /data/mongod.pid`
    mongod -f /etc/mongod.conf
    
  10. 将mongodb加入开机自启动
    echo "mongod -f /etc/mongod.conf" >> /etc/rc.local
    

启动客户端

  1. 下载jar包:

    wget https://interface-soft.oss-cn-hangzhou.aliyuncs.com/manual-package/client.tar.gz
    tar -xzf client.tar.gz
    
  2. 创建项目相关目录

    mkdir -p /home/ewell/jar
    mkdir -p /home/ewell/frontend
    mkdir -p /home/ewell/conf
    mkdir -p /home/ewell/plugin
    mkdir -p /home/ewell/scripts
    
  3. 复制配置文件及控制脚本
    将下载的配置文件中的 mongodb.conf 复制至 /home/ewell/conf 目录下,并将密码设置为安装mongodb时设置的密码

    cp /opt/config/mongodb.conf /home/ewell/conf
    vi /home/ewell/conf/mongodb.conf
    

    将配置文件中的 ewell-data-config.shewell-inner-interface.sh 复制至 /home/ewell/scripts 目录下

    cp /opt/config/ewell-data-config.sh /home/ewell/scripts
    cp /opt/config/ewell-inner-interface.sh /home/ewell/scripts
    
  4. 为控制脚本授权

    chmod +x /home/ewell/scripts/*
    
  5. 将下载的软件包复制相关目录
    将所有以 jar 结尾的包复制至 /home/ewell/jar

    cp /opt/client/*.jar /home/ewell/jar
    
  6. 复制前端至相关目录

    cp -rf drgs plugins /home/ewell/frontend
    
  7. 复制插件至相关目录

    cp plugin/*.jar /home/ewell/plugin
    
  8. 启动项目

    /home/ewell/scripts/ewell-data-config.sh start
    /home/ewell/scripts/ewell-inner-interface.sh start
    
posted @ 2024-05-29 18:08  红泥巴煮雪  阅读(63)  评论(0编辑  收藏  举报