nacos云环境集群部署
生活随笔
收集整理的這篇文章主要介紹了
nacos云环境集群部署
小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
docker-compose部署
version: '2' services:nacos-1:image: nacos/nacos-server:1.1.4restart: unless-stopped#network_mode: "bridge"hostname: nacos-1environment:SPRING_DATASOURCE_PLATFORM: mysql #數(shù)據(jù)源平臺(tái) 僅支持mysql或不保存emptyPREFER_HOST_MODE: hostnameNACOS_SERVERS: nacos-1:8848 nacos-2:8848 nacos-3:8848MYSQL_MASTER_SERVICE_HOST: mysqlMYSQL_MASTER_SERVICE_PORT: 3306MYSQL_MASTER_SERVICE_USER: userMYSQL_MASTER_SERVICE_PASSWORD: passwordMYSQL_MASTER_SERVICE_DB_NAME: nacos_clusterMYSQL_SLAVE_SERVICE_HOST: mysqlMYSQL_SLAVE_SERVICE_PORT: 3306container_name: nacos-1ports:- 9991:8848networks:- default_0external_links:- mysqlnacos-2:image: nacos/nacos-server:1.1.4restart: unless-stopped#network_mode: "bridge"hostname: nacos-2 environment:SPRING_DATASOURCE_PLATFORM: mysql #數(shù)據(jù)源平臺(tái) 僅支持mysql或不保存emptyPREFER_HOST_MODE: hostnameNACOS_SERVERS: nacos-1:8848 nacos-2:8848 nacos-3:8848 MYSQL_MASTER_SERVICE_HOST: mysqlMYSQL_MASTER_SERVICE_PORT: 3306MYSQL_MASTER_SERVICE_USER: userMYSQL_MASTER_SERVICE_PASSWORD: passwordMYSQL_MASTER_SERVICE_DB_NAME: nacos_clusterMYSQL_SLAVE_SERVICE_HOST: mysqlMYSQL_SLAVE_SERVICE_PORT: 3306container_name: nacos-2ports:- 9992:8848networks:- default_0external_links:- mysqlnacos-3:image: nacos/nacos-server:1.1.4restart: unless-stopped#network_mode: "bridge"hostname: nacos-3 environment:SPRING_DATASOURCE_PLATFORM: mysql #數(shù)據(jù)源平臺(tái) 僅支持mysql或不保存emptyPREFER_HOST_MODE: hostnameNACOS_SERVERS: nacos-1:8848 nacos-2:8848 nacos-3:8848 MYSQL_MASTER_SERVICE_HOST: mysqlMYSQL_MASTER_SERVICE_PORT: 3306MYSQL_MASTER_SERVICE_USER: userMYSQL_MASTER_SERVICE_PASSWORD: passwordMYSQL_MASTER_SERVICE_DB_NAME: nacos_clusterMYSQL_SLAVE_SERVICE_HOST: mysqlMYSQL_SLAVE_SERVICE_PORT: 3306container_name: nacos-3ports:- 9993:8848networks:- default_0external_links:- mysqlnetworks:default_0:external: trueopenshift部署(K8S)
oc new-app --docker-image XXX:5000/XXX/nacos-server:1.1.4 --insecure-registry --name=nacos-1 oc new-app --docker-image XXX:5000/XXX/nacos-server:1.1.4 --insecure-registry --name=nacos-2 oc new-app --docker-image XXX:5000/XXX/nacos-server:1.1.4 --insecure-registry --name=nacos-3 - env:- name: PREFER_HOST_MODEvalue: hostname- name: NACOS_SERVERS #此處是nacos列表value: 'nacos-1:8848 nacos-2:8848 nacos-3:8848'- name: SPRING_DATASOURCE_PLATFORMvalue: mysql- name: MYSQL_MASTER_SERVICE_HOSTvalue: mysql-0- name: MYSQL_MASTER_SERVICE_PORTvalue: '3306'- name: MYSQL_MASTER_SERVICE_USERvalue: root- name: MYSQL_MASTER_SERVICE_PASSWORDvalue: XXXX- name: MYSQL_MASTER_SERVICE_DB_NAMEvalue: nacos- name: MYSQL_SLAVE_SERVICE_HOSTvalue: mysql- name: MYSQL_SLAVE_SERVICE_PORTvalue: '3306'使用
與單節(jié)點(diǎn)一樣。
超強(qiáng)干貨來襲 云風(fēng)專訪:近40年碼齡,通宵達(dá)旦的技術(shù)人生總結(jié)
以上是生活随笔為你收集整理的nacos云环境集群部署的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: webflux系列--reactor功能
- 下一篇: 自定义idea archetype