Can Apache Drill connect to Amazon RedShift? - amazon-redshift

Can Apache Drill connect to Amazon RedShift ? If yes Can anyone help me with configuration and plugin for Apache Drill to connect to Amazon RedShift .

I was not able to get the example from #pavel to work. i am sure it has to do with the driver name and which specific driver i downloaded and installed.
However, I was able to successfully connect to AWS Redshift using the following steps.
Navigate to folder you have downloaded drill to:
cd ~/Downloads/apache-drill-1.11.0
download the required jdbc drivers from AWS at Download the Amazon Redshift JDBC Driver
save the jar files into the folder ~/Downloads/apache-drill-1.11.0/jars/3rdparty
start drill using:
./bin/drill-embedded
Navigate to http://localhost:8047/storage to configure a new data source aka plugin.
Create a new storage plugin and name your data source accordingly. for my test i called it redshift.
Once you have named the source as "redshift", then paste the correct configuration
{
"type" : "jdbc",
"driver" : "com.amazon.redshift.jdbc42.Driver",
"url" : "jdbc:redshift://redshiftserver.mydomain.net:5439/databaseName?ssl=true&sslfactory=com.amazon.redshift.ssl.NonValidatingFactory",
"username" : "username",
"password" : "password",
"enabled" : true
}
next test connectivity to the server using the following query
select * from redshift.autonation.information_schema.columns

Yep, just use Example-Postgres-Configuration
And then use web gui to add a storage:
{
"type" : "jdbc",
"driver" : "org.postgresql.Driver",
"url" : "jdbc:postgresql://URL:5439/DB_NAME_HERE",
"username" : "user",
"password" : "password",
"enabled" : true
}

Related

Managing Environment variables ejabberd server

Is there any way to manage multiple environment variables (dev/stage/production) from single ejabberd server.
Specifically different database for each environment. e.g
development
-----------
db : devdb
user : user
pass : pass
stage
-----
db : stagedb
user : user
pass : pass
production
----------
db : proddb
user : user
pass : pass
Ubuntu 16.04 Ejabberd 17.xx Database : mysql client :
react-native(android/ios)
If I understand correctly, you have configured in ejabberd several vhosts, and you want to use a different SQL database for each one. For defining each database in ejabberd.yml, you can use the host_config option, see https://docs.ejabberd.im/admin/configuration/#virtual-hosting

How to connect vapor to mongodb atlas

So I have a vapor \ fluent app that works fine with local mongo instance, here's current mongo.json:
{
"database" : "vapor",
"port" : "27017",
"host" : "127.0.0.1",
"user" : "",
"password" : ""
}
I've deployed a free MongoDB Atlas 3 replica set and I wonder how do I connect the app to it?
Fluent's MongoDB integration is using an outdated version of MongoKitten. Currently we're at MongoKitten 4. MongoKitten 1, which is being used in Fluent currently supports just a fraction of the features with a much worse performance.
Check that your mongod instance is listening on the necessary network interfaces
Check that your firewall is open and you can connect to the mongod process from your application node
Check that your mongod is secure, i.e. you can connect only with known credentials
In the application's mongo.json:
"host": "replica_set_name/first_RS_node_address, second_RS_node_address, third_RS_node_address",
"user": "your_user_name",
"password": "wery_secret"

Mongodb on Google Cloud -- Confirm content via show dbs?

I've installed a MongoDB on Google Cloud Compute Engine via a Bitnami script. I can see the vm instance in the Google Cloud dashboard. I can connect to the database using my deployed node.js app. My app works just fine.
What I can't figure out is how to independently verify the content in the Mongo database.
On the Compute Cloud dashboard for the Mongo DB VM, there is a SSH pulldown button at the top of the screen. Clicking this button opens up a browser frame. The frame connects to the VM instance via https, and confirms login info. I've seen this related stackoverflow posting, and I've met all of these suggestions. Settings confirmed at the Google Cloud VM instance interface. When I type mongo I can see the mongo shell. When I try show dbs I get back unexpected results:
show dbs
2017-02-19T05:51:45.161+0000 E QUERY [thread1] Error: listDatabases failed:{
"ok" : 0,
"errmsg" : "not authorized on admin to execute command { listDatabases: 1.0 }",
"code" : 13,
"codeName" : "Unauthorized"
} :
How can I do a simple show dbs and then show collections and finally db.foo.find() to confirm data content?
Ouch. So it turns out I missed something. When I created the instance the system sent me an confirmation email. In the email were a couple of key links.
There are two very different methods to "connect" to the database.
The first is to open the mongo shell interface via an admin / login.
$ mongo admin --username root -p
MongoDB shell version v3.4.2
Enter password: (password entered here)
connecting to: mongodb:///opt/bitnami/mongodb/tmp/mongodb-27017.sock/admin
MongoDB server version: 3.4.2
This worked quite well, without having to transfer SSH keys at all. Reference link here. At this point I could
> show dbs
admin 0.000GB
local 0.000GB
> use admin
switched to db admin
> show collections
books
system.users
system.version
> db.books.find()
{ "_id" : ObjectId("58a900452c972b0010def8a7"), "title" : "Mr. Tickle", "author" : "Roger Hargreaves", "publishedDate" : "1971", "description" : "" }
{ "_id" : ObjectId("58a900612c972b0010def8a8"), "title" : "Mr. Sneeze", "author" : "Roger Hargreaves", "publishedDate" : "1982", "description" : "" }
{ "_id" : ObjectId("58a93a192c972b0010def8a9"), "title" : "Mr. Happy", "author" : "Roger Hargreaves", "publishedDate" : "1971", "description" : "" }
>
The second method is to register SSH keys, via these instructions over at Bitnami.com
In this method, you have to first add your public SSH key via the Google Cloud interface to the instance.

