com.alibaba.csp.sentinel.cluster.server.ClusterTokenServer Java Examples

The following examples show how to use com.alibaba.csp.sentinel.cluster.server.ClusterTokenServer. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: ClusterServerDemo.java    From Sentinel-Dashboard-Nacos with Apache License 2.0 5 votes vote down vote up
public static void main(String[] args) throws Exception {
    // Not embedded mode by default (alone mode).
    ClusterTokenServer tokenServer = new SentinelDefaultTokenServer();

    // A sample for manually load config for cluster server.
    // It's recommended to use dynamic data source to cluster manage config and rules.
    // See the sample in DemoClusterServerInitFunc for detail.
    ClusterServerConfigManager.loadGlobalTransportConfig(new ServerTransportConfig()
        .setIdleSeconds(600)
        .setPort(11111));
    ClusterServerConfigManager.loadServerNamespaceSet(Collections.singleton(DemoConstants.APP_NAME));

    // Start the server.
    tokenServer.start();
}
 
Example #2
Source File: ClusterServer.java    From sentinel-tutorial with Apache License 2.0 5 votes vote down vote up
/**
 * 启动ClusterToken服务端
 */
public void start() throws Exception {
    // 创建一个 ClusterTokenServer 的实例,独立模式
    ClusterTokenServer tokenServer = new SentinelDefaultTokenServer();
    // 启动
    tokenServer.start();
}
 
Example #3
Source File: ClusterServerDemo.java    From Sentinel with Apache License 2.0 5 votes vote down vote up
public static void main(String[] args) throws Exception {
    // Not embedded mode by default (alone mode).
    ClusterTokenServer tokenServer = new SentinelDefaultTokenServer();

    // A sample for manually load config for cluster server.
    // It's recommended to use dynamic data source to cluster manage config and rules.
    // See the sample in DemoClusterServerInitFunc for detail.
    ClusterServerConfigManager.loadGlobalTransportConfig(new ServerTransportConfig()
        .setIdleSeconds(600)
        .setPort(11111));
    ClusterServerConfigManager.loadServerNamespaceSet(Collections.singleton(DemoConstants.APP_NAME));

    // Start the server.
    tokenServer.start();
}