Remote access through SSH

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

Remote access through SSH

Chia-Eng Chang

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 [hidden email].
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.
Reply | Threaded
Open this post in threaded view
|

Re: Remote access through SSH

Mark Walkom
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: [hidden email]
web: www.campaignmonitor.com


On 31 July 2014 08:47, Chia-Eng Chang <[hidden email]> 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 [hidden email].
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 [hidden email].
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.
Reply | Threaded
Open this post in threaded view
|

Re: Remote access through SSH

Chia-Eng Chang
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: <a href="javascript:" target="_blank" gdf-obfuscated-mailto="R_VuZT8Xb00J" onmousedown="this.href='javascript:';return true;" onclick="this.href='javascript:';return true;">ma...@...
web: <a href="http://www.campaignmonitor.com" target="_blank" onmousedown="this.href='http://www.google.com/url?q\75http%3A%2F%2Fwww.campaignmonitor.com\46sa\75D\46sntz\0751\46usg\75AFQjCNFv30c-WBiP6sfBmxXaWBP5YBZg1Q';return true;" onclick="this.href='http://www.google.com/url?q\75http%3A%2F%2Fwww.campaignmonitor.com\46sa\75D\46sntz\0751\46usg\75AFQjCNFv30c-WBiP6sfBmxXaWBP5YBZg1Q';return true;">www.campaignmonitor.com


On 31 July 2014 08:47, Chia-Eng Chang <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="R_VuZT8Xb00J" onmousedown="this.href='javascript:';return true;" onclick="this.href='javascript:';return true;">chia...@...> 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 ' <a href="http://localhost:9200/" target="_blank" onmousedown="this.href='http://www.google.com/url?q\75http%3A%2F%2Flocalhost%3A9200%2F\46sa\75D\46sntz\0751\46usg\75AFQjCNFZm0uXsskbuhdXxWiFGnlSJ5lZFQ';return true;" onclick="this.href='http://www.google.com/url?q\75http%3A%2F%2Flocalhost%3A9200%2F\46sa\75D\46sntz\0751\46usg\75AFQjCNFZm0uXsskbuhdXxWiFGnlSJ5lZFQ';return true;">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 <a href="javascript:" target="_blank" gdf-obfuscated-mailto="R_VuZT8Xb00J" onmousedown="this.href='javascript:';return true;" onclick="this.href='javascript:';return true;">elasticsearc...@googlegroups.com.
To view this discussion on the web visit <a href="https://groups.google.com/d/msgid/elasticsearch/31b4e835-8ebb-4dc7-bc2b-c8fa09414f12%40googlegroups.com?utm_medium=email&amp;utm_source=footer" target="_blank" onmousedown="this.href='https://groups.google.com/d/msgid/elasticsearch/31b4e835-8ebb-4dc7-bc2b-c8fa09414f12%40googlegroups.com?utm_medium\75email\46utm_source\75footer';return true;" onclick="this.href='https://groups.google.com/d/msgid/elasticsearch/31b4e835-8ebb-4dc7-bc2b-c8fa09414f12%40googlegroups.com?utm_medium\75email\46utm_source\75footer';return true;">https://groups.google.com/d/msgid/elasticsearch/31b4e835-8ebb-4dc7-bc2b-c8fa09414f12%40googlegroups.com.
For more options, visit <a href="https://groups.google.com/d/optout" target="_blank" onmousedown="this.href='https://groups.google.com/d/optout';return true;" onclick="this.href='https://groups.google.com/d/optout';return true;">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 [hidden email].
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.
Reply | Threaded
Open this post in threaded view
|

Re: Remote access through SSH

Mark Walkom

Regards,
Mark Walkom

Infrastructure Engineer
Campaign Monitor
email: [hidden email]
web: www.campaignmonitor.com


On 31 July 2014 09:35, Chia-Eng Chang <[hidden email]> 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: [hidden email]
web: www.campaignmonitor.com


On 31 July 2014 08:47, Chia-Eng Chang <[hidden email]> 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.

--
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 [hidden email].
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 [hidden email].
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.
Reply | Threaded
Open this post in threaded view
|

Re: Remote access through SSH

