Ejemplo n.º 1
0
    def __init__(self, metaaddr, rootpath, mogami_dir):
        """This is the function of MogamiMeta's init.

        @param metaaddr ip address or hostname of metadata server
        @param rootpath path of directory to store data into
        @param mogami_dir path of mogami's root directory
        """
        # basic information of metadata server
        self.metaaddr = metaaddr
        self.rootpath = os.path.abspath(rootpath)
        self.mogami_dir = mogami_dir

        # check directory for data files
        assert os.access(self.rootpath, os.R_OK and os.W_OK and os.X_OK)

        # Initialization of Log.
        MogamiLog.init("data", conf.data_loglevel)
        MogamiLog.info("Start initialization...")
        MogamiLog.debug("rootpath = " + self.rootpath)

        # At first, connect to metadata server and send request to attend.
        self.m_channel = Channel.MogamiChanneltoMeta()
        self.m_channel.connect(self.metaaddr)
        MogamiLog.debug("Success in creating connection to metadata server")
        self.m_channel.dataadd_req(self.rootpath)

        MogamiLog.debug("Init complete!!")
Ejemplo n.º 2
0
    def __init__(self, metaaddr, rootpath, mogami_dir):
        """This is the function of MogamiMeta's init.

        @param metaaddr ip address or hostname of metadata server
        @param rootpath path of directory to store data into
        @param mogami_dir path of mogami's root directory
        """
        # basic information of metadata server
        self.metaaddr = metaaddr
        self.rootpath = os.path.abspath(rootpath)
        self.mogami_dir = mogami_dir

        # check directory for data files
        assert os.access(self.rootpath, os.R_OK and os.W_OK and os.X_OK)

        # Initialization of Log.
        MogamiLog.init("data", conf.data_loglevel)
        MogamiLog.info("Start initialization...")
        MogamiLog.debug("rootpath = " + self.rootpath)

        # At first, connect to metadata server and send request to attend.
        self.m_channel = Channel.MogamiChanneltoMeta()
        self.m_channel.connect(self.metaaddr)
        MogamiLog.debug("Success in creating connection to metadata server")
        self.m_channel.dataadd_req(self.rootpath)

        MogamiLog.debug("Init complete!!")
Ejemplo n.º 3
0
    def data_add(self, ip, rootpath):
        self.sysinfo.add_data_server(ip, rootpath)

        print "add data server IP:", ip
        print "Now %d data servers are." % len(self.sysinfo.data_list)
        MogamiLog.info("delete data server IP: %s" % ip)
        MogamiLog.info("Now there are %d data servers." %
                       len(self.sysinfo.data_list))
Ejemplo n.º 4
0
    def data_add(self, ip, rootpath):
        self.sysinfo.add_data_server(ip, rootpath)

        print "add data server IP:", ip
        print "Now %d data servers are." % len(self.sysinfo.data_list)
        MogamiLog.info("delete data server IP: %s" % ip)
        MogamiLog.info("Now there are %d data servers." %
                       len(self.sysinfo.data_list))
Ejemplo n.º 5
0
    def data_del(self, ip):
        ret = self.sysinfo.remove_data_server(ip)

        if ret == True:
            print "delete data server IP:", ip
            print "Now %d data servers are." % len(self.sysinfo.data_list)
            MogamiLog.info("delete data server IP: %s" % ip)
            MogamiLog.info("Now there are %d data servers." %
                           len(self.sysinfo.data_list))
Ejemplo n.º 6
0
    def data_del(self, ip):
        ret = self.sysinfo.remove_data_server(ip)

        if ret == True:
            print "delete data server IP:", ip
            print "Now %d data servers are." % len(self.sysinfo.data_list)
            MogamiLog.info("delete data server IP: %s" % ip)
            MogamiLog.info("Now there are %d data servers." %
                           len(self.sysinfo.data_list))
Ejemplo n.º 7
0
    def __init__(self, rootpath, mogami_dir):
        """This is the function of MogamiMeta's init.
        In this function,
        """
        MogamiLog.init("meta", conf.meta_loglevel)

        self.sysinfo = MogamiSystemInfo(rootpath, mogami_dir)
        """Check directory for data files.
        """
        if os.access(rootpath, os.R_OK and os.W_OK and os.X_OK) == False:
            sys.exit("%s is not permitted to use. " % (rootpath, ))

        MogamiLog.info("** Mogami metadata server init **")
        MogamiLog.debug("rootpath = " + rootpath)
Ejemplo n.º 8
0
    def __init__(self, rootpath, mogami_dir):
        """This is the function of MogamiMeta's init.
        In this function,
        """
        MogamiLog.init("meta", conf.meta_loglevel)

        self.sysinfo = MogamiSystemInfo(rootpath, mogami_dir)

        """Check directory for data files.
        """
        if os.access(rootpath, os.R_OK and os.W_OK and os.X_OK) == False:
            sys.exit("%s is not permitted to use. " % (rootpath, ))

        MogamiLog.info("** Mogami metadata server init **")
        MogamiLog.debug("rootpath = " + rootpath)
Ejemplo n.º 9
0
    def fsinit(self, ):
        """Called before fs.main() called.
        """
        # initializer log
        MogamiLog.info("** Mogami FS init **")
        MogamiLog.debug("Success in creating connection to metadata server")
        MogamiLog.debug("Init complete!!")
        
        # create a thread for collecting dead threads
        collector_thread = System.MogamiThreadCollector(daemons)
        collector_thread.start()

        # create a thread for telling access pattern logs
        tellap_thread = MogamitoTellAccessPattern('/tmp/mogami_ap')
        daemons.append(tellap_thread)
        tellap_thread.start()
Ejemplo n.º 10
0
    def fsinit(self, ):
        """Called before fs.main() called.
        """
        # initializer log
        MogamiLog.info("** Mogami FS init **")
        MogamiLog.debug("Success in creating connection to metadata server")
        MogamiLog.debug("Init complete!!")

        # create a thread for collecting dead threads
        collector_thread = Daemons.MogamiThreadCollector(daemons)
        collector_thread.start()

        if conf.ap == True:
            # create a thread for telling access pattern logs
            tellap_thread = MogamitoTellAccessPattern('/tmp/mogami_ap')
            daemons.append(tellap_thread)
            tellap_thread.start()
Ejemplo n.º 11
0
 def finalize(self, ):
     """Finalizer of Mogami.
     This seems not to be called implicitly...
     """
     m_channel.finalize()
     MogamiLog.info("** Mogami Unmount **")
Ejemplo n.º 12
0
 def finalize(self, ):
     """Finalizer of Mogami.
     This seems not to be called implicitly...
     """
     m_channel.finalize()
     MogamiLog.info("** Mogami Unmount **")