Distributed Configuration Center
Release profile, dynamically modify, automatically updated.
[Assuming no center distributed configuration, the modified configuration files need to restart the service, for the number of huge multi-service development of micro, it will be very complicated]
What are distributed configuration center
- disconf (ZooKeeper dependent)
- zookeeper
- diamond (Ali Baba)
- Apollo
- Redis
- xxl-job
Why Apollo
Apollo addition to the full-featured, in the domestic popularity is quite extensive, which means ecological domestic Apollo are very active. While crossing the road of Chinese-style behavior is not encouraged, but people's eyes sometimes sharp.
Real
Preparing the environment:
- Ali cloud CentOS7.6
- jdk1.8
Installation jdk1.8
yum search jdk
yum install java-1.8.0-openjdk.x86_64(可选)
java -version
Installing MySQL
- Yum configuration source
wget http://dev.mysql.com/get/mysql57-community-release-el7-8.noarch.rpm
yum localinstall mysql57-community-release-el7-8.noarch.rpm
- Install mysql
yum install mysql-community-server
- Start mysql
systemctl start mysqld
systemctl restart mysqld
- View startup state:
systemctl status mysqld
- Set boot from Kai
systemctl enable mysqld
systemctl daemon-reload
- View the default password generation
grep 'temporary password' /var/log/mysqld.log
- Login Change Password
mysql -uroot -p
ALTER USER 'root'@'localhost' IDENTIFIED BY 'NoPassword564925080!';
mysql5.7 default installation password security check-ins (validate_password), check the default password policy requires password must contain: uppercase and lowercase letters, numbers and special symbols, and the length can not be less than eight. Otherwise it will prompt ERROR 1819 (HY000): Your password does not satisfy the current policy requirements error.
- Authorized users remote login
GRANT ALL PRIVILEGES ON *.* TO 'userhq'@'%' IDENTIFIED BY 'NoPassword564925080!' WITH GRANT OPTION;
flush privileges;
Open port 3306:
SQLyog using a remote connection:
Download the installation package
https://github.com/ctripcorp/apollo/wiki/Quick-Start
Recommended Download Baidu network disk accelerator: http: //pandownload.com/
According to documents created database
Documentation: https: //github.com/ctripcorp/apollo/wiki/Quick-Start
- ApolloPortalDB
- ApolloConfigDB
- Importing SQL statements
Configuration database connection information, modifying demo.sh
IP server or virtual machine IP, the other is the user name and password
Good will modify the folder uploaded to the server
Run the script demo.sh
./demo.sh start
If you can not run because there is no possibility to add executable permissions:
chmod +x demo.sh
If it fails to start, you can try the username password for the database connection to grant the user remote login password. For example userhq above.
Turn on the server port 8070:
Visit: http: //47.103.6.247: 8070
The default user name apollo
Password is admin
SUCCESS