Code Monkey home page Code Monkey logo

setaria's Introduction

Setaria 分布式统一配置管理

Setaria 采用集中式配置管理, 运维/开发人员可以通过 Setaria Console 对配置进行维护, 同时 Setaria 提供用户权限管理, 可以非常简单的将配置应用归属于不同的用户进行维护.

Setaria 使用 ZooKeeper 作为分布式协调器, 并提供一套完整的服务端管理程序与客户端 API.

Setaria Console 部署(服务端)

获取代码

git clone https://github.com/weghst/setaria.git

创建数据库 console/src/main/resources/db/schema-mariadb.sql

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 Console 应用参数 console/src/main/resources/setaria.properties

# 系统超级管理员用户名, 该用户无法通过应用删除与修改邮箱
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连接信息按自己的环境进行配置

启用服务

$ cd $SETARIA_HOME
$ ./gradlew :console:tomcatRun

Setaria Client (客户端)

Maven
<dependency>
  <groupId>com.weghst.setaria</groupId>
  <artifactId>setaria-client</artifactId>
  <version>1.0.0</version>
</dependency>
Gradle
compile 'com.weghst.setaria:setaria-client:1.0.0'

setaria's People

Watchers

wenyan avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.