Remote access through SSH


(Chia-Eng Chang) #1

About the HTTP API, I wonder if I want to remote access a cluster on SSH
server, what should I include in my http rest command:

example as mapping:

curl -XGET ' http://localhost:9200/ index /_mapping/ type ' 

I tried something like below but got failed:

curl -XGET -u user_name: --key ~/.ssh/id_rsa --pubkey ~/.ssh/id_rsa.pub  'xx.xxx.xxx.xxx:9200/index/_mapping/type'

Is there anyone knows the solution?

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/31b4e835-8ebb-4dc7-bc2b-c8fa09414f12%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


(Mark Walkom) #2

You need to use SSH directly for it, curl won't work.

ssh user@host -i ~/.ssh/id_rsa.pub

Assuming you have a public key on the server.

Regards,
Mark Walkom

Infrastructure Engineer
Campaign Monitor
email: markw@campaignmonitor.com
web: www.campaignmonitor.com

On 31 July 2014 08:47, Chia-Eng Chang chiaengc@uci.edu wrote:

About the HTTP API, I wonder if I want to remote access a cluster on SSH
server, what should I include in my http rest command:

example as mapping:

curl -XGET ' http://localhost:9200/ index /_mapping/ type '

I tried something like below but got failed:

curl -XGET -u user_name: --key ~/.ssh/id_rsa --pubkey ~/.ssh/id_rsa.pub  'xx.xxx.xxx.xxx:9200/index/_mapping/type'

Is there anyone knows the solution?

--
You received this message because you are subscribed to the Google Groups
"elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/31b4e835-8ebb-4dc7-bc2b-c8fa09414f12%40googlegroups.com
https://groups.google.com/d/msgid/elasticsearch/31b4e835-8ebb-4dc7-bc2b-c8fa09414f12%40googlegroups.com?utm_medium=email&utm_source=footer
.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/CAEM624YMcO4oP74SUAPwQFDpa8cZsVqNwMWGNg%3DcJGU2qkwQSw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


(Chia-Eng Chang) #3

Thanks @Mark
I have a public key on server and I know how to SSH to server then get the
index from localhost:9200.
But what I want to do is remotely obtain the index on the SSH server (which
I know its public IP)

On Wednesday, July 30, 2014 3:56:04 PM UTC-7, Mark Walkom wrote:

You need to use SSH directly for it, curl won't work.

ssh user@host -i ~/.ssh/id_rsa.pub

Assuming you have a public key on the server.

Regards,
Mark Walkom

Infrastructure Engineer
Campaign Monitor
email: ma...@campaignmonitor.com <javascript:>
web: www.campaignmonitor.com

On 31 July 2014 08:47, Chia-Eng Chang <chia...@uci.edu <javascript:>>
wrote:

About the HTTP API, I wonder if I want to remote access a cluster on SSH
server, what should I include in my http rest command:

example as mapping:

curl -XGET ' http://localhost:9200/ index /_mapping/ type ' 

I tried something like below but got failed:

curl -XGET -u user_name: --key ~/.ssh/id_rsa --pubkey ~/.ssh/id_rsa.pub  'xx.xxx.xxx.xxx:9200/index/_mapping/type'

Is there anyone knows the solution?

--
You received this message because you are subscribed to the Google Groups
"elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to elasticsearc...@googlegroups.com <javascript:>.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/31b4e835-8ebb-4dc7-bc2b-c8fa09414f12%40googlegroups.com
https://groups.google.com/d/msgid/elasticsearch/31b4e835-8ebb-4dc7-bc2b-c8fa09414f12%40googlegroups.com?utm_medium=email&utm_source=footer
.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/d6404d32-6b0f-4670-8626-f38b1284809d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


(Mark Walkom) #4

You may want to look at
http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search.html

If you are just learning ES, then check out
http://exploringelasticsearch.com/

Regards,
Mark Walkom

Infrastructure Engineer
Campaign Monitor
email: markw@campaignmonitor.com
web: www.campaignmonitor.com

On 31 July 2014 09:35, Chia-Eng Chang chiaengc@uci.edu wrote:

Thanks @Mark
I have a public key on server and I know how to SSH to server then get the
index from localhost:9200.
But what I want to do is remotely obtain the index on the SSH server
(which I know its public IP)

On Wednesday, July 30, 2014 3:56:04 PM UTC-7, Mark Walkom wrote:

You need to use SSH directly for it, curl won't work.

