コード例 #1
0
function CLIENT_MOUNT_FOLDERS()
{
    $glfs = new gluster_client();
    $glfs->buildconf();
    foreach (glob("/etc/artica-cluster/glusterfs-client/*.vol") as $filename) {
        $path = $glfs->volToPath($filename);
        if ($path == null) {
            continue;
        }
        if (!$glfs->ismounted($path)) {
            if ($glfs->CheckPath($path)) {
                echo "Starting......: Gluster clients " . basename($filename) . " mount it\n";
                $glfs->mount($path, $filename);
                if ($glfs->ismounted($path)) {
                    NOTIFY_ALL_MASTERS("Success connect {$path}");
                } else {
                    NOTIFY_ALL_MASTERS("Unable to mount {$path}");
                }
            } else {
                NOTIFY_ALL_MASTERS("Unable to mount {$path}");
            }
        } else {
            echo "Starting......: Gluster clients " . basename($filename) . " already mounted\n";
        }
    }
}
コード例 #2
0
ファイル: exec.gluster.php プロジェクト: BillTheBest/1.6.x
function CLIENT_REMOUNT_FOLDERS()
{
    $unix = new unix();
    $mount = $unix->find_program("mount");
    $glfs = new gluster_client();
    $array = $glfs->get_mounted();
    if (is_array($array)) {
        while (list($index, $volfile) = each($array)) {
            system_admin_events("Remount {$volfile}", __FUNCTION__, __FILE__, __LINE__, "cluster");
            echo "Remount Gluster client......: " . $volfile . "\n";
            NOTIFY_ALL_MASTERS("Task: remount {$volfile}", __FUNCTION__, __FILE__, __LINE__);
            shell_exec("{$mount} -o remount {$volfile}");
        }
    } else {
        echo "Stopping Gluster client......: no mounted path\n";
    }
    MASTERS_GET_SOURCES();
    CLIENT_MOUNT_FOLDERS();
}