nacos
部署 与 redis
编译安装一. 单机版 参考 https://www.jianshu.com/p/9f695cf38cf3 https://www.cnblogs.com/code-duck/p/13210280.html
环境 centos7LTS ubuntu18.04LTS
安装包 nacos1.1.0
安装包:
https://github.com/alibaba/nacos/releases https://github.com/alibaba/nacos/releases/download/1.1.0/nacos-server-1.1.0.tar.gz
步骤概览
①. 获取压缩包并解压到指定目录 1 2 3 4 5 yum install -y wget vim wget https://github.com/alibaba/nacos/releases/download/1.1.0/nacos-server-1.1.0.tar.gz tar -xvf ./nacos-server-1.1.0.tar.gz -C /opt
配置数据库 1 2 3 4 5 6 7 8 9 ALTER USER root@localhost IDENTIFIED BY '123456' ; create database nacos_config; show databases; use nacos_config; source /opt/nacos/conf/nacos-mysql.sql;show tables;
②. 修改配置文件并启动nacos
( 按照实际填写数据库信息 ) 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 cp /opt/nacos/conf/application.properties /opt/nacos/conf/application.properties.bf vim /opt/nacos/conf/application.properties spring.datasource.platform=mysql db.num=1 db.url.0=jdbc:mysql://127.0.0.1:3306/nacos_config?characterEncoding=utf8&connectTimeout=1000&socketTimeout=3000&autoReconnect=true &useUnicode=true &useSSL=false &serverTimezone=UTC db.user=root db.password=123456
启动nacos
1 2 cd /opt/nacos/bin && sh startup.sh -m standalone
效果 部署完成: 浏览器访问地址:http://ip:port:8848/nacos
输入默认账号密码:nacos/nacos
即可看到
二. 集群版nacos
较为简单此处略 参考:https://blog.csdn.net/sunxiaoju/article/details/115313049
三. redis
编译安装 2. centos7
与ubuntu
通用编译安装脚本参考:https://www.cnblogs.com/joyny/p/11555966.html
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 #!/bin/bash centos_app="wget gcc gcc-c++ make automake" ubuntu_app="build-essential ca-certificates sshpass telnet vim wget curl unzip git gcc make lrzsz nmon smartmontools ntpdate tmux bc" centos_download_redis () { yum install ${centos_app} -y cd /opt && wget http://download.redis.io/releases/redis-5.0.5.tar.gz tar -zxvf redis-5.0.5.tar.gz cd /opt/redis-5.0.5/ && make && make install } ubuntu_download_redis () { apt install ${ubuntu_app} -yq cd /opt && wget http://download.redis.io/releases/redis-5.0.5.tar.gz tar -zxvf redis-5.0.5.tar.gz cd /opt/redis-5.0.5/ && make && make install } system_redis () {cat > /etc/systemd/system/redis.service << eric [Unit] Description=redis [Service] #Type=forking Type=simple #PIDFile=/usr/local/nginx/logs/nginx.pid ExecStart=/opt/redis-5.0.5/src/redis-server /opt/redis-5.0.5/redis.conf ExecReload=/bin/kill -SIGHUP \$MAINPID ExecStop=/bin/kill -SIGINT \$MAINPID #Restart=always #RestartSec=5 #StartLimitInterval=0 [Install] WantedBy=multi-user.target eric systemctl daemon-reload systemctl start redis.service systemctl enable redis.service systemctl restart redis.service systemctl status redis.service } start_redis () { echo -e "\033[36m 运行redis \033[0m" /opt/redis-5.0.5/src/redis-server /opt/redis-5.0.5/redis.conf & ss -ntulp |grep redis } main () { centos_download_redis system_redis } main
四. 效果 Redis
效果
fighting!