ssh user@host -i ~/.ssh/id_rsa.pub

Assuming you have a public key on the server.

Regards,
Mark Walkom

Infrastructure Engineer
Campaign Monitor
email: ma...@campaignmonitor.com
web: www.campaignmonitor.com

On 31 July 2014 08:47, Chia-Eng Chang chia...@uci.edu wrote:

About the HTTP API, I wonder if I want to remote access a cluster on
SSH server, what should I include in my http rest command:

example as mapping:

curl -XGET ' http://localhost:9200/ index /_mapping/ type '

I tried something like below but got failed:

curl -XGET -u user_name: --key ~/.ssh/id_rsa --pubkey ~/.ssh/id_rsa.pub  'xx.xxx.xxx.xxx:9200/index/_mapping/type'

Is there anyone knows the solution?

--
You received this message because you are subscribed to the Google
Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send
an email to elasticsearc...@googlegroups.com.

To view this discussion on the web visit https://groups.google.com/d/
msgid/elasticsearch/31b4e835-8ebb-4dc7-bc2b-c8fa09414f12%
40googlegroups.com
https://groups.google.com/d/msgid/elasticsearch/31b4e835-8ebb-4dc7-bc2b-c8fa09414f12%40googlegroups.com?utm_medium=email&utm_source=footer
.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups
"elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/d6404d32-6b0f-4670-8626-f38b1284809d%40googlegroups.com
https://groups.google.com/d/msgid/elasticsearch/d6404d32-6b0f-4670-8626-f38b1284809d%40googlegroups.com?utm_medium=email&utm_source=footer
.

For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/CAEM624Z%2B3wOyb%2BEQFyQvrfiGA-9e%2BwEc1M7AA1QcfM0CbJCdCg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


(Chia-Eng Chang) #5

Thank you for the links. Yeah, I am new to ES. (and http rest)
What I understand is that if I want to get the index documents on my SSH
server, I can SSH log in the server.
And then rest http get from localhost:9200.

Could you explain more about "use SSH directly for it"?
I think what I want to do is close to this transport client example
http://www.elasticsearch.org/guide/en/elasticsearch/client/java-api/current/client.html#transport-client

But I have to provide ssh credential.

On Wednesday, July 30, 2014 4:47:22 PM UTC-7, Mark Walkom wrote:

You may want to look at
http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search.html

If you are just learning ES, then check out
http://exploringelasticsearch.com/

Regards,
Mark Walkom

Infrastructure Engineer
Campaign Monitor
email: ma...@campaignmonitor.com <javascript:>
web: www.campaignmonitor.com

On 31 July 2014 09:35, Chia-Eng Chang <chia...@uci.edu <javascript:>>
wrote:

Thanks @Mark
I have a public key on server and I know how to SSH to server then get
the index from localhost:9200.
But what I want to do is remotely obtain the index on the SSH server
(which I know its public IP)

On Wednesday, July 30, 2014 3:56:04 PM UTC-7, Mark Walkom wrote:

You need to use SSH directly for it, curl won't work.

ssh user@host -i ~/.ssh/id_rsa.pub

Assuming you have a public key on the server.

Regards,
Mark Walkom

Infrastructure Engineer
Campaign Monitor
email: ma...@campaignmonitor.com
web: www.campaignmonitor.com

On 31 July 2014 08:47, Chia-Eng Chang chia...@uci.edu wrote:

About the HTTP API, I wonder if I want to remote access a cluster on
SSH server, what should I include in my http rest command:

example as mapping:

curl -XGET ' http://localhost:9200/ index /_mapping/ type ' 

I tried something like below but got failed:

curl -XGET -u user_name: --key ~/.ssh/id_rsa --pubkey ~/.ssh/id_rsa.pub  'xx.xxx.xxx.xxx:9200/index/_mapping/type'

Is there anyone knows the solution?

--
You received this message because you are subscribed to the Google
Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send
an email to elasticsearc...@googlegroups.com.

To view this discussion on the web visit https://groups.google.com/d/
msgid/elasticsearch/31b4e835-8ebb-4dc7-bc2b-c8fa09414f12%
40googlegroups.com
https://groups.google.com/d/msgid/elasticsearch/31b4e835-8ebb-4dc7-bc2b-c8fa09414f12%40googlegroups.com?utm_medium=email&utm_source=footer
.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups
"elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to elasticsearc...@googlegroups.com <javascript:>.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/d6404d32-6b0f-4670-8626-f38b1284809d%40googlegroups.com
https://groups.google.com/d/msgid/elasticsearch/d6404d32-6b0f-4670-8626-f38b1284809d%40googlegroups.com?utm_medium=email&utm_source=footer
.

