牛客community 服务器部署-基于Centos7

项目问题解决:

Spring init
https://start.spring.io/
mapper 报错的问题
https://www.cnblogs.com/helf/p/11098268.html


连接服务器

ssh -i "community.pem" [email protected]
scp -i "community.pem" community.zip [email protected]
scp -i "community.pem" community-init-sql.zip [email protected]:/home/centos
scp -i "community.pem" community.zip [email protected]:/home/centos


安装java

https://computingforgeeks.com/how-to-install-java-13-on-centos-fedora/


安装 mysql

wget https://dev.mysql.com/get/mysql80-community-release-el7-3.noarch.rpm
sudo yum localinstall mysql80-community-release-el7-3.noarch.rpm
验证安装包
yum repolist enabled | grep "mysql.-community."
剩下的看说明书:
https://dev.mysql.com/doc/mysql-repo-excerpt/8.0/en/linux-installation-yum-repo.html


安装 Maven

wget -i -c https://mirror.olnevhost.net/pub/apache/maven/maven-3/3.6.3/binaries/apache-maven-3.6.3-bin.tar.gz
tar xvf apache-maven-3.6.3-bin.tar.gz
sudo mv apache-maven-3.6.3 /opt/
sudo vim /etc/profile
export PATH=$PATH:/opt/apache-maven-3.6.3/bin
source /etc/profile


安装 redis

sudo yum install epel-release
sudo yum install redis
sudo systemctl start redis
高效解决 springBoot 集成 Redis 出现的: Unable to connect to Redis 问题


安装 kafka

wget -i -c https://ftp.wayne.edu/apache/kafka/2.5.0/kafka_2.12-2.5.0.tgz
sudo tar -zvxf kafka_2.12-2.5.0.tgz -C /opt
sudo -i
cd /opt/kafka_2.12-2.5.0/
bin/zookeeper-server-start.sh -daemon config/zookeeper.properties
nohup bin/kafka-server-start.sh config/server.properties 1>/dev/null 2>&1 &
bin/kafka-topics.sh --list --bootstrap-server 127.0.0.1:9092


安装 elasticsearch

wget -i -c https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-7.7.0-linux-x86_64.tar.gz
sudo tar -zvxf elasticsearch-7.7.0-linux-x86_64.tar.gz -C /opt
wget -i -c https://github.com/medcl/elasticsearch-analysis-ik/releases/download/v7.7.0/elasticsearch-analysis-ik-7.7.0.zip
sudo unzip -d /opt/elasticsearch-7.7.0/plugins/ik elasticsearch-analysis-ik-7.7.0.zip
然后配置两个文件
启动不允许用 root
chown -R centos *
bin/elasticsearch -d
curl -X GET "localhost:9200/_cat/health?v"


安装 wkhtmltopdf

sudo yum list wkhtmltopdf*
sudo yum install -y wkhtmltopdf.x86_64
sudo yum list xvfb
生成图片
xvfb-run -a --server-args="-screen 0, 640x480x24" wkhtmltoimage https://www.baidu.com 2.png

sudo vim wkhtmltoimage.sh
xvfb-run -a --server-args="-screen 0, 640x480x24" wkhtmltoimage "$@"
sudo chmod +x wkhtmltoimage.sh
/opt/wkhtmltoimage.sh https://www.baidu.com 2.png


安装 Tomcat

wget -i -c http://apache.mirrors.pair.com/tomcat/tomcat-9/v9.0.35/bin/apache-tomcat-9.0.35.tar.gz
sudo tar -zvxf apache-tomcat-9.0.35.tar.gz -C /opt

/opt/apache-tomcat-9.0.35/bin

启动 tomcat:
startup.sh
shutdown.sh


安装 Nginx

sudo yum list nginx*
sudo vim /etc/nginx/nginx.conf

        upstream myserver {
                server 127.0.0.1:8080 max_fails=3 fail_timeout=30s;
        }
        server {
                listen 80;
                server_name 3.231.152.242;
        location / {
                proxy_pass http://myserver;
                }
        }

sudo systemctl start nginx
https://blog.csdn.net/iot_qizu/article/details/103295965


打包

mvn clean package -Dmaven.test.skip=true

sudo mv ROOT.war /opt/apache-tomcat-9.0.35/webapps/

高效解决 springBoot 集成 Redis 出现的: Unable to connect to Redis

https://blog.csdn.net/li_haijiang/article/details/76602826

你可能感兴趣的:(牛客community 服务器部署-基于Centos7)