[root@centos src]# (2)Solrのインストール Solrのダウンロードを行います。次のURL(http://www.apache.org/dyn/closer.cgi/lucene/solr/)にアクセスし,適宜ミラー・サイトを選択して「apache-solr-1.4.0.tgz」をダウンロード [root@centos init.d]# cd /opt [root@centos opt]# wget http://ftp.kddilabs.jp/infosystems/apache/lucene/solr/1.4.0/apache-solr-1.4.0.tgz --10:53:01-- http://ftp.kddilabs.jp/infosystems/apache/lucene/solr/1.4.0/apache-solr-1.4.0.tgz ftp.kddilabs.jp をDNSに問いあわせています... 192.26.91.193, 2001:200:601:10:206:5bff:fef0:466c ftp.kddilabs.jp|192.26.91.193|:80 に接続しています... 接続しました。 HTTP による接続要求を送信しました、応答を待っています... 200 OK 長さ: 56364075 (54M) [application/x-gzip] Saving to: `apache-solr-1.4.0.tgz' 100%[=======================================>] 56,364,075 1.76M/s in 29s 10:53:30 (1.87 MB/s) - `apache-solr-1.4.0.tgz' を保存しました [56364075/56364075] [root@centos opt]#tar zxvf apache-solr-1.4.0.tgz apache-solr-1.4.0/docs/skin/images/spacer.gif apache-solr-1.4.0/docs/skin/images/success.png apache-solr-1.4.0/docs/skin/images/txtdoc.png apache-solr-1.4.0/docs/skin/images/txtdoc.svg.xslt apache-solr-1.4.0/docs/skin/images/update.jpg apache-solr-1.4.0/docs/skin/images/valid-html401.png apache-solr-1.4.0/docs/skin/images/vcss.png apache-solr-1.4.0/docs/skin/images/warning.png apache-solr-1.4.0/docs/skin/images/xmldoc.gif apache-solr-1.4.0/docs/skin/menu.js apache-solr-1.4.0/docs/skin/note.txt apache-solr-1.4.0/docs/skin/print.css apache-solr-1.4.0/docs/skin/profile.css apache-solr-1.4.0/docs/skin/profile.css.xslt apache-solr-1.4.0/docs/skin/prototype.js apache-solr-1.4.0/docs/skin/screen.css apache-solr-1.4.0/docs/skin/skinconf.xsl apache-solr-1.4.0/docs/tutorial.html apache-solr-1.4.0/docs/tutorial.pdf apache-solr-1.4.0/docs/version_control.html apache-solr-1.4.0/docs/version_control.pdf apache-solr-1.4.0/docs/who.html apache-solr-1.4.0/docs/who.pdf [root@centos opt]# cd /opt/apache-solr-1.4.0/example/ [root@centos opt]# java -jar start.jar 2010/08/19 13:20:15 org.apache.solr.core.QuerySenderListener newSearcher 情報: QuerySenderListener done. 2010/08/19 13:20:15 org.apache.solr.handler.component.SpellCheckComponent$SpellCheckerListener newSearcher 情報: Loading spell index for spellchecker: default 2010/08/19 13:20:15 org.apache.solr.handler.component.SpellCheckComponent$SpellCheckerListener newSearcher 情報: Loading spell index for spellchecker: jarowinkler 2010/08/19 13:20:15 org.apache.solr.handler.component.SpellCheckComponent$SpellCheckerListener newSearcher 情報: Loading spell index for spellchecker: file 2010/08/19 13:20:15 org.apache.solr.core.SolrCore registerSearcher 情報: Registered new searcher Searcher@c743eb main 2010/08/19 13:20:15 org.apache.solr.core.CoreContainer register 情報: registering core: 2010/08/19 13:20:15 org.apache.solr.servlet.SolrDispatchFilter init 情報: user.dir=/opt/apache-solr-1.4.0/example 2010/08/19 13:20:15 org.apache.solr.servlet.SolrDispatchFilter init 情報: SolrDispatchFilter.init() done 2010/08/19 13:20:15 org.apache.solr.servlet.SolrServlet init 情報: SolrServlet.init() 2010/08/19 13:20:15 org.apache.solr.core.SolrResourceLoader locateInstanceDir 情報: JNDI not configured for solr (NoInitialContextEx) 2010/08/19 13:20:15 org.apache.solr.core.SolrResourceLoader locateInstanceDir 情報: solr home defaulted to 'solr/' (could not find system property or JNDI) 2010/08/19 13:20:15 org.apache.solr.servlet.SolrServlet init 情報: SolrServlet.init() done 2010/08/19 13:20:15 org.apache.solr.core.SolrResourceLoader locateInstanceDir 情報: JNDI not configured for solr (NoInitialContextEx) 2010/08/19 13:20:15 org.apache.solr.core.SolrResourceLoader locateInstanceDir 情報: solr home defaulted to 'solr/' (could not find system property or JNDI) 2010/08/19 13:20:15 org.apache.solr.servlet.SolrUpdateServlet init 情報: SolrUpdateServlet.init() done 2010-08-19 13:20:15.254::INFO: Started SocketConnector @ 0.0.0.0:8983 2010/08/19 13:48:51 org.apache.solr.core.SolrCore registerSearcher 情報: [] Registered new searcher Searcher@1fb3211 main 2010/08/19 13:48:51 org.apache.solr.search.SolrIndexSearcher close 情報: Closing Searcher@10721b0 main filterCache{lookups=0,hits=0,hitratio=0.00,inserts=0,evictions=0,size=0,warmupTime=0,cumulative_lookups=0,cumulative_hits=0,cumulative_hitratio=0.00,cumulative_inserts=0,cumulative_evictions=0} queryResultCache{lookups=0,hits=0,hitratio=0.00,inserts=2,evictions=0,size=2,warmupTime=0,cumulative_lookups=0,cumulative_hits=0,cumulative_hitratio=0.00,cumulative_inserts=0,cumulative_evictions=0} documentCache{lookups=0,hits=0,hitratio=0.00,inserts=0,evictions=0,size=0,warmupTime=0,cumulative_lookups=0,cumulative_hits=0,cumulative_hitratio=0.00,cumulative_inserts=0,cumulative_evictions=0} 2010/08/19 13:48:51 org.apache.solr.update.processor.LogUpdateProcessor finish 情報: {commit=} 0 144 2010/08/19 13:48:51 org.apache.solr.core.SolrCore execute 情報: [] webapp=/solr path=/update params={} status=0 QTime=144 2010/08/19 13:50:23 org.apache.solr.core.SolrCore execute 情報: [] webapp=/solr path=/select/ params={indent=on&start=0&q=ipod&version=2.2&rows=10} hits=3 status=0 QTime=7 2010/08/19 13:50:48 org.apache.solr.core.SolrCore execute 情報: [] webapp=/solr path=/select/ params={indent=on&start=0&q=日本語%0d%0a&version=2.2&rows=10} hits=1 status=0 QTime=1 --------------------------------------------------------------------------- [root@centos apache-solr-1.4.0]# cd example/ [root@centos example]# cd exampledocs/ [root@centos exampledocs]# ls books.csv mem.xml post.jar spellchecker.xml hd.xml monitor.xml post.sh test_utf8.sh ipod_other.xml monitor2.xml sd500.xml utf8-example.xml ipod_video.xml mp500.xml solr.xml vidcard.xml [root@centos exampledocs]# cp utf8-example.xml nihongo.xml [root@centos exampledocs]# vi nihongo.xml [root@centos exampledocs]# ls books.csv mem.xml nihongo.xml solr.xml vidcard.xml hd.xml monitor.xml post.jar spellchecker.xml ipod_other.xml monitor2.xml post.sh test_utf8.sh ipod_video.xml mp500.xml sd500.xml utf8-example.xml [root@centos exampledocs]# ./post.sh *.xml Posting file hd.xml to http://localhost:8983/solr/update |
iSeriesAccess-6.1.0-1.2.i386.rpm IBMのダウンロードのページのURL http://www-03.ibm.com/servers/eserver/iseries/access/linux/ [root@EDPS edps]# yum install unixODBC [root@EDPS edps]# yum install unixODBC-devel [root@EDPS edps]# yum install unixODBC-kde [root@EDPS edps]# rpm -ihv iSeriesAccess-6.1.0-1.2.i386.rpm エラー: 依存性の欠如: libXm.so.3 は iSeriesAccess-6.1.0-1.2.i386 に必要とされています libXp.so.6 は iSeriesAccess-6.1.0-1.2.i386 に必要とされています [root@EDPS edps]# yum install [root@EDPS edps]# yum install openmotif Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile * addons: ftp.nara.wide.ad.jp * base: ftp.nara.wide.ad.jp * extras: ftp.nara.wide.ad.jp * updates: ftp.nara.wide.ad.jp Setting up Install Process Resolving Dependencies --> Running transaction check ---> Package openmotif.i386 0:2.3.1-5.el5_5.1 set to be updated addons/filelists | 195 B 00:00 base/filelists_db | 3.4 MB 00:05 extras/filelists_db | 197 kB 00:00 updates/filelists_db | 3.7 MB 00:01 --> Processing Dependency: libXp.so.6 for package: openmotif --> Running transaction check ---> Package libXp.i386 0:1.0.0-8.1.el5 set to be updated --> Finished Dependency Resolution Dependencies Resolved ================================================================================ Package Arch Version Repository Size ================================================================================ Installing: openmotif i386 2.3.1-5.el5_5.1 updates 1.5 M Installing for dependencies: libXp i386 1.0.0-8.1.el5 base 23 k Transaction Summary ================================================================================ Install 2 Package(s) Update 0 Package(s) Remove 0 Package(s) Total download size: 1.5 M Is this ok [y/N]: y Downloading Packages: (1/2): libXp-1.0.0-8.1.el5.i386.rpm | 23 kB 00:00 (2/2): openmotif-2.3.1-5.el5_5.1.i386.rpm | 1.5 MB 00:01 -------------------------------------------------------------------------------- Total 977 kB/s | 1.5 MB 00:01 Running rpm_check_debug Running Transaction Test Finished Transaction Test Transaction Test Succeeded Running Transaction Installing : libXp 1/2 Installing : openmotif 2/2 Installed: openmotif.i386 0:2.3.1-5.el5_5.1 Dependency Installed: libXp.i386 0:1.0.0-8.1.el5 Complete! [root@EDPS edps]# ln -s /usr/lib/libXm.so.4 /usr/lib/libXm.so.3 [root@EDPS edps]# ls BKUP edps_20100317.sql edps_tsv TMP edps_20100325.sql edps_w admin.patch edps_20100330.sql hosts af_frame_line.txt edps_a iSeriesAccess-6.1.0-1.2.i386.rpm amazon_ec2.tar.gz edps_a.tar.gz ruby-1.8.7-p249.tar.gz edps_20100224.sql edps_a_svn.st.txt test edps_20100303.sql edps_t [root@EDPS edps]# rpm --nodeps -ivh iSeriesAccess-6.1.0-1.2.i386.rpm 準備中... ########################################### [100%] 1:iSeriesAccess ########################################### [100%] post install processing for iSeriesAccess 1.2...1 iSeries Access ODBC Driver has been deleted (if it existed at all) because its usage count became zero odbcinst: Driver installed. Usage count increased to 1. Target directory is /etc ODBCConfigコマンドでODBC設定 [root@EDPS edps]# vi /etc/odbc.ini [as400] Description = iSeries Access ODBC Driver Driver = iSeries Access ODBC Driver System = 172.20.XXX.XXX UserID = XXXXXX Password = XXXXXX1 Naming = 0 DefaultLibraries = SHCRFLIB Database = TSTTBL ConnectionType = 0 CommitMode = 2 ExtendedDynamic = 1 DefaultPkgLibrary = QGPL DefaultPackage = A/DEFAULT(IBM),2,0,1,0,512 AllowDataCompression = 1 MaxFieldLength = 32 BlockFetch = 1 BlockSizeKB = 128 ExtendedColInfo = 0 LibraryView = 0 AllowUnsupportedChar = 0 ForceTranslation = 0 Trace = 0 CCSID = 1350 "/etc/odbc.ini" 24L, 519C [root@EDPS edps]# /sbin/route add -net 172.20.0.0 netmask 255.255.0.0 gw 172.21.0.1 eth0 [root@EDPS edps]# ping 172.20.254.254 PING 172.20.254.254 (172.20.254.254) 56(84) bytes of data. 64 bytes from 172.20.254.254: icmp_seq=1 ttl=59 time=37.8 ms 64 bytes from 172.20.254.254: icmp_seq=2 ttl=59 time=6.81 ms 64 bytes from 172.20.254.254: icmp_seq=3 ttl=59 time=6.88 ms 64 bytes from 172.20.254.254: icmp_seq=4 ttl=59 time=6.37 ms --- 172.20.254.254 ping statistics --- 4 packets transmitted, 4 received, 0% packet loss, time 3002ms rtt min/avg/max/mdev = 6.379/14.479/37.840/13.488 ms [root@EDPS edps]# [edps@EDPS ~]$ isql as400 ID PASSWD +---------------------------------------+ | Connected! | | | | sql-statement | | help [tablename] | | quit | | | +---------------------------------------+ SQL> select * from SHCRFLIB.TSTTBL +-----------+---------------------------------------------------+---------------+-----------+ | TSCUST | TSCNAM | TSKING | TSENDT | +-----------+---------------------------------------------------+---------------+-----------+ | 0000000010| 顧客名テスト10 | 1000000 | 20101108 | | 0000000020| 顧客名テスト20 | 2000000 | 20101108 | | 0000000030| 顧客名テスト30 | 3000000 | 20101108 | +-----------+---------------------------------------------------+---------------+-----------+ SQLRowCount returns -1 3 rows fetched SQL> quit [edps@EDPS ~]$ 最後にRubyからAS400へ接続テスト Railsプロジェクトを作り、動作させると無事に表示された、残るは日本語処理と SQL発行に関する処理 参考 http://www.geocities.jp/sugachan1973/doc/funto56.html http://publib.boulder.ibm.com/html/as400/v4r5/ic2962/info/java/rzaha/fileenc.htm |