For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/3d1ad9da-e964-482b-89ac-75ad35b68227%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


(Mark Walkom) #6

You can also curl from your local machine to the server, without having to
SSH to it - curl -XGET http://IPADDRESS:9200/....

You don't need to provide SSH credentials for that transport client example.

Regards,
Mark Walkom

Infrastructure Engineer
Campaign Monitor
email: markw@campaignmonitor.com
web: www.campaignmonitor.com

On 31 July 2014 10:35, Chia-Eng Chang chiaengc@uci.edu wrote:

Thank you for the links. Yeah, I am new to ES. (and http rest)
What I understand is that if I want to get the index documents on my SSH
server, I can SSH log in the server.
And then rest http get from localhost:9200.

Could you explain more about "use SSH directly for it"?
I think what I want to do is close to this transport client example
http://www.elasticsearch.org/guide/en/elasticsearch/client/java-api/current/client.html#transport-client

But I have to provide ssh credential.

On Wednesday, July 30, 2014 4:47:22 PM UTC-7, Mark Walkom wrote:

You may want to look at http://www.elasticsearch.
org/guide/en/elasticsearch/reference/current/search.html

If you are just learning ES, then check out http://
exploringelasticsearch.com/

Regards,
Mark Walkom

Infrastructure Engineer
Campaign Monitor
email: ma...@campaignmonitor.com
web: www.campaignmonitor.com

On 31 July 2014 09:35, Chia-Eng Chang chia...@uci.edu wrote:

Thanks @Mark
I have a public key on server and I know how to SSH to server then get
the index from localhost:9200.
But what I want to do is remotely obtain the index on the SSH server
(which I know its public IP)

On Wednesday, July 30, 2014 3:56:04 PM UTC-7, Mark Walkom wrote:

You need to use SSH directly for it, curl won't work.

ssh user@host -i ~/.ssh/id_rsa.pub

Assuming you have a public key on the server.

Regards,
Mark Walkom

Infrastructure Engineer
Campaign Monitor
email: ma...@campaignmonitor.com
web: www.campaignmonitor.com

On 31 July 2014 08:47, Chia-Eng Chang chia...@uci.edu wrote:

About the HTTP API, I wonder if I want to remote access a cluster on
SSH server, what should I include in my http rest command:

example as mapping:

curl -XGET ' http://localhost:9200/ index /_mapping/ type '

I tried something like below but got failed:

curl -XGET -u user_name: --key ~/.ssh/id_rsa --pubkey ~/.ssh/id_rsa.pub  'xx.xxx.xxx.xxx:9200/index/_mapping/type'

Is there anyone knows the solution?

--
You received this message because you are subscribed to the Google
Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send
an email to elasticsearc...@googlegroups.com.

To view this discussion on the web visit https://groups.google.com/d/
msgid/elasticsearch/31b4e835-8ebb-4dc7-bc2b-c8fa09414f12%40goo
glegroups.com
https://groups.google.com/d/msgid/elasticsearch/31b4e835-8ebb-4dc7-bc2b-c8fa09414f12%40googlegroups.com?utm_medium=email&utm_source=footer
.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google
Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send
an email to elasticsearc...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/
msgid/elasticsearch/d6404d32-6b0f-4670-8626-f38b1284809d%
40googlegroups.com
https://groups.google.com/d/msgid/elasticsearch/d6404d32-6b0f-4670-8626-f38b1284809d%40googlegroups.com?utm_medium=email&utm_source=footer
.

For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups
"elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/3d1ad9da-e964-482b-89ac-75ad35b68227%40googlegroups.com
https://groups.google.com/d/msgid/elasticsearch/3d1ad9da-e964-482b-89ac-75ad35b68227%40googlegroups.com?utm_medium=email&utm_source=footer
.

For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/CAEM624a%2B4ZZeQvjz9sD1xgxqu_BP%3Db3WJt8PozqPw9hNpNteLw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


(Chia-Eng Chang) #7

I tried curl -XGET http://IPADDRESS:9200/.. http://IPADDRESS:9200/.. but
it failed.
Actually I cant even telnet port 9200 on my machine.
My guess is that elasticsearch port 9200 is hidden behind ssh port 22.