Chia-Eng Chang
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 <a href="http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search.html" target="_blank" onmousedown="this.href='http://www.google.com/url?q\75http%3A%2F%2Fwww.elasticsearch.org%2Fguide%2Fen%2Felasticsearch%2Freference%2Fcurrent%2Fsearch.html\46sa\75D\46sntz\0751\46usg\75AFQjCNFGUAoOl0nD2cxrPTKNbYDwYt-16w';return true;" onclick="this.href='http://www.google.com/url?q\75http%3A%2F%2Fwww.elasticsearch.org%2Fguide%2Fen%2Felasticsearch%2Freference%2Fcurrent%2Fsearch.html\46sa\75D\46sntz\0751\46usg\75AFQjCNFGUAoOl0nD2cxrPTKNbYDwYt-16w';return true;">http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search.html

If you are just learning ES, then check out <a href="http://exploringelasticsearch.com/" target="_blank" onmousedown="this.href='http://www.google.com/url?q\75http%3A%2F%2Fexploringelasticsearch.com%2F\46sa\75D\46sntz\0751\46usg\75AFQjCNHRAj4tdSBNvKQ-1thdTamjeeTW2w';return true;" onclick="this.href='http://www.google.com/url?q\75http%3A%2F%2Fexploringelasticsearch.com%2F\46sa\75D\46sntz\0751\46usg\75AFQjCNHRAj4tdSBNvKQ-1thdTamjeeTW2w';return true;">http://exploringelasticsearch.com/

Regards,
Mark Walkom

Infrastructure Engineer
Campaign Monitor
email: <a href="javascript:" target="_blank" gdf-obfuscated-mailto="1-0bnPUhPw0J" onmousedown="this.href='javascript:';return true;" onclick="this.href='javascript:';return true;">ma...@...
web: <a href="http://www.campaignmonitor.com" target="_blank" onmousedown="this.href='http://www.google.com/url?q\75http%3A%2F%2Fwww.campaignmonitor.com\46sa\75D\46sntz\0751\46usg\75AFQjCNFv30c-WBiP6sfBmxXaWBP5YBZg1Q';return true;" onclick="this.href='http://www.google.com/url?q\75http%3A%2F%2Fwww.campaignmonitor.com\46sa\75D\46sntz\0751\46usg\75AFQjCNFv30c-WBiP6sfBmxXaWBP5YBZg1Q';return true;">www.campaignmonitor.com


On 31 July 2014 09:35, Chia-Eng Chang <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="1-0bnPUhPw0J" onmousedown="this.href='javascript:';return true;" onclick="this.href='javascript:';return true;">chia...@...> 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: [hidden email]
web: <a href="http://www.campaignmonitor.com" target="_blank" onmousedown="this.href='http://www.google.com/url?q\75http%3A%2F%2Fwww.campaignmonitor.com\46sa\75D\46sntz\0751\46usg\75AFQjCNFv30c-WBiP6sfBmxXaWBP5YBZg1Q';return true;" onclick="this.href='http://www.google.com/url?q\75http%3A%2F%2Fwww.campaignmonitor.com\46sa\75D\46sntz\0751\46usg\75AFQjCNFv30c-WBiP6sfBmxXaWBP5YBZg1Q';return true;">www.campaignmonitor.com


On 31 July 2014 08:47, Chia-Eng Chang <[hidden email]> 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 ' <a href="http://localhost:9200/" target="_blank" onmousedown="this.href='http://www.google.com/url?q\75http%3A%2F%2Flocalhost%3A9200%2F\46sa\75D\46sntz\0751\46usg\75AFQjCNFZm0uXsskbuhdXxWiFGnlSJ5lZFQ';return true;" onclick="this.href='http://www.google.com/url?q\75http%3A%2F%2Flocalhost%3A9200%2F\46sa\75D\46sntz\0751\46usg\75AFQjCNFZm0uXsskbuhdXxWiFGnlSJ5lZFQ';return true;">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 <a href="https://groups.google.com/d/msgid/elasticsearch/31b4e835-8ebb-4dc7-bc2b-c8fa09414f12%40googlegroups.com?utm_medium=email&amp;utm_source=footer" target="_blank" onmousedown="this.href='https://groups.google.com/d/msgid/elasticsearch/31b4e835-8ebb-4dc7-bc2b-c8fa09414f12%40googlegroups.com?utm_medium\75email\46utm_source\75footer';return true;" onclick="this.href='https://groups.google.com/d/msgid/elasticsearch/31b4e835-8ebb-4dc7-bc2b-c8fa09414f12%40googlegroups.com?utm_medium\75email\46utm_source\75footer';return true;">https://groups.google.com/d/msgid/elasticsearch/31b4e835-8ebb-4dc7-bc2b-c8fa09414f12%40googlegroups.com.
For more options, visit <a href="https://groups.google.com/d/optout" target="_blank" onmousedown="this.href='https://groups.google.com/d/optout';return true;" onclick="this.href='https://groups.google.com/d/optout';return true;">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 <a href="javascript:" target="_blank" gdf-obfuscated-mailto="1-0bnPUhPw0J" onmousedown="this.href='javascript:';return true;" onclick="this.href='javascript:';return true;">elasticsearc...@googlegroups.com.
To view this discussion on the web visit <a href="https://groups.google.com/d/msgid/elasticsearch/d6404d32-6b0f-4670-8626-f38b1284809d%40googlegroups.com?utm_medium=email&amp;utm_source=footer" target="_blank" onmousedown="this.href='https://groups.google.com/d/msgid/elasticsearch/d6404d32-6b0f-4670-8626-f38b1284809d%40googlegroups.com?utm_medium\75email\46utm_source\75footer';return true;" onclick="this.href='https://groups.google.com/d/msgid/elasticsearch/d6404d32-6b0f-4670-8626-f38b1284809d%40googlegroups.com?utm_medium\75email\46utm_source\75footer';return true;">https://groups.google.com/d/msgid/elasticsearch/d6404d32-6b0f-4670-8626-f38b1284809d%40googlegroups.com.

