Search in sources :

Example 1 with TlsConfig

use of tezc.base.transport.TlsConfig in project tezcRaft by tezc.

the class App method start.

public void start(List<State> states, String name) throws IOException {
    TlsConfig tlsConfig = new TlsConfig(null, null, null, null, null, null, null, null, null, null);
    Config config = new Config();
    config.setLogLevel("DEBUG");
    config.setTlsConfig(tlsConfig);
    Tezc tezc = new Tezc("./cluster1/" + name, this, config);
    RaftCluster cluster = tezc.openCluster("cluster1", states);
    if (!cluster.isStarted()) {
        NodeRecord nodeRecord1 = new NodeRecord("node0", "group0");
        nodeRecord1.addTransport(new TransportRecord("tcp", "127.0.0.1", 9090));
        /*NodeRecord nodeRecord2 = new NodeRecord("node1", "group0");
            nodeRecord2.addTransport(new TransportRecord("tcp", "127.0.0.1", 9091));

            NodeRecord nodeRecord3 = new NodeRecord("node2", "group1");
            nodeRecord3.addTransport(new TransportRecord("tcp", "127.0.0.1", 9092));*/
        cluster.setLocal(Integer.parseInt(name));
        cluster.addNode(nodeRecord1);
    // cluster.addNode(nodeRecord2);
    // cluster.addNode(nodeRecord3);
    }
    cluster.run();
}
Also used : NodeRecord(tezc.core.record.NodeRecord) TransportRecord(tezc.core.record.TransportRecord) Config(tezc.core.Config) TlsConfig(tezc.base.transport.TlsConfig) RaftCluster(tezc.core.cluster.RaftCluster) TlsConfig(tezc.base.transport.TlsConfig) Tezc(tezc.Tezc)

Aggregations

Tezc (tezc.Tezc)1 TlsConfig (tezc.base.transport.TlsConfig)1 Config (tezc.core.Config)1 RaftCluster (tezc.core.cluster.RaftCluster)1 NodeRecord (tezc.core.record.NodeRecord)1 TransportRecord (tezc.core.record.TransportRecord)1