Re: Checking my understanding of SOLR_HOME

2020-03-27 Thread Houston Putman
1. You are correct about the SOLR_HOST parameter.

2. Your SOLR_PORT variable should be 8983, as that's what solr will be
listening on. However you want to make sure to use port 8985 in the
solr.xml so that the node advertises itself as using that port in the
liveNodes.


  
${hostPort:8985}
  

With this setup you can pass in the external port as -DhostPort=<>


On Fri, Mar 27, 2020 at 1:17 PM Eric Pugh 
wrote:

> I am struggling with using the zkHost and the JDBC end point (
> https://lucene.apache.org/solr/guide/6_6/parallel-sql-interface.html#jdbc-driver)
> and I believe it’s because when I deploy, it gets a IP address that is
> internal to the network accessible, but accessible externally via DNS name:
>
> http://quepid-solr.dev.o19s.com:8985/solr/#/~cloud?view=tree
>
> I’m also using Docker, so the internal :8983 gets mapped to the external
> :8985 port.
>
> I *think* what I need to do is:
>
> 1) Use the SOLR_HOST parameter to make sure the hostname is “
> quepid-solr.dev.o19s.com” in my startup Script.
> 2) Set the environment variable SOLR_PORT to be 8985 instead of using the
> Docker mapping of ports.
>
> If this is correct understanding, then I think adding a bit more
> documentation to
> https://lucene.apache.org/solr/guide/8_4/taking-solr-to-production.html#solr-hostname
> would be useful, and happy to add a documentation PR as it’s not super
> clear to me.
>
> Eric
> ___
> Eric Pugh | Founder & CEO | OpenSource Connections, LLC | 434.466.1467 |
> http://www.opensourceconnections.com <
> http://www.opensourceconnections.com/> | My Free/Busy <
> http://tinyurl.com/eric-cal>
> Co-Author: Apache Solr Enterprise Search Server, 3rd Ed <
> https://www.packtpub.com/big-data-and-business-intelligence/apache-solr-enterprise-search-server-third-edition-raw>
>
> This e-mail and all contents, including attachments, is considered to be
> Company Confidential unless explicitly stated otherwise, regardless of
> whether attachments are marked as such.
>
>


Checking my understanding of SOLR_HOME

2020-03-27 Thread Eric Pugh
I am struggling with using the zkHost and the JDBC end point 
(https://lucene.apache.org/solr/guide/6_6/parallel-sql-interface.html#jdbc-driver)
 and I believe it’s because when I deploy, it gets a IP address that is 
internal to the network accessible, but accessible externally via DNS name:

http://quepid-solr.dev.o19s.com:8985/solr/#/~cloud?view=tree

I’m also using Docker, so the internal :8983 gets mapped to the external :8985 
port.   

I *think* what I need to do is:

1) Use the SOLR_HOST parameter to make sure the hostname is 
“quepid-solr.dev.o19s.com” in my startup Script.
2) Set the environment variable SOLR_PORT to be 8985 instead of using the 
Docker mapping of ports.

If this is correct understanding, then I think adding a bit more documentation 
to 
https://lucene.apache.org/solr/guide/8_4/taking-solr-to-production.html#solr-hostname
 would be useful, and happy to add a documentation PR as it’s not super clear 
to me.

Eric
___
Eric Pugh | Founder & CEO | OpenSource Connections, LLC | 434.466.1467 | 
http://www.opensourceconnections.com  | 
My Free/Busy   
Co-Author: Apache Solr Enterprise Search Server, 3rd Ed 


This e-mail and all contents, including attachments, is considered to be 
Company Confidential unless explicitly stated otherwise, regardless of whether 
attachments are marked as such.



Re: a new CLI tool bin/postlogs

2020-03-27 Thread Joel Bernstein
It looks like it's not finding any files. Here is the code thats failing:

https://github.com/apache/lucene-solr/blob/35d8e3de6d5931bfd6cba3221cfd0dca7f97c1a1/solr/core/src/java/org/apache/solr/util/SolrLogPostTool.java#L126

A couple of things to note:

postlogs should only be run on log files. So if there are different types
of files in the directory it's pointed to it will have unexpected behavior.
So you can run it on a single log file, or a directory containing only log
files.



Joel Bernstein
http://joelsolr.blogspot.com/


On Fri, Mar 27, 2020 at 5:18 AM Kayak28  wrote:

> Hello, Community:
>
> Thank you for releasing Solr 8.5.0, which contains several interesting
> tools.
>  Especially, bin/postlogs is interesting one.
> So, I have tried to run it on my computer (not-production use) as the
> following.
>
> bin/postlogs http://localhost:8983/solr/logs ./server/logs/solr
>
> The result ended in:
>
> SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
>
> SLF4J: Defaulting to no-operation (NOP) logger implementation
>
> SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further
> details.
>
> Exception in thread "main" java.lang.NullPointerException
>
> at
> org.apache.solr.util.SolrLogPostTool.gatherFiles(SolrLogPostTool.java:127)
>
> at org.apache.solr.util.SolrLogPostTool.main(SolrLogPostTool.java:65)
>
>
> Is there anything I have to do before running the postlogs command ?
>
> Sincerely,
> Kaya Ota
>
> --
>
> Sincerely,
> Kaya
> github: https://github.com/28kayak
>