For more options, visit <a href="https://groups.google.com/d/optout" target="_blank" onmousedown="this.href='https://groups.google.com/d/optout';return true;" onclick="this.href='https://groups.google.com/d/optout';return true;">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 [hidden email].
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.
Reply | Threaded
Open this post in threaded view
|

Re: Remote access through SSH

Mark Walkom
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: [hidden email]
web: www.campaignmonitor.com


On 31 July 2014 10:35, Chia-Eng Chang <[hidden email]> 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:

Regards,
Mark Walkom

Infrastructure Engineer
Campaign Monitor
email: [hidden email]
web: www.campaignmonitor.com


On 31 July 2014 09:35, Chia-Eng Chang <[hidden email]> 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: [hidden email]
web: www.campaignmonitor.com


On 31 July 2014 08:47, Chia-Eng Chang <[hidden email]> 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.

--
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.

--
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 [hidden email].
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 [hidden email].
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.
Reply | Threaded
Open this post in threaded view
|

Re: Remote access through SSH

Chia-Eng Chang
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<my-port>:<target-machine>:<target-port> user@<target-machine>

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 <a href="http://IPADDRESS:9200/.." target="_blank" onmousedown="this.href='http://www.google.com/url?q\75http%3A%2F%2FIPADDRESS%3A9200%2F..\46sa\75D\46sntz\0751\46usg\75AFQjCNEP4Bx1ODPwHLfrBAWMhPKXN9URsA';return true;" onclick="this.href='http://www.google.com/url?q\75http%3A%2F%2FIPADDRESS%3A9200%2F..\46sa\75D\46sntz\0751\46usg\75AFQjCNEP4Bx1ODPwHLfrBAWMhPKXN9URsA';return true;">http://IPADDRESS:9200/....

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

Regards,
Mark Walkom

Infrastructure Engineer
Campaign Monitor
email: <a href="javascript:" target="_blank" gdf-obfuscated-mailto="ujxsoFlnzXkJ" onmousedown="this.href='javascript:';return true;" onclick="this.href='javascript:';return true;">ma...@...
web: <a href="http://www.campaignmonitor.com" target="_blank" onmousedown="this.href='http://www.google.com/url?q\75http%3A%2F%2Fwww.campaignmonitor.com\46sa\75D\46sntz\0751\46usg\75AFQjCNFv30c-WBiP6sfBmxXaWBP5YBZg1Q';return true;" onclick="this.href='http://www.google.com/url?q\75http%3A%2F%2Fwww.campaignmonitor.com\46sa\75D\46sntz\0751\46usg\75AFQjCNFv30c-WBiP6sfBmxXaWBP5YBZg1Q';return true;">www.campaignmonitor.com


