Example #1
0
    } else {
        $query_type = 'slow';
        $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'];
Example #2
0
if (count($argv) < 2 || !preg_match("/^[0-9]+\$/", $argv[1])) {
    echo "<!-- # Usage: {$argv[0]} instance_id -->\n";
    exit(2);
}
$instance_id = $argv[1];
$instance = pdo_get_instance_byid($link, $instance_id);
if (!$instance) {
    echo "<!-- # Instance not exists -->\n";
    exit(1);
}
$service = get_service_list_by_mapping($link, $instance);
if (!$service) {
    echo "<!-- # Service mapping not exists -->\n";
    exit(1);
}
$config = pdo_get_solr_config($link, $service[0]["service_id"]);
if (!$config) {
    echo "<!-- # Solr config not exists -->\n";
    exit(1);
}
if ($service[0]["config_type"] == 1) {
    /*优先到自己的instance路径找tpl文件,找不到则采用公共的文件(只兼容3.5x)*/
    //$template = file_get_contents(build_path_configtpl($solr_root, $instance['port_num'])."/solrconfig.xml.tpl");
    if (!get_version_dir($service[0]["solr_version"])) {
        exit(1);
    }
    $template = file_get_contents($base . '/' . get_version_dir($service[0]["solr_version"]) . '/solrconfig.xml.tpl');
    if (!$template) {
        $template = file_get_contents($base . "/solrconfig.xml.tpl");
    }
    $json = json_decode($config["config_json"], true);