Nacos docker单机版 +Mysql 安装
安装准备
** 确保已经安装了docker server (yum install docker) 并启动 systemctl start docker
已经有可用的mysql
创建数据库 nacos_config
建库脚本在安装包中
安装nacos docker
查询nacos镜像
docker search nacos
[root@machine136 nacos]# docker search nacos NAME DESCRIPTION STARS OFFICIAL AUTOMATED nacos/nacos-server This project contains a Docker image meant t… 350 [OK] nacos/nacos-peer-finder-plugin scale plugin for nacos k8s 1 nacos/nacos-mysql-master nacos-mysql-master 6 nacos/nacos-mysql-slave 1 nacos/nacos-mysql 6 nacos/nacos-operator 2 paderlol/nacos Nacos-quick-start-https://nacos.io/en-us/doc… 5 jude95/nacos-server-mysql8 nacos with mysql8 0 lizexiong/nacos 0 tanyi/nacos-server nacos-server官方包制作而成的镜像 1 zhusaidong/nacos-server-m1 Nacos Server for Apple MacOS M1 17 dockerlishijie/nacos-server 0 king019/nacos 2 nacosta/node-5.5.0-base 0 nacosta/redis 0 centralx/nacos-server Multi CPU architectures support for nacos/na… 0 nacosta/nodejs 0 zill057/nacos-server-apple-silicon nacos with Apple Silicon M1 Chip support. 支… 6 tonychen0716/nacos-server Multi-arch image for Alibaba Nacos 0 loads/nacos-server 0 chenfengwei/nacos nacos服务镜像,nacos版本1.3.2,同时兼任arm64… 3 eduosi/nacos-server 0 paderlol/nacos-mysql-master 0 paderlol/nacos-mysql-slave 0 lijiahao1995/nacos 0 [root@machine136 nacos]# docker pull nacos/nacos-server Using default tag: latest latest: Pulling from nacos/nacos-server 2d473b07cdd5: Pull complete
docker pull nacos/nacos-server
[root@machine136 nacos]# docker pull nacos/nacos-server Using default tag: latest latest: Pulling from nacos/nacos-server 2d473b07cdd5: Pull complete cee47fd629ae: Pull complete 84a2014f8cf0: Pull complete c6b323bb84ba: Pull complete 054ba3dd31ca: Pull complete 499f0fb6edda: Pull complete 44f7142cdeb2: Pull complete 16c455a3adda: Pull complete 37ab0ca7ea67: Pull complete 4f4fb700ef54: Pull complete Digest: sha256:be794368c96f90e42a6dd9f288d3fb12d69608cebd782eb091a489ccb48cfd28 Status: Downloaded newer image for nacos/nacos-server:latest docker.io/nacos/nacos-server:latest [root@machine136 nacos]# docker images REPOSITORY TAG IMAGE ID CREATED SIZE consul latest 041dc476cc20 6 days ago 149MB mysql 5.7.41-debian 5f99a3d9960f 7 days ago 462MB mysql latest 57da161f45ac 8 days ago 517MB nacos/nacos-server latest 440657d52bc3 8 weeks ago 1.07GB
运行docker nacos
docker run -itd -p8848:8848 -p9848:9848 \ --name nacos \ -e MODE=standalone \ -e SPRING_DATASOURCE_PLATFORM=mysql \ -e MYSQL_SERVICE_HOST=192.168.1.101 \ -e MYSQL_SERVICE_PORT=3306 \ -e MYSQL_SERVICE_DB_NAME=nacos_config \ -e MYSQL_SERVICE_USER=root \ -e MYSQL_SERVICE_PASSWORD=xxxxxxxx \ nacos/nacos-server:latest
查看运行情况
[root@machine136 nacos]# docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 75f1217a7a21 nacos/nacos-server:latest "bin/docker-startup.…" 7 minutes ago Up 7 minutes 0.0.0.0:8848->8848/tcp, :::8848->8848/tcp, 0.0.0.0:9848->9848/tcp, :::9848->9848/tcp nacos [root@machine136 nacos]#
登录管理控制台
#访问地址 默认账号密码是nacos/nacos
登录Mysql 确认数据写入成功