On 31 July 2014 10:35, Chia-Eng Chang <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="ujxsoFlnzXkJ" onmousedown="this.href='javascript:';return true;" onclick="this.href='javascript:';return true;">chia...@...> 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 <a href="http://www.elasticsearch.org/guide/en/elasticsearch/client/java-api/current/client.html#transport-client" target="_blank" onmousedown="this.href='http://www.google.com/url?q\75http%3A%2F%2Fwww.elasticsearch.org%2Fguide%2Fen%2Felasticsearch%2Fclient%2Fjava-api%2Fcurrent%2Fclient.html%23transport-client\46sa\75D\46sntz\0751\46usg\75AFQjCNEmBgCWK_GwKdK_KkmnX5O-r9KrMg';return true;" onclick="this.href='http://www.google.com/url?q\75http%3A%2F%2Fwww.elasticsearch.org%2Fguide%2Fen%2Felasticsearch%2Fclient%2Fjava-api%2Fcurrent%2Fclient.html%23transport-client\46sa\75D\46sntz\0751\46usg\75AFQjCNEmBgCWK_GwKdK_KkmnX5O-r9KrMg';return true;">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 <a href="http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search.html" target="_blank" onmousedown="this.href='http://www.google.com/url?q\75http%3A%2F%2Fwww.elasticsearch.org%2Fguide%2Fen%2Felasticsearch%2Freference%2Fcurrent%2Fsearch.html\46sa\75D\46sntz\0751\46usg\75AFQjCNFGUAoOl0nD2cxrPTKNbYDwYt-16w';return true;" onclick="this.href='http://www.google.com/url?q\75http%3A%2F%2Fwww.elasticsearch.org%2Fguide%2Fen%2Felasticsearch%2Freference%2Fcurrent%2Fsearch.html\46sa\75D\46sntz\0751\46usg\75AFQjCNFGUAoOl0nD2cxrPTKNbYDwYt-16w';return true;">http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search.html

If you are just learning ES, then check out <a href="http://exploringelasticsearch.com/" target="_blank" onmousedown="this.href='http://www.google.com/url?q\75http%3A%2F%2Fexploringelasticsearch.com%2F\46sa\75D\46sntz\0751\46usg\75AFQjCNHRAj4tdSBNvKQ-1thdTamjeeTW2w';return true;" onclick="this.href='http://www.google.com/url?q\75http%3A%2F%2Fexploringelasticsearch.com%2F\46sa\75D\46sntz\0751\46usg\75AFQjCNHRAj4tdSBNvKQ-1thdTamjeeTW2w';return true;">http://exploringelasticsearch.com/

Regards,
Mark Walkom

Infrastructure Engineer
Campaign Monitor
email: [hidden email]
web: <a href="http://www.campaignmonitor.com" target="_blank" onmousedown="this.href='http://www.google.com/url?q\75http%3A%2F%2Fwww.campaignmonitor.com\46sa\75D\46sntz\0751\46usg\75AFQjCNFv30c-WBiP6sfBmxXaWBP5YBZg1Q';return true;" onclick="this.href='http://www.google.com/url?q\75http%3A%2F%2Fwww.campaignmonitor.com\46sa\75D\46sntz\0751\46usg\75AFQjCNFv30c-WBiP6sfBmxXaWBP5YBZg1Q';return true;">www.campaignmonitor.com


On 31 July 2014 09:35, Chia-Eng Chang <[hidden email]> 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: [hidden email]
web: <a href="http://www.campaignmonitor.com" target="_blank" onmousedown="this.href='http://www.google.com/url?q\75http%3A%2F%2Fwww.campaignmonitor.com\46sa\75D\46sntz\0751\46usg\75AFQjCNFv30c-WBiP6sfBmxXaWBP5YBZg1Q';return true;" onclick="this.href='http://www.google.com/url?q\75http%3A%2F%2Fwww.campaignmonitor.com\46sa\75D\46sntz\0751\46usg\75AFQjCNFv30c-WBiP6sfBmxXaWBP5YBZg1Q';return true;">www.campaignmonitor.com


