How to take solr index collection backup? - hadoop

How to take Solr collection back into lfs or hdfs?
While I am running this query: curl 'quickstart.cloudera:8983/solr/admin/…'; I got error:
ml version="1.0" encoding="UTF-8"?> <response> <lst name="responseHeader"><int name="status">400</int><int name="QTime">0</int></lst><lst name="error"><str name="msg">Unknown action: BACKUP</str><int name="code">400</int></lst> </response>

Related

OBIEE Webservice for SOA

I am trying to get the web services for SOA to work. I am doing what oracle says, but i am still getting error 500 with the following error:
WatchData: MESSAGE = [ServletContext#1374343816[app:biwssoa module:biservices path:null spec-version:3.1 version:12.1.3]] Root cause of ServletException.
javax.servlet.ServletException: Failed to contact BI Presentation Server due to: Could not access the session service.
at oracle.bi.ws.activeobjects.inspection.BiWsilServlet.doInspectionAction(BiWsilServlet.java:183)
at oracle.bi.ws.activeobjects.inspection.BiWsilServlet.doGet(BiWsilServlet.java:137)
I added wsil.browsing credential and used the weblogic login in the enterprise manager. Didnt work.
Then i tried adding wss_username_token_policy.xml to
/app/oracle/fmw12213/user_projects/domains/bi/config/fmwconfig/biinstances/coreapplication/
with the following content:
<?xml version="1.0" encoding="UTF-8"?>
<oracle-webservice-clients>
<webservice-client>
<port-info>
<policy-references>
<policy-reference uri="oracle/log_policy" category="management"/>
<policy-reference uri="oracle/wss_username_token_client_policy" category="security"/>
</policy-references>
</port-info>
</webservice-client>
</oracle-webservice-clients>
And editing my ActionFrameworkConfig.xml in
/app/oracle/fmw12213/user_projects/domains/bi/config/fmwconfig/biconfig/actions/
from this:
<?xml version="1.0" encoding="UTF-8"?>
<obi-action-config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="afconfig.xsd">
<aliases/>
<registries/>
<content-types>
<content-type>
<typename>webservices</typename>
<displayname>Web Services and BPEL Processes</displayname>
<actionType>WebServiceActionType</actionType>
</content-type>
<content-type>
<typename>misc</typename>
<displayname>Mixed Services</displayname>
<actionType>URLActionType</actionType>
</content-type>
</content-types>
<accounts/>
<policies/>
</obi-action-config>
to this:
<?xml version="1.0" encoding="UTF-8"?>
<obi-action-config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="afconfig.xsd">
<aliases/>
<registries>
<registry>
<id>reg1b</id>
<name>BI EE Web Services for SOA</name>
<content-type>webservices</content-type>
<provider-class>oracle.bi.action.registry.wsil.WSILRegistry</provider-class>
<description/>
<location>
<path>http://localhost:7033/biservices/inspection?wsil</path>
</location>
<service-access>
<account>wsil.browsing</account>
<policy>wss_username_token_policy</policy>
<propagateIdentity>false</propagateIdentity>
</service-access>
</registry>
<regestries>
<content-types>
<content-type>
<typename>webservices</typename>
<displayname>Web Services and BPEL Processes</displayname>
<actionType>WebServiceActionType</actionType>
</content-type>
<content-type>
<typename>misc</typename>
<displayname>Mixed Services</displayname>
<actionType>URLActionType</actionType>
</content-type>
</content-types>
<accounts>
<account>
<name>wsil.browsing</name>
<description>Account for BI WS for SOA</description>
<adminonly>false</adminonly>
<credentialkey>weblogic</credentialkey>
</account>
</accounts>
<policies>
<policy>
<name>wss_username_token_policy</name>
<policyfile>wss_username_token_policy.xml</policyfile>
</policy>
</policies>
</obi-action-config>
Then i restarted bi server using domain_home/bitools/bin/stop.sh and start.sh. But its not working :(
Make sure that you have your biservicesconfig.xml in
/app/oracle/fmw12213/user_projects/domains/bi/config/fmwconfig/biinstances/coreapplication/
points to the same host:port as the file in ActionFrameworkConfig.xml. Also has the ending /analytics-ws/saw.dll
For me, that looked like this:
<server>http://localhost:7033/analytics-ws/saw.dll</server>

Identify all xml files with specific format

I am trying to find xmls which are not having valid data and not process them. For example , below is a correct xml with all the data available which needs to be processes
(Loop Xpath used to read the data from xml files- Invoicing/Invoice/Serials/SerialNumber):
<?xml version='1.0' encoding='UTF-8'?>
<Invoicing>
<Invoice>
<VendorName>Contec</VendorName>
<InvoicePeriod>May</InvoicePeriod>
<InvoiceDt>2019-05-11</InvoiceDt>
<InvoiceNo>20190511</InvoiceNo>
<Serials>
<SerialNumber>
<TestLoc>HNMA01</TestLoc>
<EISSerial>PKQPLPXJC</EISSerial>
<ComcastModel>PX022ANC</ComcastModel>
<RMANo />
<ReceiptDt>05/09/2019</ReceiptDt>
<RepairDt>05/11/2019</RepairDt>
<Parts>
<Part>
<PartType>Cosmetic</PartType>
<PartId>SERVICEBUFFING</PartId>
<PartDescr>BUFF SERVC</PartDescr>
<ActionCd>RA003</ActionCd>
<FSC>FS005</FSC>
</Part>
</Parts>
</SerialNumber>
</Serials>
</Invoice>
</Invoicing>
I also get XML which are in below format,
<?xml version="1.0" encoding="UTF-8"?>
<Invoicing>
<Invoice>
<VendorName>Contec</VendorName>
<InvoicePeriod>May</InvoicePeriod>
<InvoiceDt>2017-05-01</InvoiceDt>
<InvoiceNo>20170501</InvoiceNo>
<Serials></Serials>
</Invoice>
</Invoicing>
The above xml , even though being valid is not correct..I want to identify the xmls which are in the second format without the complete data and move them into a error folder.
Thanks,
Kavin
Solution to this question is as follows :
I was able to achieve what i wanted with the solution provided by #EdMorton.
grep -L '<SerialNumber>' *.xml
But i wanted to get this done using a xml parser.
count=$(xmllint --xpath "count(//SerialNumber)" "$xml")
When the count is zero i have implemented my logic.
Thanks for all the help.

Ruby Regexp matches the data from the previous xml tag

My log file is like this,
2015-04-10 19:10:39,688 INFO [abc] Reqt [283183]: <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Data>..<Name>EVENT_1</Name>..</Data>
2015-04-10 19:10:39,688 INFO [abc] Req [283184]: <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Data>..<Name>MY_EVENT</Name>..</Data>
Regex what i have written is,
pFile = File.read("C:/logs/pdata.log")
Regex = /<Data>(.*?)MY_EVENT(.*?)<\/Data>/m
pData = pFile.match(Regex).to_s
"MY_EVENT" might come in the first xml tag or second xml tag or even at last based on the scenario.
If it comes in first tag, regex works fine and if it comes in second tag, it matches from the first and my output is like,
<Data>..<Name>EVENT_1</Name>..</Data>
2015-04-10 19:10:39,688 INFO [abc] Req [283184]: <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Data>..<Name>MY_EVENT</Name>..</Data>
I need to extract only one xml tag which has MY_EVENT.
Please help me out on this! Thanks in advance
Try this.
pData.match(/<Data>((?!<Data>).)*?MY_EVENT((?!<Data>).)*?<\/Data>/m)
I assume that all <Data> elements never contain another <Data> as its child element.

LIQUIBASE: How to install liquibase. I'm having an error with the batch file I created

here is the error saying liquibase is not recognized as an internal/external
command in cmd
http://animobile.info/upload/1/error.bmp
lb_update.bat code1:
#echo off call Liquibase --changeLogFile=update.xml
update.xml coode:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<databaseChangeLog xmlns="http://www.Liquibase.org/xml/ns/dbchangelog/1.9"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.Liquibase.org/xml/ns/dbchangelog/1.9 http://www.Liquibase.org/xml/ns/dbchangelog/dbchangelog-1.9.xsd">
<include file="v000/master.xml" />
</databaseChangeLog>
master.xml code:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<databaseChangeLog xmlns="http://www.Liquibase.org/xml/ns/dbchangelog/1.9"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.Liquibase.org/xml/ns/dbchangelog/1.9 http://www.Liquibase.org/xml/ns/dbchangelog/dbchangelog-1.9.xsd">
<preConditions>
<!-- These changes should only be run against a schema with major version 0 -->
<sqlCheck expectedResult="0">
SELECT NVL(MAX(id),0)
FROM databasechangelog
WHERE author='MajorVersion '
</sqlCheck>
</preConditions >
<include file="v000/2009-10-15-73.xml" />
</databaseChangeLog>
The expected result when the lb_update.bat is executed, a confirmation message will appear saying: Migration successful.
How can i fix this please help! Thank you!
Since you have not mentioned the full path of Liquibase.bat file, it will be searched in the current directory which is D:\Projects\lbdemo\trunk in your case. Looks like Liquibase.bat file doesn't exist at the Location D:\Projects\lbdemo\trunk.

Savon ruby gem adds ins0 to tags

Using the savon gem, I get the following request XML:
<?xml version="1.0" encoding="UTF-8"?>
<soap:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:wsdl="URL"
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:ins0="SOME URL">
<soap:Body>
<ins0:Test xmlns="SOME URL">
</ins0:Test>
</soap:Body>
</soap:Envelope>
But it needs to be this instead:
<?xml version="1.0" encoding="UTF-8"?>
<soap:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:wsdl="URL"
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<Test xmlns="SOME URL">
</Test>
</soap:Body>
</soap:Envelope>
Notice ins0 was removed.
Any suggestions?
The two XML documents are equivalent, so there should be no issues as long as the document is parsed by an XML compliant agent.
The Savon generated document is simply creating a namespace prefix of ins0 for the "SOME URL" namespace. This is convenient for a large SOAP document with many elements from that namespace. In this example, the prefix is not really necessary.
The only potential issue I can see is that the Savion generated document seems to declare the ins0 namespace twice - once in the soap:Envelope and then again in the soap:Body. Seems superfluous and potentially open to error.

Resources