So I use ssh tunnel forwarding port 9200 on the server to my machine.
Like :

ssh -L:: user@

Then I can simply apply curl -get localhost:9200 to query elasticsearch on my cloud server.
The java api transpot client might need the same setting to make it work.

On Wednesday, July 30, 2014 5:48:28 PM UTC-7, Mark Walkom wrote:

You can also curl from your local machine to the server, without having to
SSH to it - curl -XGET http://IPADDRESS:9200/....

You don't need to provide SSH credentials for that transport client
example.

Regards,
Mark Walkom

Infrastructure Engineer
Campaign Monitor
email: ma...@campaignmonitor.com <javascript:>
web: www.campaignmonitor.com

On 31 July 2014 10:35, Chia-Eng Chang <chia...@uci.edu <javascript:>>
wrote:

Thank you for the links. Yeah, I am new to ES. (and http rest)
What I understand is that if I want to get the index documents on my SSH
server, I can SSH log in the server.
And then rest http get from localhost:9200.

Could you explain more about "use SSH directly for it"?
I think what I want to do is close to this transport client example
http://www.elasticsearch.org/guide/en/elasticsearch/client/java-api/current/client.html#transport-client

But I have to provide ssh credential.

On Wednesday, July 30, 2014 4:47:22 PM UTC-7, Mark Walkom wrote:

You may want to look at http://www.elasticsearch.
org/guide/en/elasticsearch/reference/current/search.html

If you are just learning ES, then check out http://
exploringelasticsearch.com/

Regards,
Mark Walkom

Infrastructure Engineer
Campaign Monitor
email: ma...@campaignmonitor.com
web: www.campaignmonitor.com

On 31 July 2014 09:35, Chia-Eng Chang chia...@uci.edu wrote:

Thanks @Mark
I have a public key on server and I know how to SSH to server then get
the index from localhost:9200.
But what I want to do is remotely obtain the index on the SSH server
(which I know its public IP)

On Wednesday, July 30, 2014 3:56:04 PM UTC-7, Mark Walkom wrote:

You need to use SSH directly for it, curl won't work.

ssh user@host -i ~/.ssh/id_rsa.pub

Assuming you have a public key on the server.

Regards,
Mark Walkom

Infrastructure Engineer
Campaign Monitor
email: ma...@campaignmonitor.com
web: www.campaignmonitor.com

On 31 July 2014 08:47, Chia-Eng Chang chia...@uci.edu wrote:

About the HTTP API, I wonder if I want to remote access a cluster
on SSH server, what should I include in my http rest command:

example as mapping:

curl -XGET ' http://localhost:9200/ index /_mapping/ type ' 

I tried something like below but got failed:

curl -XGET -u user_name: --key ~/.ssh/id_rsa --pubkey ~/.ssh/id_rsa.pub  'xx.xxx.xxx.xxx:9200/index/_mapping/type'

Is there anyone knows the solution?

--
You received this message because you are subscribed to the Google
Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it,
send an email to elasticsearc...@googlegroups.com.

To view this discussion on the web visit https://groups.google.com/d/
msgid/elasticsearch/31b4e835-8ebb-4dc7-bc2b-c8fa09414f12%40goo
glegroups.com
https://groups.google.com/d/msgid/elasticsearch/31b4e835-8ebb-4dc7-bc2b-c8fa09414f12%40googlegroups.com?utm_medium=email&utm_source=footer
.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google
Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send
an email to elasticsearc...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/
msgid/elasticsearch/d6404d32-6b0f-4670-8626-f38b1284809d%
40googlegroups.com
https://groups.google.com/d/msgid/elasticsearch/d6404d32-6b0f-4670-8626-f38b1284809d%40googlegroups.com?utm_medium=email&utm_source=footer
.

For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups
"elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to elasticsearc...@googlegroups.com <javascript:>.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/3d1ad9da-e964-482b-89ac-75ad35b68227%40googlegroups.com
https://groups.google.com/d/msgid/elasticsearch/3d1ad9da-e964-482b-89ac-75ad35b68227%40googlegroups.com?utm_medium=email&utm_source=footer
.

For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/06704857-de0d-493f-b8fb-ffce6a258b09%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


(Patrick Proniewski) #8

Hi,

Looks like your problem is not related to ES. It's a networking problem. You ES server appears to live behind a firewall (or is bind to 127.0.0.1 only), and your only way to contact it is to create an ssh tunnel to the server and to pipe your queries into this tunnel so that you can get in touch with the ES process.