On 31 July 2014 08:47, Chia-Eng Chang <[hidden email]> 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 ' <a href="http://localhost:9200/" target="_blank" onmousedown="this.href='http://www.google.com/url?q\75http%3A%2F%2Flocalhost%3A9200%2F\46sa\75D\46sntz\0751\46usg\75AFQjCNFZm0uXsskbuhdXxWiFGnlSJ5lZFQ';return true;" onclick="this.href='http://www.google.com/url?q\75http%3A%2F%2Flocalhost%3A9200%2F\46sa\75D\46sntz\0751\46usg\75AFQjCNFZm0uXsskbuhdXxWiFGnlSJ5lZFQ';return true;">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 <a href="https://groups.google.com/d/msgid/elasticsearch/31b4e835-8ebb-4dc7-bc2b-c8fa09414f12%40googlegroups.com?utm_medium=email&amp;utm_source=footer" target="_blank" onmousedown="this.href='https://groups.google.com/d/msgid/elasticsearch/31b4e835-8ebb-4dc7-bc2b-c8fa09414f12%40googlegroups.com?utm_medium\75email\46utm_source\75footer';return true;" onclick="this.href='https://groups.google.com/d/msgid/elasticsearch/31b4e835-8ebb-4dc7-bc2b-c8fa09414f12%40googlegroups.com?utm_medium\75email\46utm_source\75footer';return true;">https://groups.google.com/d/msgid/elasticsearch/31b4e835-8ebb-4dc7-bc2b-c8fa09414f12%40googlegroups.com.
For more options, visit <a href="https://groups.google.com/d/optout" target="_blank" onmousedown="this.href='https://groups.google.com/d/optout';return true;" onclick="this.href='https://groups.google.com/d/optout';return true;">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 <a href="https://groups.google.com/d/msgid/elasticsearch/d6404d32-6b0f-4670-8626-f38b1284809d%40googlegroups.com?utm_medium=email&amp;utm_source=footer" target="_blank" onmousedown="this.href='https://groups.google.com/d/msgid/elasticsearch/d6404d32-6b0f-4670-8626-f38b1284809d%40googlegroups.com?utm_medium\75email\46utm_source\75footer';return true;" onclick="this.href='https://groups.google.com/d/msgid/elasticsearch/d6404d32-6b0f-4670-8626-f38b1284809d%40googlegroups.com?utm_medium\75email\46utm_source\75footer';return true;">https://groups.google.com/d/msgid/elasticsearch/d6404d32-6b0f-4670-8626-f38b1284809d%40googlegroups.com.

For more options, visit <a href="https://groups.google.com/d/optout" target="_blank" onmousedown="this.href='https://groups.google.com/d/optout';return true;" onclick="this.href='https://groups.google.com/d/optout';return true;">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 <a href="javascript:" target="_blank" gdf-obfuscated-mailto="ujxsoFlnzXkJ" onmousedown="this.href='javascript:';return true;" onclick="this.href='javascript:';return true;">elasticsearc...@googlegroups.com.
To view this discussion on the web visit <a href="https://groups.google.com/d/msgid/elasticsearch/3d1ad9da-e964-482b-89ac-75ad35b68227%40googlegroups.com?utm_medium=email&amp;utm_source=footer" target="_blank" onmousedown="this.href='https://groups.google.com/d/msgid/elasticsearch/3d1ad9da-e964-482b-89ac-75ad35b68227%40googlegroups.com?utm_medium\75email\46utm_source\75footer';return true;" onclick="this.href='https://groups.google.com/d/msgid/elasticsearch/3d1ad9da-e964-482b-89ac-75ad35b68227%40googlegroups.com?utm_medium\75email\46utm_source\75footer';return true;">https://groups.google.com/d/msgid/elasticsearch/3d1ad9da-e964-482b-89ac-75ad35b68227%40googlegroups.com.

For more options, visit <a href="https://groups.google.com/d/optout" target="_blank" onmousedown="this.href='https://groups.google.com/d/optout';return true;" onclick="this.href='https://groups.google.com/d/optout';return true;">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 [hidden email].
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.
Reply | Threaded
Open this post in threaded view
|

Re: Remote access through SSH

Patrick Proniewski
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<my-port>:<target-machine>:<target-port> user@<target-machine>
>
> 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: [hidden email]
> web: www.campaignmonitor.com
>
>
> On 31 July 2014 10:35, Chia-Eng Chang <[hidden email]> 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: [hidden email]
> web: www.campaignmonitor.com
>
>
> On 31 July 2014 09:35, Chia-Eng Chang <[hidden email]> 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: [hidden email]
> web: www.campaignmonitor.com
>
>
> On 31 July 2014 08:47, Chia-Eng Chang <[hidden email]> 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 [hidden email].
>
> 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 [hidden email].
> 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 [hidden email].
> 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 [hidden email].
> 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 [hidden email].
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.
Reply | Threaded
Open this post in threaded view
|

Re: Remote access through SSH

error804
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 <[hidden email]> 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<my-port>:<target-machine>:<target-port> user@<target-machine>
>
> 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: [hidden email]
> web: www.campaignmonitor.com
>
>
> On 31 July 2014 10:35, Chia-Eng Chang <[hidden email]> 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: [hidden email]
> web: www.campaignmonitor.com
>
>
> On 31 July 2014 09:35, Chia-Eng Chang <[hidden email]> 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: [hidden email]
> web: www.campaignmonitor.com
>
>
> On 31 July 2014 08:47, Chia-Eng Chang <[hidden email]> 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 [hidden email].
>
> 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 [hidden email].
> 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 [hidden email].
> 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 [hidden email].
> 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 [hidden email].
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 [hidden email].
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.