solr 5.3.1安装配置
1、下载Solr5.3.1
http://mirror.bit.edu.cn/apache/lucene/solr/5.3.1/
wget http://mirror.bit.edu.cn/apache/lucene/solr/5.3.0/solr-5.3.0.tgz
2、解压压缩包
tar zxf solr-5.3..tgz
或
unzip solr-5.3..zip
3、配置solr
1、复制solr项目文件
mkdir -p /data/web/solr/solr_app/
cp -r /data/solr-5.3./server/solr-webapp/webapp/* /data/web/solr/solr_app/
2、复制dll文件
cp /data/solr-5.3./server/lib/ext/* /data/web/solr/solr_app/WEB-INF/lib/
3、复制日志文件
mkdir /data/web/solr/solr_app/WEB-INF/classes
cp /data/solr-5.3./server/resources/log4j.properties /data/web/solr/solr_app/WEB-INF/classes/
4、修改solr.log文件的存储位置:默认在/root/logs/solr.log
vim /data/web/solr/solr_app/WEB-INF/classes/log4j.properties

改成自己的日志路径

5、复制solr.xml文件到web.xml里面的<env-entry-value>的路径下
mkdir -p /data/web/solr/solr_app/WEB-INF/solr_home
cp /data/solr-5.3.1/example/example-DIH/solr/solr.xml /data/web/solr/solr_app/WEB-INF/solr_home/

6、配置solr_home
vim /data/web/solr/solr_app/WEB-INF/web.xml --修改env-entry-value的值:/data/web/solr/solr_app/WEB-INF/solr_home

tomcat配置->Server.xml->Connector->connectionTimeout="20000"不知道为什么,这个值大了启动tomcat,solr页面显示就是失败的。

启动tomcat,此时没有集合,如下图:

4、配置solr集合
1、进入solr_home,开始配置solr的索引库、分词器、数据源和定时任务:
cd /data/web/solr/solr_app/WEB-INF/solr_home/
2、为某一个语言创建solr配置,首先需要该语言的目录,比如:英文
mkdir pc_EN
cd pc_EN
touch core.properties
mkdir conf
mkdir data

3、编辑core.properties文件,设置索引名称和索引存放的位置:
vim core.properties
--指定索引文件的存放位置(solr_index目录可以创建了mkdir -p /data/web/solr/solr_app/WEB-INF/solr_index)
--文件内容
name=pc_EN
dataDir=/data/web/solr/solr_app/WEB-INF/solr_index/master/pc_EN/data


4、进入conf目录设置索引的数据格式、数据源
cd conf
find /data -name solrconfig.xml

把rss文件夹下面的solrconfig.xml复制到pc_EN/conf目录里面
cp /data/solr-5.3./example/example-DIH/solr/rss/conf/solrconfig.xml solrconfig.xml

设置solrconfig.xml关联website-data-config.xml文件
vim solrconfig.xml --搜索name="/dataimport"

设置solrconfig.xml的solr搜索结果返回的数据格式为:xml

设置solrconfig.xml关联schema.xml文件,增加如下代码:
<requestHandler name="/replication" class="solr.ReplicationHandler" >
<lst name="master">
<str name="replicateAfter">commit</str>
<str name="replicateAfter">startup</str>
<str name="confFiles">schema.xml</str>
</lst>
</requestHandler>

完整的solrconfig.xml文件
<?xml version="1.0" encoding="UTF-8" ?>
<!--
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.
--> <!--
This is a stripped down config file used for a simple example...
It is *not* a good example to work from.
-->
<config>
<luceneMatchVersion>5.3.</luceneMatchVersion>
<!-- The DirectoryFactory to use for indexes.
solr.StandardDirectoryFactory, the default, is filesystem based.
solr.RAMDirectoryFactory is memory based, not persistent, and doesn't work with replication. -->
<directoryFactory name="DirectoryFactory" class="${solr.directoryFactory:solr.NRTCachingDirectoryFactory}"/> <dataDir>${solr.data.dir:}</dataDir> <!-- To enable dynamic schema REST APIs, use the following for <schemaFactory>: <schemaFactory class="ManagedIndexSchemaFactory">
<bool name="mutable">true</bool>
<str name="managedSchemaResourceName">managed-schema</str>
</schemaFactory> When ManagedIndexSchemaFactory is specified, Solr will load the schema from
he resource named in 'managedSchemaResourceName', rather than from schema.xml.
Note that the managed schema resource CANNOT be named schema.xml. If the managed
schema does not exist, Solr will create it after reading schema.xml, then rename
'schema.xml' to 'schema.xml.bak'. Do NOT hand edit the managed schema - external modifications will be ignored and
overwritten as a result of schema modification REST API calls. When ManagedIndexSchemaFactory is specified with mutable = true, schema
modification REST API calls will be allowed; otherwise, error responses will be
sent back for these requests.
-->
<codecFactory class="solr.SchemaCodecFactory"/>
<schemaFactory class="ClassicIndexSchemaFactory"/> <updateHandler class="solr.DirectUpdateHandler2">
<updateLog>
<str name="dir">${solr.data.dir:}</str>
<int name="numVersionBuckets">${solr.ulog.numVersionBuckets:}</int>
</updateLog>
</updateHandler> <query>
<!-- Max Boolean Clauses Maximum number of clauses in each BooleanQuery, an exception
is thrown if exceeded. ** WARNING ** This option actually modifies a global Lucene property that
will affect all SolrCores. If multiple solrconfig.xml files
disagree on this property, the value at any given moment will
be based on the last SolrCore to be initialized. -->
<maxBooleanClauses></maxBooleanClauses> <!-- Solr Internal Query Caches There are two implementations of cache available for Solr,
LRUCache, based on a synchronized LinkedHashMap, and
FastLRUCache, based on a ConcurrentHashMap. FastLRUCache has faster gets and slower puts in single
threaded operation and thus is generally faster than LRUCache
when the hit ratio of the cache is high (> %), and may be
faster under other scenarios on multi-cpu systems.
--> <!-- Filter Cache Cache used by SolrIndexSearcher for filters (DocSets),
unordered sets of *all* documents that match a query. When a
new searcher is opened, its caches may be prepopulated or
"autowarmed" using data from caches in the old searcher.
autowarmCount is the number of items to prepopulate. For
LRUCache, the autowarmed items will be the most recently
accessed items. Parameters:
class - the SolrCache implementation LRUCache or
(LRUCache or FastLRUCache)
size - the maximum number of entries in the cache
initialSize - the initial capacity (number of entries) of
the cache. (see java.util.HashMap)
autowarmCount - the number of entries to prepopulate from
and old cache.
-->
<filterCache class="solr.FastLRUCache"
size=""
initialSize=""
autowarmCount=""/> <!-- Query Result Cache Caches results of searches - ordered lists of document ids
(DocList) based on a query, a sort, and the range of documents requested.
Additional supported parameter by LRUCache:
maxRamMB - the maximum amount of RAM (in MB) that this cache is allowed
to occupy
-->
<queryResultCache class="solr.LRUCache"
size=""
initialSize=""
autowarmCount=""/> <!-- Document Cache Caches Lucene Document objects (the stored fields for each
document). Since Lucene internal document ids are transient,
this cache will not be autowarmed.
-->
<documentCache class="solr.LRUCache"
size=""
initialSize=""
autowarmCount=""/> <!-- custom cache currently used by block join -->
<cache name="perSegFilter"
class="solr.search.LRUCache"
size=""
initialSize=""
autowarmCount=""
regenerator="solr.NoOpRegenerator" /> <!-- Lazy Field Loading If true, stored fields that are not requested will be loaded
lazily. This can result in a significant speed improvement
if the usual case is to not load all stored fields,
especially if the skipped fields are large compressed text
fields.
-->
<enableLazyFieldLoading>true</enableLazyFieldLoading> <!-- Result Window Size An optimization for use with the queryResultCache. When a search
is requested, a superset of the requested number of document ids
are collected. For example, if a search for a particular query
requests matching documents through , and queryWindowSize is ,
then documents through will be collected and cached. Any further
requests in that range can be satisfied via the cache.
-->
<queryResultWindowSize></queryResultWindowSize> <!-- Maximum number of documents to cache for any entry in the
queryResultCache.
-->
<queryResultMaxDocsCached></queryResultMaxDocsCached> <!-- Use Cold Searcher If a search request comes in and there is no current
registered searcher, then immediately register the still
warming searcher and use it. If "false" then all requests
will block until the first searcher is done warming.
-->
<useColdSearcher>false</useColdSearcher> <!-- Max Warming Searchers Maximum number of searchers that may be warming in the
background concurrently. An error is returned if this limit
is exceeded. Recommend values of - for read-only slaves, higher for
masters w/o cache warming.
-->
<maxWarmingSearchers></maxWarmingSearchers> </query> <requestDispatcher handleSelect="true" >
<requestParsers enableRemoteStreaming="true" multipartUploadLimitInKB="" formdataUploadLimitInKB="" />
</requestDispatcher> <requestHandler name="/select" class="solr.SearchHandler">
<lst name="defaults">
<str name="echoParams">explicit</str>
<str name="wt">xml</str>
<str name="indent">true</str>
<int name="rows"></int>
</lst>
</requestHandler> <requestHandler name="/analysis/field" startup="lazy" class="solr.FieldAnalysisRequestHandler" /> <requestHandler name="/admin/ping" class="solr.PingRequestHandler">
<lst name="invariants">
<str name="q">*:*</str>
</lst>
<lst name="defaults">
<str name="echoParams">all</str>
</lst>
</requestHandler> <requestHandler name="/dataimport" class="org.apache.solr.handler.dataimport.DataImportHandler">
<lst name="defaults">
<str name="config">website-data-config.xml</str>
</lst>
</requestHandler> <requestHandler name="/replication" class="solr.ReplicationHandler" >
<lst name="master">
<str name="replicateAfter">commit</str>
<str name="replicateAfter">startup</str>
<str name="confFiles">schema.xml</str>
</lst>
</requestHandler> <!-- config for the admin interface -->
<admin>
<defaultQuery>*:*</defaultQuery>
</admin> </config>
solrconfig.xml
schema.xml用来设置solr需要索引的字段

完整的schema.xml
<?xml version="1.0" ?> <schema name="website" version="1.5">
<types>
<fieldType name="string" class="solr.StrField" sortMissingLast="true" omitNorms="true" />
<fieldType name="boolean" class="solr.BoolField" sortMissingLast="true" omitNorms="true" />
<fieldType name="booleans" class="solr.BoolField" sortMissingLast="true" multiValued="true"/>
<fieldType name="int" class="solr.TrieIntField" precisionStep="0" omitNorms="true" positionIncrementGap="0" />
<fieldType name="float" class="solr.TrieFloatField" precisionStep="0" omitNorms="true" positionIncrementGap="0" />
<fieldType name="long" class="solr.TrieLongField" precisionStep="0" omitNorms="true" positionIncrementGap="0" />
<fieldType name="double" class="solr.TrieDoubleField" precisionStep="0" omitNorms="true" positionIncrementGap="0" />
<fieldType name="date" class="solr.TrieDateField" omitNorms="true" precisionStep="0" positionIncrementGap="0" />
<fieldType name="tint" class="solr.TrieIntField" precisionStep="8" omitNorms="true" positionIncrementGap="0" />
<fieldType name="sfloat" class="solr.TrieFloatField" precisionStep="8" omitNorms="true" positionIncrementGap="0" />
<fieldType name="tlong" class="solr.TrieLongField" precisionStep="8" omitNorms="true" positionIncrementGap="0" />
<fieldType name="tdouble" class="solr.TrieDoubleField" precisionStep="8" omitNorms="true" positionIncrementGap="0" />
<fieldType name="tdate" class="solr.TrieDateField" omitNorms="true" precisionStep="6" positionIncrementGap="0" />
<fieldType name="tdates" class="solr.TrieDateField" precisionStep="6" positionIncrementGap="0" multiValued="true"/>
<fieldType name="tints" class="solr.TrieIntField" precisionStep="8" positionIncrementGap="0" multiValued="true"/>
<fieldType name="tfloats" class="solr.TrieFloatField" precisionStep="8" positionIncrementGap="0" multiValued="true"/>
<fieldType name="tlongs" class="solr.TrieLongField" precisionStep="8" positionIncrementGap="0" multiValued="true"/>
<fieldType name="tdoubles" class="solr.TrieDoubleField" precisionStep="8" positionIncrementGap="0" multiValued="true"/>
<fieldType name="text" class="solr.TextField">
<analyzer type="index" class="org.apache.lucene.analysis.en.EnglishAnalyzer"/>
<analyzer type="query" class="org.apache.lucene.analysis.en.EnglishAnalyzer"/>
</fieldType>
</types>
<!-- general -->
<fields>
<field name="_version_" type="long" indexed="true" stored="true"/>
<field name="CultureID" type="int" indexed="false" stored="true" />
<field name="DescriptionFull" type="text" indexed="true" stored="false" />
<field name="DescriptionShort" type="text" indexed="true" stored="false" />
<field name="ImageJSON" type="text" indexed="false" stored="true" />
<field name="IsHot" type="int" indexed="false" stored="true" />
<field name="IsMutilColor" type="int" indexed="false" stored="true" default="" />
<field name="LeiMuNameJSON" type="text" indexed="true" stored="true" />
<field name="PID" type="string" indexed="true" stored="true" />
<field name="PropertyText" type="text" indexed="true" stored="true" />
<field name="RequiredText" type="text" indexed="true" stored="true" />
<field name="SPUID" type="long" indexed="true" stored="true" />
<field name="Sort" type="int" indexed="true" stored="true" />
<field name="Status" type="int" indexed="true" stored="true" />
<field name="Title" type="text" indexed="true" stored="true" />
<field name="UpTime" type="date" indexed="true" stored="true" />
<field name="Price" type="double" indexed="true" stored="true" />
<field name="SaleCount" type="long" indexed="true" stored="true" />
<field name="CustomerRatingCount" type="long" indexed="false" stored="true" />
<field name="DisCount" type="double" indexed="true" stored="true" />
<field name="Basic_search" type="text" indexed="true" stored="false" multiValued="true"/>
</fields> <!-- field to use to determine and enforce document uniqueness. -->
<uniqueKey>SPUID</uniqueKey>
<!-- field for the QueryParser to use when an explicit fieldname is absent -->
<defaultSearchField>Basic_search</defaultSearchField>
<!-- SolrQueryParser configuration: defaultOperator="AND|OR" -->
<solrQueryParser defaultOperator="OR"/>
<copyField source="PID" dest="Basic_search" />
<copyField source="DescriptionFull" dest="Basic_search" />
<copyField source="DescriptionShort" dest="Basic_search" />
<copyField source="LeiMuNameJSON" dest="Basic_search" />
<copyField source="PropertyText" dest="Basic_search" />
<copyField source="RequiredText" dest="Basic_search" />
<copyField source="Title" dest="Basic_search" />
</schema>
schema.xml
website-data-config.xml设置数据源和数据源格式与schema.xml的字段匹配

完整的website-data-config.xml
<?xml version="1.0" encoding="UTF-8" ?>
<dataConfig>
<dataSource type="URLDataSource" encoding="UTF-8" />
<document>
<entity name="website"
processor="XPathEntityProcessor"
forEach="/LuceneSpuXmlModel/LuceneSpuModelList/LuceneSpuModel |/LuceneSpuXmlModel"
url="http://url/product?cultureId=1&pageSize=100&pageIndex=1&siteId=6&platform=1"
transformer="RegexTransformer,DateFormatTransformer"
connectionTimeout="120000"
readTimeout="300000"
stream="true">
<field column="SPUID" xpath="/LuceneSpuXmlModel/LuceneSpuModelList/LuceneSpuModel/SPUID" />
<field column="PID" xpath="/LuceneSpuXmlModel/LuceneSpuModelList/LuceneSpuModel/PID" />
<field column="Title" xpath="/LuceneSpuXmlModel/LuceneSpuModelList/LuceneSpuModel/Title" />
<field column="Status" xpath="/LuceneSpuXmlModel/LuceneSpuModelList/LuceneSpuModel/Status" />
<field column="CultureID" xpath="/LuceneSpuXmlModel/LuceneSpuModelList/LuceneSpuModel/CultureID" commonField="true" />
<field column="LeiMuNameJSON" xpath="/LuceneSpuXmlModel/LuceneSpuModelList/LuceneSpuModel/LeiMuNameJSON" />
<field column="DescriptionShort" xpath="/LuceneSpuXmlModel/LuceneSpuModelList/LuceneSpuModel/DescriptionShort" commonField="true" />
<field column="DescriptionFull" xpath="/LuceneSpuXmlModel/LuceneSpuModelList/LuceneSpuModel/DescriptionFull" commonField="true" />
<field column="Sort" xpath="/LuceneSpuXmlModel/LuceneSpuModelList/LuceneSpuModel/Sort" />
<field column="ImageJSON" xpath="/LuceneSpuXmlModel/LuceneSpuModelList/LuceneSpuModel/ImageJSON" />
<field column="PropertyText" xpath="/LuceneSpuXmlModel/LuceneSpuModelList/LuceneSpuModel/PropertyText" />
<field column="RequiredText" xpath="/LuceneSpuXmlModel/LuceneSpuModelList/LuceneSpuModel/RequiredText" />
<field column="IsHot" xpath="/LuceneSpuXmlModel/LuceneSpuModelList/LuceneSpuModel/IsHot" />
<field column="IsMutilColor" xpath="/LuceneSpuXmlModel/LuceneSpuModelList/LuceneSpuModel/IsMutilColor" />
<field column="UpTime" xpath="/LuceneSpuXmlModel/LuceneSpuModelList/LuceneSpuModel/UpTime" dateTimeFormat="yyyy-MM-dd'T'hh:mm:ss"/>
<field column="Price" xpath="/LuceneSpuXmlModel/LuceneSpuModelList/LuceneSpuModel/Price" />
<field column="SaleCount" xpath="/LuceneSpuXmlModel/LuceneSpuModelList/LuceneSpuModel/SaleCount" />
<field column="CustomerRatingCount" xpath="/LuceneSpuXmlModel/LuceneSpuModelList/LuceneSpuModel/CustomerRatingCount" />
<field column="DisCount" xpath="/LuceneSpuXmlModel/LuceneSpuModelList/LuceneSpuModel/DisCount" /> <field column="$hasMore" xpath="/LuceneSpuXmlModel/HasMore" />
<field column="$nextUrl" xpath="/LuceneSpuXmlModel/NextPageUrl" />
</entity>
</document>
</dataConfig>
website-data-config.xml
启动Tomcat运行solr出错:

复制数据倒入的包:
cp /data/solr-5.3.1/dist/solr-dataimporthandler-* /data/web/solr/solr_app/WEB-INF/lib/
启动tomcat_solr成功界面如下:

5、设置solr定时任务
1、复制定时任务包(如果没有复制过)
cp /data/solr-5.3.1/dist/solr-dataimporthandler-* /data/web/solr/solr_app/WEB-INF/lib/
2、还需要一个jar也复制到/data/web/solr/solr_app/WEB-INF/lib/下面:
apache-solr-dataimportscheduler-1.0.jar
3、修改Web.xml,添加配置节点:
<listener>
<listener-class>
org.apache.solr.handler.dataimport.scheduler.ApplicationListener
</listener-class>
</listener>
4、回到solr_home目录创建conf目录,创建dataimport.properties定时任务文件:

5、编辑dataimport.properties定时任务文件:
a、设置syncCores,server,port

b、设置时间间隔、开始时间:

http://my.oschina.net/lsf930709/blog/620738(参考文章)
solr 5.3.1安装配置的更多相关文章
- solr 4.6的安装配置
从网上看了很多资料,很多都是老的.自己也算是结合着弄出来了. 1.下载的准备工作 tomcat8.solr4.6 具体的下载自己去找去吧.或者后期我在提供. 2.开始配置 tomcat路径:E:\ ...
- Zookeeper、Solr和Tomcat安装配置实践
Zookeeper.Solr和Tomcat安装配置实践
- (一)Solr——简介和安装配置
1. solr简介 1.1 Solr是什么 Solr是apache的顶级开源项目,它是使用java开发 ,基于lucene的全文检索服务器. Solr和lucene的版本是同步更新的,最新的版本是7. ...
- solr安装配置
1.solr是基于tomcat安装部署的 2.网上下载solr-5.2.1 http://lucene.apache.org/solr/downloads.html 3.解压solr文件 tar zx ...
- solr学习篇(一) solr7.4 安装配置篇
目录: solr简介 solr安装 创建core 1.solr简介 solr是企业级应用的全文检索项目,它是基于Apache Lucence搜索引擎开发出来的用于搜索的应用工程 运行环境:solr需要 ...
- solr4.5安装配置 linux+tomcat6.0+mmseg4j-1.9.1分词
首先先介绍下solr的安装配置 solr下载地址 (我这用的solr-4.5.0) 运行环境 JDK 1.5或更高版本 下载地址(Solr 4以上版本,要求JDK 1.6) 我用的JDK1.6 ) ...
- 【转载】Solr4+IKAnalyzer的安装配置
转载:http://www.cnblogs.com/madyina/p/4131751.html 一.下载Solr4.10.2 我们以Windows版本为例,solr-4.10.2.zip是目前最新版 ...
- Solr4+IKAnalyzer的安装配置
一.下载Solr4.10.2 我们以Windows版本为例,solr-4.10.2.zip是目前最新版本,下载地址: http://www.apache.org/dyn/closer.cgi/luce ...
- elasticsearch系列一:elasticsearch(ES简介、安装&配置、集成Ikanalyzer)
一.ES简介 1. ES是什么? Elasticsearch 是一个开源的搜索引擎,建立在全文搜索引擎库 Apache Lucene 基础之上 用 Java 编写的,它的内部使用 Lucene 做索引 ...
随机推荐
- Xamarin/Mono IOS Limitations
http://developer.xamarin.com/guides/ios/advanced_topics/limitations/ Since applications on the iPhon ...
- Pandas DataFrame笔记
1.属性方式,可以用于列,不能用于行 2.可以用整数切片选择行,但不能用单个整数索引(当索引不是整数时) 3.直接索引可以使用列.列集合,但不能用索引名索引行 用iloc取行,得到的series: d ...
- 【Android开发VR实战】二.播放360°全景视频
转载请注明出处:http://blog.csdn.net/linglongxin24/article/details/53924006 本文出自[DylanAndroid的博客] [Android开发 ...
- 使用Spring框架入门二:基于注解+XML配置的IOC/DI的使用
一.简述 本文主要讲使用注解+xml配合使用的几种使用方式.基础课程请看前一节. 二.步骤 1.为Pom.xml中引入依赖:本例中使用的是spring-context包,引入此包时系统会自动导入它的依 ...
- LCD显示——点阵字体
Bitmap font 点阵字体是把每一个字符都分成16×16或24×24个点,然后用每个点的虚实来表示字符的轮廓. 点阵字体优点是显示速度快,不像矢量字体需要计算:其最大的缺点是不能放大,一旦放大后 ...
- JAVA设计模式——第 2 章 代理模式【Proxy Pattern】(转)
什么是代理模式呢?我很忙,忙的没空理你,那你要找我呢就先找我的代理人吧,那代理人总要知道被代理人能做哪些事情不能做哪些事情吧,那就是两个人具备同一个接口,代理人虽然不能干活,但是被代理的人能干活呀. ...
- vuejs组件交互 - 03 - vuex状态管理实现组件交互
组件交互模式的使用场景 简单应用直接使用props down,event up的模式就可以了 小型应用使用事件中心模式即可 中大型应用使用vuex的状态管理模式 vuex 包含要管理的应用数据和更新数 ...
- RESTful Web服务的操作
1.首先我们说一下Http协议是无状态的 HTTP协议是无状态的,我们看到查到的用到的返回404,500,200,201,202,301.这些不是HTTP协议的状态码. 是HTTP的状态码,就是HTT ...
- BIO、NIO和AIO的区别(简明版)
转载请注明原文地址:http://www.cnblogs.com/ygj0930/p/6543960.html 一:事件分离器 在IO读写时,把 IO请求 与 读写操作 分离调配进行,需要用到事件分离 ...
- RPC远程调用概念 && demo实例
RPC是指远程过程调用,直观说法就是A通过网络调用B的过程方法. 也就是说两台serverA.B,一个应用部署在Aserver上,想要调用Bserver上应用提供的函数/方法,因为不在一个内存空间,不 ...