You might want to get in touch with your hosting provider. Also, if you can run a web server (apache, nginx...) on your server, you might want to configure a proxy in this web server, so that requests sent to a particular URL will be redirected to the ES process. You would have something like this:

client ----> (public IP, port 80 or 443) http-server -> (localhost port 9200) ES process

It allows you to add some kind of access control to the ES process by using access control directives from Apache or Nginx.

On 31 juil. 2014, at 23:47, Chia-Eng Chang wrote:

I tried curl -XGET http://IPADDRESS:9200/.... but it failed.
Actually I cant even telnet port 9200 on my machine.
My guess is that elasticsearch port 9200 is hidden behind ssh port 22.

So I use ssh tunnel forwarding port 9200 on the server to my machine.
Like :
ssh -L:: user@

Then I can simply apply curl -get localhost:9200 to query elasticsearch on my cloud server.
The java api transpot client might need the same setting to make it work.

On Wednesday, July 30, 2014 5:48:28 PM UTC-7, Mark Walkom wrote:
You can also curl from your local machine to the server, without having to SSH to it - curl -XGET http://IPADDRESS:9200/....

You don't need to provide SSH credentials for that transport client example.

Regards,
Mark Walkom

Infrastructure Engineer
Campaign Monitor
email: ma...@campaignmonitor.com
web: www.campaignmonitor.com

On 31 July 2014 10:35, Chia-Eng Chang chia...@uci.edu wrote:
Thank you for the links. Yeah, I am new to ES. (and http rest)
What I understand is that if I want to get the index documents on my SSH server, I can SSH log in the server.
And then rest http get from localhost:9200.

Could you explain more about "use SSH directly for it"?
I think what I want to do is close to this transport client example
But I have to provide ssh credential.

On Wednesday, July 30, 2014 4:47:22 PM UTC-7, Mark Walkom wrote:
You may want to look at http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search.html

If you are just learning ES, then check out http://exploringelasticsearch.com/

Regards,
Mark Walkom

Infrastructure Engineer
Campaign Monitor
email: ma...@campaignmonitor.com
web: www.campaignmonitor.com

On 31 July 2014 09:35, Chia-Eng Chang chia...@uci.edu wrote:
Thanks @Mark
I have a public key on server and I know how to SSH to server then get the index from localhost:9200.
But what I want to do is remotely obtain the index on the SSH server (which I know its public IP)

On Wednesday, July 30, 2014 3:56:04 PM UTC-7, Mark Walkom wrote:
You need to use SSH directly for it, curl won't work.

ssh user@host -i ~/.ssh/id_rsa.pub

Assuming you have a public key on the server.

Regards,
Mark Walkom

Infrastructure Engineer
Campaign Monitor
email: ma...@campaignmonitor.com
web: www.campaignmonitor.com

On 31 July 2014 08:47, Chia-Eng Chang chia...@uci.edu wrote:
About the HTTP API, I wonder if I want to remote access a cluster on SSH server, what should I include in my http rest command:

example as mapping:

curl -XGET ' http://localhost:9200/

index /_mapping/ type '

I tried something like below but got failed:

curl -XGET -u user_name: --key ~/.ssh/id_rsa --pubkey ~/.ssh/id_rsa.pub  'xx.xxx.xxx.xxx:9200/index/_ma

pping/type'

Is there anyone knows the solution?

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearc...@googlegroups.com.

To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/31b4e835-8ebb-4dc7-bc2b-c8fa09414f12%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearc...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/d6404d32-6b0f-4670-8626-f38b1284809d%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearc...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/3d1ad9da-e964-482b-89ac-75ad35b68227%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/06704857-de0d-493f-b8fb-ffce6a258b09%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/9E8CA652-DEAB-41A2-920E-23EA3DC5F94F%40patpro.net.
For more options, visit https://groups.google.com/d/optout.


(error804) #9

Why dont you try

ssh -i ~/.ssh/id_rsa xx.xxx.xxx.xxx 'curl -XGET

localhost:9200/index/_mapping/type'

cheers

On Fri, Aug 1, 2014 at 3:43 AM, Patrick Proniewski <elasticsearch@patpro.net

wrote:

Hi,

