Esempio n. 1
0
        public Cluster(ClusterSettings settings)
        {
            _Settings = settings;
            _State    = new ClusterState(_Settings);

            _EndPoint = new IPEndPoint(IPAddress.Parse(_Settings.EpIp), _Settings.EpPort);

            _PeriodicTasks           = new Timer(_Settings.Tick);
            _PeriodicTasks.AutoReset = false;
            _PeriodicTasks.Elapsed  += PeriodicTasks;

            _ToStart           = new Timer(_Settings.TimeToStart);
            _ToStart.AutoReset = false;
            _ToStart.Elapsed  += ToStart;

            SimulatedAdapters = 0;
            WorkingThread     = new EventQueue((sender, ex) =>
            {
                Logger.Exception <EventQueue>(ex);
            });
            WorkingThread.Start();
        }
Esempio n. 2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="settings"></param>
        public Cluster(ClusterSettings settings)
        {
            _Settings = settings;
            _State    = new ClusterState(_Settings);

            _EndPoint = new IPEndPoint(IPAddress.Parse(_Settings.EpIp), _Settings.EpPort);

            _PeriodicTasks           = new Timer(_PeriodicTasksInterval);
            _PeriodicTasks.AutoReset = false;
            _PeriodicTasks.Elapsed  += PeriodicTasks;

            _ToStart           = new Timer(_Settings.TimeToStart);
            _ToStart.AutoReset = false;
            _ToStart.Elapsed  += ToStart;

            _Ping1 = new Ping();
            _Ping1.PingCompleted += OnPingCompleted;
            _Ping2 = new Ping();
            _Ping2.PingCompleted += OnPingCompleted;

            // 20171020. Para intentar sincronizar las recuperaciones de red....
            _FromInvalidInterval = _Settings.TimeToStart;
        }
        public NodeInfo(ClusterSettings settings)
        {
            _NodoLocal = true;

            Name            = settings.NodeId;
            AdapterIp1      = settings.AdapterIp1;
            AdapterIp2      = settings.AdapterIp2;
            VirtualIp1      = settings.ClusterIp1 + "/" + settings.ClusterMask1;
            VirtualIp2      = settings.ClusterIp2 + "/" + settings.ClusterMask2;
            RemotePrivateIp = settings.EpIp;
            LocalPrivateIp  = settings.Ip;
            _MaintenanceServerIpForTraps = settings.MaintenanceServerForTraps;

            ReplicationServiceState = "0";

            Settings st = Settings.Default;
            string   cadenaConexion;

            if (st.CadenaConexion.Length > 0)
            {
                cadenaConexion        = st.CadenaConexion;
                MySqlConnectionToCd40 = new MySql.Data.MySqlClient.MySqlConnection(cadenaConexion);
            }
        }