I am trying to connect redshift from my local windows putty instance. After creating Redshift instance , it is generated leader and compute node ip address.
Question is
which node role i need to pick ? Compute / Leader
for those which ip address i need to pick ? private / public
How to add public SSH key into my local putty?
You cannot SSH into a Redshift cluster since Redshift is a fully managed data warehouse service. All cluster administration is done by the Redshift service.
To connect to the Redshift database from the command line you use psql. This is installed as part of a Postgres installation. Any version of Postgres or psql later than 8.0 should work.
Alternatively you can connect using any SQL tool that support JDBC or ODBC.
You would normally connect to the Endpoint address but, if needed, you can also connect to the Leader node IP address.
psql -h my-cluster-name.ahashvalue.us-west-2.redshift.amazonaws.com -p 5439 -d mydatabasename -U masteruser
Or
psql -h 54.nnn.nnn.nnn -p 5439 -d mydatabasename -U masteruser
Related
We are running Redis on our enterprise cluster. I need to run Redis flush command to from my local edgenode. Is there a way I can connect to commands on remote Redis using bash scripts. Basically, we want to run Redis command from a remote server/
Thank you
You can use redis-cli
You can specify your remote Redis server host and port
redis-cli -h your.remote.server -p 1234
Or even with commands
redis-cli -h your.remote.server -p 1234 SET KEY VALUE
You also need to enable Redis to accept connections for other machines than the one it is running. Please see bind directive in redis.conf
I want to connect to an aurora serverless database from my local machine. Because the database is only accessible from within the aws cloud, I have setup an ec2 instance running microsocks:
./microsocks -p 8888
I now want to connect using mysql from my machine:
export ALL_PROXY=socks5h://xx.xx.xx.xx:8888
mysql --user=admin --password=XXXX -h database-XXXX.cluster-XXXX.eu-XXXX.rds.amazonaws.com
ERROR 2003 (HY000): Can't connect to MySQL server on 'database...com' (111)
If I run this command on the ec2 instance it succeeds. So I assume that mysql does not respect my proxy settings. If I run curl on my machine it respects the proxy settings.
Note that this is just for testing purposes and I know that this would not be a solution for production use.
You may use proxychains.
yum install proxychains-ng
edit config file /etc/proxychains.conf, and add this:
[ProxyList]
# add proxy here ...
# meanwile
# defaults set to "tor"
socks5 {your proxy.address} {your.proxy.port}
Lastly, you can run mysql like this:
proxychains mysql --user=admin --password=XXXX -h database-XXXX.cluster-XXXX.eu-XXXX.rds.amazonaws.com
I have an AWS DocumentDB set up that I can connect to just fine through my jump box using:
mongo --ssl --host aws-host:27017 --sslCAFile rds-combined-ca-bundle.pem --username my_user --password <insertYourPassword>
I'd like to be able to connect to it through localhost for some testing. I cannot connect directly so I attempted to open a tunnel from my jump:
ssh -i ~/.ssh/my-key user#my_jump -L 27017:aws-host:27017 -N
After that I tried the basic MongoDB connect command:
mongo --ssl --host localhost:27017 --sslCAFile rds-combined-ca-bundle.pem --username my_user --password <insertYourPassword>
I get an error I understand:
The server certificate does not match the host name. Hostname: localhost does not match SAN(s)
I tried using export http_proxy to use http://my_jump:27017 and using the command above again with no luck.
Any suggestions or help on how to connect?
Try to disable ssl hostname validation:
mongo --ssl --sslAllowInvalidHostnames ...
Note --sslAllowInvalidHostnames is available from version 3.0.
If this does not work, try to remove --ssl entirely from the connection options, as according to the documentation:
The mongo shell verifies that the hostname (specified in --host option
or the connection string) matches the SAN (or, if SAN is not present,
the CN) in the certificate presented by the mongod or mongos. If SAN
is present, mongo does not match against the CN. If the hostname does
not match the SAN (or CN), the mongo shell will fail to connect.
I'm trying a simple setup with a docker postgres image, publishing a port for me to connect from the localhost.
docker run -p 5432:5432 --name postgres -e POSTGRES_PASSWORD=password -e POSTGRES_USER=postgres -d postgres
I'm able to connect just fine if I specify the docker external IP:
psql -h 192.1469.99.100 -p 5432 -U postgres -d postgres --password
However I get a password authentication failure when trying against localhost:
psql -h localhost -p 5432 -U postgres -d postgres --password
psql: FATAL: password authentication failed for user "postgres"
Do I need to set up some manual port forwarding manually? The weird thing is that it seems to connect to the postgres server just fine, it's just bizarrely telling me the password fails. I've done something wrong with the docker config perhaps?
The pg_hba.conf looks like:
local all all trust
host all all 127.0.0.1/32 trust
host all all ::1/128 trust
The host machine is Windows 7.
Did you try another port than 5432? Try some free port so that there is no conflict between your local postgre and your docker postgre. To me it looks like your local postgre is having higher prio on localhost:5432, takes the traffic and so you are trying to login to your local postgre instead of your docker postgre, but obv. just a guess.
Did you check if you have this port allowed in the virtual machine or whatever you use for virtualization?
The container has its own network and its loopback address does not refer to the host and vice versa.
I can't connect to mysqlfabric on port 32275.
I am connecting on port 3306 to database so all the grants are in place . On port 32275 I get a message
ERROR 1044 (42000): [Fabric] Access denied
for user and in log I can see
[INFO] 1441810699.948011 - MySQL-RPC-Session-4 - User 'john'
denied access which suggests permissions issue.
I can log in to database if I use
mysql -u fabric -p -h localhost -P 32275
but if I use
mysql -u fabric -p -h host-ip-address -P 32275
I get above error. I can see in netstat that server is listening on that port.
What am I doing wrong ?
There are a couple of things to check in the fabric config.
Firstly try disabling RPC authenication until you have it up and running.
[protocol.xmlrpc]
disable_authentication = no
Also check your storage section and test you can connect using these settings.
[storage]
address = 192.168.0.1:3306
user = fabric_store
password = secret
database = mysql_fabric
auth_plugin = mysql_native_password
mysql -u fabric -psecret -h 192.168.0.1 -P 3306 fabric_store