`

solr jetty start for debug

阅读更多
/*
 * Licensed to the Apache Software Foundation (ASF) under one or more
 * contributor license agreements.  See the NOTICE file distributed with
 * this work for additional information regarding copyright ownership.
 * The ASF licenses this file to You under the Apache License, Version 2.0
 * (the "License"); you may not use this file except in compliance with
 * the License.  You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.apache.solr.client.solrj;

import org.eclipse.jetty.server.Connector;
import org.eclipse.jetty.server.HttpConnectionFactory;
import org.eclipse.jetty.server.Server;
import org.eclipse.jetty.server.ServerConnector;
import org.eclipse.jetty.webapp.WebAppContext;

/**
 * @since solr 1.3
 */
public class StartSolrJetty 
{
  public static void main( String[] args ) 
  {
    //solr home
    System.setProperty("solr.solr.home", "D:\\3_0\\deploy\\solrhome");


    Server server = new Server();
    ServerConnector connector = new ServerConnector(server, new HttpConnectionFactory());
    // Set some timeout options to make debugging easier.
    connector.setIdleTimeout(1000 * 60 * 60);
    connector.setSoLingerTime(-1);
    connector.setPort(8983);
    server.setConnectors(new Connector[] { connector });
    
    WebAppContext bb = new WebAppContext();
    bb.setServer(server);
    bb.setContextPath("/solr");
    bb.setWar("solr/webapp/web");

    
    server.setHandler(bb);

    try {
      System.out.println(">>> STARTING EMBEDDED JETTY SERVER, PRESS ANY KEY TO STOP");
      server.start();
      while (System.in.available() == 0) {
        Thread.sleep(5000);
      }
      server.stop();
      server.join();
    } 
    catch (Exception e) {
      e.printStackTrace();
      System.exit(100);
    }
  }
}

分享到:
评论

相关推荐

    linux上搭建solr的实现方法(用jetty部署)

    ./solr start -force ``` 这将启动内置的Jetty服务器,默认情况下Solr会监听8983端口。你可以通过访问`http://localhost:8983/solr/#/` 来检查Solr是否正常运行。 为了允许远程访问,你需要配置Linux系统的防火墙。...

    solr4.8.1 for linux

    7. **启动Solr**:在 `example` 目录下,运行 `bin/startup.sh` 脚本来启动内置的 Jetty 服务器。这将使 Solr 服务在默认端口 8983 上运行。 8. **访问Solr**:打开浏览器输入 `http://localhost:8983/solr/`,可以...

    jetty-io-9.2.10.v20150310.jar

    solr jetty-io-9.2.10.v20150310.jar

    solr-jetty:Jetty应用程序用于部署我们的Solr服务

    码头用于部署Solr的Jetty应用程序。 默认情况下,不包含任何核心。 必须将它们添加到配置中。安装下载并运行: java -jar start.jar从以下位置查看应用程序: http://localhost:8985/solr/版本号索尔4.10.4 码头8.1....

    solr-5.5.5 linux安装包

    4. **启动Solr**:在SOLR_HOME目录下,运行 `bin/solr start -e cloud` 来启动Solr,并创建一个Cloud模式的集合。这将启动Jetty服务器并自动配置Solr云。 5. **访问Solr界面**:在浏览器中输入 `...

    solr4.9与tomcat8,tomcat7整合

    - 使用CMD命令行,进入解压后的`solr-4.9.0/example`目录,执行`Java -jar start.jar`启动Solr服务。 - 服务启动后,你可以通过浏览器访问`http://localhost:8983/solr`来查看Solr管理界面。 - 要停止Solr服务,...

    jetty-rewrite-9.2.10.v20150310.jar

    solr jetty-rewrite-9.2.10.v20150310.jar

    Linux上Solr的启动方式

     (2)使用内置的Jetty来启动Solr服务器只需要在example目录下,执行start.jar程序即可,我们可以直接执行命令:java –jar start.jar。  (3)当服务启动后,默认发布在8983端口,所以可以访问该端口来访问Solr服务,...

    jetty-servlet-9.2.10.v20150310.jar

    solr jetty-servlet-9.2.10.v20150310.jar

    solr-7.4.0.zip

    要启动Solr 7.4.0,你需要先设置`JAVA_HOME`环境变量,然后进入解压后的目录,执行`bin/solr start`(在Windows上是`bin\solr.cmd start`)。这将启动一个单节点的Solr服务器。如果你想要配置多节点的SolrCloud模式...

    Spring Data for Apache Solr API(Spring Data for Apache Solr 开发文档).CHM

    Spring Data for Apache Solr API。 Spring Data for Apache Solr 开发文档

    Apache Solr(solr-8.11.1.tgz)

    这个目录下的`start.jar`是用于启动Solr服务器的命令行工具。 3. **dist 目录**:包含Solr的JAR文件和其他库,这些是运行Solr服务所必需的。 4. **example 目录**:提供了一个预配置的Solr实例,用于快速入门和...

    solr安装包下载地址

    2. 进入`bin`目录,根据操作系统运行相应的启动脚本(如`bin\solr start`或`bin\solr start -e cloud`)来启动Solr服务器。 3. 使用Web浏览器访问`http://localhost:8983/solr`,如果一切正常,你应该能看到Solr管理...

    solr 6.0.1 for centos.zip

    ./solr start -e cloud ``` 这将启动一个包含两个Solr实例的示例Cloud模式。 4. **配置和创建核心**:在Solr的Web管理界面(默认http://localhost:8983/solr)中,可以创建新的索引核心,配置字段类型和字段,...

    solr.war包solr.war包solr.war包solr.war包solr.war包

    solr.warsolr.war包solr.war包solr.war包solr.war包solr.war包solr.war包solr.war包solr.war包solr.war包solr.war包solr.war包solr.war包solr.war包solr.war包solr.war包solr.war包solr.war包solr.war包solr.war包...

    solr服务器的搭建

    <Context path="/solr" docBase="/usr/local/solr/solrhome" debug="0" reloadable="true" crossContext="true"> <Environment name="solr/home" type="java.lang.String" value="/usr/local/solr/solrhome" ...

    solr/ext/ 里面的jar包

    If using Jetty, the SLF4j logging jars need to go in the jetty lib/ext directory. For other containers, the corresponding directory should be used. For more information, see: ...

Global site tag (gtag.js) - Google Analytics