Looks like your problem is not related to ES. It's a networking problem.
You ES server appears to live behind a firewall (or is bind to 127.0.0.1
only), and your only way to contact it is to create an ssh tunnel to the
server and to pipe your queries into this tunnel so that you can get in
touch with the ES process.

You might want to get in touch with your hosting provider. Also, if you
can run a web server (apache, nginx...) on your server, you might want to
configure a proxy in this web server, so that requests sent to a particular
URL will be redirected to the ES process. You would have something like
this:

client ----> (public IP, port 80 or 443) http-server -> (localhost port
9200) ES process

It allows you to add some kind of access control to the ES process by
using access control directives from Apache or Nginx.

On 31 juil. 2014, at 23:47, Chia-Eng Chang wrote:

I tried curl -XGET http://IPADDRESS:9200/.... but it failed.
Actually I cant even telnet port 9200 on my machine.
My guess is that elasticsearch port 9200 is hidden behind ssh port 22.

So I use ssh tunnel forwarding port 9200 on the server to my machine.
Like :
ssh -L:: user@

Then I can simply apply curl -get localhost:9200 to query elasticsearch
on my cloud server.
The java api transpot client might need the same setting to make it work.

On Wednesday, July 30, 2014 5:48:28 PM UTC-7, Mark Walkom wrote:
You can also curl from your local machine to the server, without having
to SSH to it - curl -XGET http://IPADDRESS:9200/....

You don't need to provide SSH credentials for that transport client
example.

Regards,
Mark Walkom

Infrastructure Engineer
Campaign Monitor
email: ma...@campaignmonitor.com
web: www.campaignmonitor.com

On 31 July 2014 10:35, Chia-Eng Chang chia...@uci.edu wrote:
Thank you for the links. Yeah, I am new to ES. (and http rest)
What I understand is that if I want to get the index documents on my SSH
server, I can SSH log in the server.
And then rest http get from localhost:9200.

Could you explain more about "use SSH directly for it"?
I think what I want to do is close to this transport client example
But I have to provide ssh credential.

On Wednesday, July 30, 2014 4:47:22 PM UTC-7, Mark Walkom wrote:
You may want to look at
http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search.html

If you are just learning ES, then check out
http://exploringelasticsearch.com/

Regards,
Mark Walkom

Infrastructure Engineer
Campaign Monitor
email: ma...@campaignmonitor.com
web: www.campaignmonitor.com

On 31 July 2014 09:35, Chia-Eng Chang chia...@uci.edu wrote:
Thanks @Mark
I have a public key on server and I know how to SSH to server then get
the index from localhost:9200.
But what I want to do is remotely obtain the index on the SSH server
(which I know its public IP)

On Wednesday, July 30, 2014 3:56:04 PM UTC-7, Mark Walkom wrote:
You need to use SSH directly for it, curl won't work.

ssh user@host -i ~/.ssh/id_rsa.pub

Assuming you have a public key on the server.

Regards,
Mark Walkom

Infrastructure Engineer
Campaign Monitor
email: ma...@campaignmonitor.com
web: www.campaignmonitor.com

On 31 July 2014 08:47, Chia-Eng Chang chia...@uci.edu wrote:
About the HTTP API, I wonder if I want to remote access a cluster on SSH
server, what should I include in my http rest command:

example as mapping:

curl -XGET ' http://localhost:9200/

index /_mapping/ type '

I tried something like below but got failed:

curl -XGET -u user_name: --key ~/.ssh/id_rsa --pubkey

~/.ssh/id_rsa.pub 'xx.xxx.xxx.xxx:9200/index/_ma

pping/type'

Is there anyone knows the solution?

--
You received this message because you are subscribed to the Google
Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send
an email to elasticsearc...@googlegroups.com.

To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/31b4e835-8ebb-4dc7-bc2b-c8fa09414f12%40googlegroups.com
.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google
Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send
an email to elasticsearc...@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/d6404d32-6b0f-4670-8626-f38b1284809d%40googlegroups.com
.

For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google
Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send
an email to elasticsearc...@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/3d1ad9da-e964-482b-89ac-75ad35b68227%40googlegroups.com
.

For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google
Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send
an email to elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/06704857-de0d-493f-b8fb-ffce6a258b09%40googlegroups.com
.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups
"elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/9E8CA652-DEAB-41A2-920E-23EA3DC5F94F%40patpro.net
.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/CAMUueYndb%2BRQhZmgu2xfMgk%3Dj5vUyyDc17OEmxYckNtgrtVuKA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


(system) #10