uat sec centos7

cp -r  /etc/yum.repos.d/ /etc/yum.repos.d.bak

curl www.alexman.cn/CentOS-Base.repo -o /etc/yum.repos.d/CentOS-Base.repo

curl www.alexman.cn/epel-7.repo -o /etc/yum.repos.d/epel-7.repo

yum clean all

yum makecache

 

yum install wget

cp /usr/share/zoneinfo/Asia/Shanghai  /etc/localtime

echo 'LANG="en_US.UTF-8"' >> /etc/profile

 

cat >> /etc/security/limits.conf <<EOF
root soft nofile 65535
root hard nofile 65536
* soft nofile 65535
* hard nofile 65536
EOF

 

systemctl stop firewalld

systemctl disable firewalld

 

yum remove docker docker-client docker-client-latest docker-common docker-latest docker-latest-logrotate docker-logrotate docker-engine

yum install -y yum-utils device-mapper-persistent-data lvm2

 

vim /etc/yum.repos.d/docker-ce.repo 

 

[docker-ce-stable]
name=Docker CE Stable - $basearch
baseurl=https://mirrors.tuna.tsinghua.edu.cn/docker-ce/linux/centos/$releasever/$basearch/stable
enabled=1
gpgcheck=1
gpgkey=https://mirrors.tuna.tsinghua.edu.cn/docker-ce/linux/centos/gpg

[docker-ce-stable-source]
name=Docker CE Stable - Sources
baseurl=https://mirrors.tuna.tsinghua.edu.cn/docker-ce/linux/centos/$releasever/source/stable
enabled=0
gpgcheck=1
gpgkey=https://mirrors.tuna.tsinghua.edu.cn/docker-ce/linux/centos/gpg

[docker-ce-test]
name=Docker CE Test - $basearch
baseurl=https://mirrors.tuna.tsinghua.edu.cn/docker-ce/linux/centos/$releasever/$basearch/test
enabled=0
gpgcheck=1
gpgkey=https://mirrors.tuna.tsinghua.edu.cn/docker-ce/linux/centos/gpg

[docker-ce-test-source]
name=Docker CE Test - Sources
baseurl=https://mirrors.tuna.tsinghua.edu.cn/docker-ce/linux/centos/$releasever/source/test
enabled=0
gpgcheck=1
gpgkey=https://mirrors.tuna.tsinghua.edu.cn/docker-ce/linux/centos/gpg

 

yum makecache fast

yum install -y docker-ce-26.1.4 docker-ce-cli-26.1.4 containerd.io docker-buildx-plugin docker-compose-plugin

 

yum install java-11-openjdk

 

wget https://github.com/docker/compose/releases/download/v2.40.3/docker-compose-linux-x86_64

cp docker-compose-linux-x86_64 /bin/

chmod +x /bin/docker-compose-linux-x86_64 

 

vim redis.conf

appendonly yes
requirepass tuozhe1234

 

systemctl start docker

systemctl enable docker

docker run -p 6379:6379 --memory=1g --name sectuozhe -v /root/sectuozhe/data:/data -v /root/redis.conf:/etc/redis/redis.conf -d docker.1ms.run/redis:6.2 redis-server /etc/redis/redis.conf

 

mkdir rabbitmq

cd rabbitmq

 wget https://github.com/rabbitmq/rabbitmq-delayed-message-exchange/releases/download/v3.13.0/rabbitmq_delayed_message_exchange-3.13.0.ez

vim docker-compose.yml

version: '3.8'

services:
  rabbitmq:
    image: docker.1ms.run/rabbitmq:3.13-management-alpine
    container_name: rabbitmq-server
    hostname: rabbitmq
    restart: unless-stopped
    ports:
      - "5672:5672"
      - "15672:15672"
      - "61613:61613"
      - "15674:15674"
    environment:
      - RABBITMQ_DEFAULT_USER=admin
      - RABBITMQ_DEFAULT_PASS=Admin123!
      - RABBITMQ_DEFAULT_VHOST=/
    volumes:
      - ./rabbitmq_data:/var/lib/rabbitmq
    # 启动时启用插件
    command: >
      bash -c "
        rabbitmq-plugins enable rabbitmq_delayed_message_exchange &&
        rabbitmq-plugins enable rabbitmq_stomp &&
        rabbitmq-plugins enable rabbitmq_web_stomp &&
        exec rabbitmq-server
      "

docker-compose-linux-x86_64 up -d

docker cp rabbitmq_delayed_message_exchange-3.13.0.ez rabbitmq-server:/opt/rabbitmq/plugins/

docker exec rabbitmq-server rabbitmq-plugins list --enabled

 

tee /etc/yum.repos.d/mysql-community.repo << 'EOF'
[mysql80-community]
name=MySQL 8.0 Community Server
baseurl=https://mirrors.tuna.tsinghua.edu.cn/mysql/yum/mysql80-community-el7/
enabled=1
gpgcheck=0
EOF

yum clean all

yum makecache fast 

yum install -y mysql-community-server

 

systemctl start mysqld

systemctl enable mysqld

 

 grep 'temporary password' /var/log/mysqld.log

mysql -uroot -p

ALTER USER 'root'@'localhost' IDENTIFIED BY 'juek1234QWER!@#$';

use mysql

update user set host='%' where user='root';

FLUSH PRIVILEGES;

 

CREATE DATABASE `secuat` /*!40100 DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_bin */ /*!80016 DEFAULT ENCRYPTION='N' */

CREATE USER `secuat`@`%` IDENTIFIED BY 'secUAT12!@' PASSWORD EXPIRE NEVER;

grant all on secuat.* to 'secuat'@'%';

 

posted @ 2025-12-31 11:30  alexhe  阅读(1)  评论(0)    收藏  举报