文章目录
- Download Nacos Package and Unzip
- Configure Nacos
- Configure JAVA_HOME for Bash File
- Configure Default User and Password
- Startup Nacos
- Visit Admin Webpage
Download Nacos Package and Unzip
https://github.com/alibaba/nacos/releases/download/3.0.0-alpha/nacos-server-3.0.0-ALPHA.tar.gz
Configure Nacos
sudo nano conf/application.properties
server.port=8848
nacos.core.auth.enabled=true
nacos.core.auth.server.identity.key=authKey
nacos.core.auth.server.identity.value=nacos
nacos.core.auth.plugin.nacos.token.secret.key=SecretKey012345678901234567890123456789012345678901234567890123456789
Configure JAVA_HOME for Bash File
sudo nano bin/startup.sh
[ ! -e "$JAVA_HOME/bin/java" ] && JAVA_HOME=/Users/easing/Dev/JDK/JDK17
Configure Default User and Password
api("org.springframework.boot:spring-boot-starter-security:3.4.1")
fun main() {
val password = BCryptPasswordEncoder().encode("123456")
println(password)
}
sudo nano conf/derby-schema.sql
sudo nano conf/mysql-schema.sql
INSERT INTO users (username, password, enabled) VALUES ('root', '$2a$10$O/wKbpL73pOVqbGOu8hokuDl8OU8FlGxcRLufK/AtIcXffFwtqYQW', TRUE);
INSERT INTO roles (username, role) VALUES ('root', 'ROLE_ADMIN');
Startup Nacos
sudo bash -f bin/startup.sh -m standalone
sudo bash -f bin/shutdown.sh
Visit Admin Webpage
http://localhost:8848/nacos
username1 = nacos
passowrd1 = nacos
username2 = root
passowrd2 = 123456