PostgreSQL + IntelliJ : FATAL : role xxx doesn't exist

I am able to connect with psql and do what I want, not in IntelliJ.
PostgreSQL version : postgres (PostgreSQL) 9.6.1
IntelliJ version : 2016.3.1
IntelliJ configuration :
URL : jdbc:postgresql://localhost:5432/sample
User : sample
Pwd : sample
Test connection : Successful
So, I connect (red square appears) and then try a simple query :
select 1;
And I got the error :
FATAL : role 'xxx' doesn't exist`
Why IntelliJ doesn't use the role specified in my configuration and want to use my personal login ?? Whatever I use as role, still got the same error.
Note: If I add my system username as role it works, but I would prefer to avoid that.
Adding the LOGIN role attribute fix the problem :
ALTER ROLE sample LOGIN
The documenation states :
Only roles that have the LOGIN attribute can be used as the initial
role name for a database connection
However, I could connect in CLI and do what I want, as I could "connect" in IntelliJ but not do query, without this attribute. More details about this behaviour are welcome.

MongoDB and Robomongo: Can't connect (authentication)

I have the following user:
{
"_id" : "admin.root",
"user" : "root",
"db" : "admin",
"roles" : [
{
"role" : "root",
"db" : "admin"
}
]
}
And for my database:
{
"_id" : "mydb.mydbDbOwner",
"user" : "mydbDbOwner",
"db" : "mydb",
"roles" : [
{
"role" : "dbOwner",
"db" : "mydb"
}
]
}
I can't connect via Robomongo on localhost:
The same goes for...
Database: mydb
User Name: root
Database: mydb
User Name: mydbDbOwner
How can I fix this problem?
Robomongo 0.8.x doesn't have support for the new SCRAM-SHA-1 authentication which was the default authentication method added in MongoDB 3.0.
Robomongo 0.9.0 RC4 (Feb 2016) added support for SCRAM-SHA-1, but if you are using a modern version of MongoDB server you should upgrade to the latest version of Robomongo (now Robo3T) currently available.
There is also an officially maintained free GUI, MongoDB Compass, which is more actively updated than Robo3T. MongoDB Compass 1.22+ (Sept 2020) includes an embedded MongoDB shell.
I was experiencing exactly the same issue on Mac. I removed the Robomongo client and download the latest version from their website. It just works :)
You can change localhost to 127.0.0.1
You can try Mongo-Express (a web-based tool).
However, you need to upgrade the MongoDB-Node.js library to be at least (1.4.29) according to Upgrade to SCRAM.
I tried and it worked for my case. You can find the below useful command for that:
npm install mongo-express
cd node-modules/mongo-express
Change the config.default.js file to config.js and update it to include your database connection (e.g., username, password, connection's URL, etc.)
Edit the package.jon file and change the version of MongoDB to "~1.4.29"
Run: npm update
To start the web application: execute command "node app" and the web site will be available at http://localhost:8081/.
I just upgraded to the new version 1.0 of Robomongo. As a few people stated in here, 0.8.x didn’t support SCRAM-SHA-1, which is default in MongoDB 3.0. In prior versions it was MONGODB-CR.
But anyone who is downloading Robomongo from this point on shouldn't have an issue with authentication.
https://robomongo.org/
This bottom links explains SCRAM-SHA a bit more. I suggest reading into it if heavily using MongoDB.
SCRAM
Possibility for connection through an SSH tunnel with Robomongo is back in the RC8 version. See GitHub issue Where is the SSH tunnel settings on v 0.9.0 RC2 Mac version #1008.