a new CLI tool bin/postlogs

2020-03-27 Thread Kayak28
Hello, Community:

Thank you for releasing Solr 8.5.0, which contains several interesting
tools.
 Especially, bin/postlogs is interesting one.
So, I have tried to run it on my computer (not-production use) as the
following.

bin/postlogs http://localhost:8983/solr/logs ./server/logs/solr

The result ended in:

SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".

SLF4J: Defaulting to no-operation (NOP) logger implementation

SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further
details.

Exception in thread "main" java.lang.NullPointerException

at
org.apache.solr.util.SolrLogPostTool.gatherFiles(SolrLogPostTool.java:127)

at org.apache.solr.util.SolrLogPostTool.main(SolrLogPostTool.java:65)


Is there anything I have to do before running the postlogs command ?

Sincerely,
Kaya Ota

-- 

Sincerely,
Kaya
github: https://github.com/28kayak


Re: Apache Solr 8.4.1 Basic Authentication

2020-03-27 Thread Mike Phillips


The line webResource = client.resource(resourceUrl); defines what action 
I am performing example 
"https://localhost:8985/solr/CoreName/select?q=*%3A*;
Are you setting up your URL correctly. My snippet was outlining the 
additional Authorization header that needs to also be part of the 
request but assuming you were already going to a valid URL.


On 3/26/2020 3:59 PM, Altamirano, Emmanuel wrote:


Thank you so much for replying my email Mike.

I did use now the base64 to encode user and password but now Solr 
doesn’t undertint the credentials:


{Accept=[application/json], Content-Type=[application/json], 
*Authorization*=[Basic c29scjpTb2xyUm9ja3M=]}>] 
ERROR[org.springframework.web.client.HttpClientErrorException: 404 Not 
Found]


Before I got:

{Accept=[application/json], Content-Type=[application/json], 
*Authorization*=[Basic solr:SolrRocks]}>] 
ERROR[org.springframework.web.client.HttpClientErrorException: 401 
Invalid authentication token]


Is there something else that I need to configure?

*Emmanuel Altamirano,*

Consultant- Global Technology

International Operations

*Telephone:*312-985-3149

*Mobile:*312-860-3774

*cid:image001.png@01D02A68.19FA64F0*

555 W. Adams 5^th Floor

Chicago, IL 60661

_transunion.com ___

This email including, without limitation, the attachments, if any, 
accompanying this email, may contain information which is confidential 
or privileged and exempt from disclosure under applicable law. The 
information is for the use of the intended recipient. If you are not 
the intended recipient, be aware that any disclosure, copying, 
distribution, review or use of the contents of this email, and/or its 
attachments, is without authorization and is prohibited. If you have 
received this email in error, please notify us by reply email 
immediately and destroy all copies of this email and its attachments.


*From:* Mike Phillips 
*Sent:* Thursday, March 26, 2020 3:10 PM
*To:* Altamirano, Emmanuel 
*Subject:* Re: Apache Solr 8.4.1 Basic Authentication

*EXTERNAL SENDER:* Exercise caution with links and attachments.

I use Jersey to talk to solr. Here is a code snippet. You seem to be 
on the right track but you need to base64 encode the username/password 
bytes.


    String combined = username + ":" + password;
    String  encoded = base64.encode(combined.getBytes());
    String  authHeader = "Basic " + encoded;

    // Setup need to encode the query
    webResource = client.resource(resourceUrl);
    webResource.accept("*.*");

    // Perform request
    response = webResource.header("Content-Type", "application/json")
    .header("Authorization", authHeader)
    .get(ClientResponse.class);
    respStatus = response.getStatus();

On 3/26/2020 12:27 PM, Altamirano, Emmanuel wrote:

Hello everyone,

We recently enable Solr Basic Authentication in our Dev
environment and we are testing Solr security. We followed the
instructions provided in the Apache Solr website and it is working
using curl command.

If you could provide us any advice of how do we need to send the
credentials in the HTTP headers in a Java program? It is very
appreciate it.

HttpHeaders headers= *new*HttpHeaders();

headers.setAccept(Arrays./asList/(MediaType.*/APPLICATION_JSON/*));

headers.setContentType(MediaType.*/APPLICATION_JSON/*);

headers.add("Authorization", "Basic "+ "solr:SolrRocks");

Thanks,

*Emmanuel Altamirano,*

Consultant- Global Technology

International Operations

*Telephone:*312-985-3149

*Mobile:*312-860-3774

*cid:image001.png@01D02A68.19FA64F0*

555 W. Adams 5^th Floor

Chicago, IL 60661

_transunion.com _

This email including, without limitation, the attachments, if any,
accompanying this email, may contain information which is
confidential or privileged and exempt from disclosure under
applicable law. The information is for the use of the intended
recipient. If you are not the intended recipient, be aware that
any disclosure, copying, distribution, review or use of the
contents of this email, and/or its attachments, is without
authorization and is prohibited. If you have received this email
in error, please notify us by reply email immediately and destroy
all copies of this email and its attachments.