Exemplo n.º 1
0
        $query_list = select_slowquery($pdo_log, $date, $service_info['service_name']);
    }
}
//queue list & solr config - tab1
if ($tab == '1') {
    $service_mapping = pdo_get_mapping($pdo, $service_id);
    if ($service_mapping) {
        foreach ($service_mapping as $v) {
            $qlp['instance_id'][] = $v['instance_id'];
        }
    }
    $qlp['service_id'] = array($service_id);
    $queue_list = get_queue_list_complex2($pdo, 0, 15, $qlp);
    $solr_config = pdo_get_solr_config($pdo, $service_id);
    $solr_config = json_decode($solr_config['config_json'], true);
    $dataimport = pdo_get_dataimport($pdo, $service_id);
}
//instance list & host list - tab2
if (in_array($tab, array('2', '4'))) {
    $instance_list = get_instance_list_complex($pdo, array('service_id' => $service_id, 'with_unbind' => '1'));
    $host_list = change_array_key(get_host_list($pdo), 'host_id');
}
//solr_schema - tab1/2
if (in_array($tab, array('1', '3'))) {
    $solr_schema = pdo_get_solr_schema($pdo, $service_id);
    if ($service_info['schema_type'] == 1) {
        $solr_schema = json_decode($solr_schema['schema_json'], true);
    } elseif ($service_info['schema_type'] == 2) {
        $schema_info = $solr_schema['schema_json'];
        $doc = new DomDocument();
        $doc->loadXML($schema_info);
Exemplo n.º 2
0
//if ($instance["writable"] == 0) {
//    $master = pdo_get_master_complex($link, $service[0]["service_id"]);
//    $json["masterUrl"] = build_url_replication($master["host_ip"], $master["port_num"]);
//    if($json["pollInterval"]){
//        $json["pollInterval"] = $json["pollInterval"];
//    }else{
//        $json["pollInterval"] = "00:01:00";
//    }
//} else {
//    $json["pollInterval"] = "00:00:00";
//}
$json["master"] = "";
$json["slave"] = "";
$json["masterUrl"] = "";
$json['dataimport-config'] = "";
$dataimport = pdo_get_dataimport($link, $service[0]["service_id"]);
$config_path = $solr_root . '/cloud/' . $instance['port_num'] . '/idx/conf/db-data-config.xml';
unlink($config_path);
if ($instance["writable"] == 1) {
    /*master*/
    $json['master'] = '<lst name="master"><str name="replicateAfter">commit</str><str name="replicateAfter">startup</str><str name="confFiles">schema.xml,stopwords.txt</str></lst>';
    $json["pollInterval"] = "00:00:00";
    if (!empty($dataimport)) {
        $fp = fopen($config_path, 'w');
        fwrite($fp, $dataimport);
        fclose($fp);
        $json['dataimport-config'] = 'db-data-config.xml';
        /*指向dataimport的配置文件,若db-data-config.xml为空则此项置空*/
    }
} else {
    /*slave*/