Setaria 采用集中式配置管理, 运维/开发人员可以通过 Setaria Console 对配置进行维护, 同时 Setaria 提供用户权限管理, 可以非常简单的将配置应用归属于不同的用户进行维护.
Setaria 使用 ZooKeeper 作为分布式协调器, 并提供一套完整的服务端管理程序与客户端 API.
CREATE DATABASE `setaria` CHARACTER SET utf8 COLLATE utf8_bin ;
USE `setaria` ;
-- create user --
CREATE USER 'setaria'@'%' IDENTIFIED BY '';
FLUSH PRIVILEGES ;
GRANT ALL PRIVILEGES ON setaria.* TO 'setaria'@'%' WITH GRANT OPTION;
# 系统超级管理员用户名, 该用户无法通过应用删除与修改邮箱 setaria.root = [email protected] # JDBC 数据源 druid.url = jdbc:mysql://localhost:3306/setaria druid.username = setaria druid.password = druid.initialSize = 2 druid.minIdle = 2 druid.maxActive = 100 druid.maxWait = 60000 druid.timeBetweenEvictionRunsMillis = 60000 druid.minEvictableIdleTimeMillis = 300000 druid.validationQuery = SELECT 'x' druid.poolPreparedStatements = true druid.maxPoolPreparedStatementPerConnectionSize = 8 # ZooKeeper 配置 # ZooKeeper 连接字符串 setaria.zookeeper.servers = 127.0.0.1:2181 # Setaria 在 ZooKeeper 保存配置信息的根路径 setaria.zookeeper.basePath = /setaria # 获取配置的 URL 路径前缀 # 实际客户端获取配置路径样例: http://localhost:8080/p/configs/pull/:appName/:appEnv setaria.pull.config.url = http://localhost:8080/p/configs/pull
Important
|
应用启动之前请先将 MySQL 数据库连接信息与 ZooKeeper连接信息按自己的环境进行配置 |
<dependency>
<groupId>com.weghst.setaria</groupId>
<artifactId>setaria-client</artifactId>
<version>1.0.0</version>
</dependency>
compile 'com.weghst.setaria:setaria-client:1.0.0'
客户端示例应用 - samples