Can Vertica vsql have a failover host like the JDBC client - vertica

I am trying to connect to Vertica nodes through vsql using the -h parameter to specify the host IP. However, I want to specify failover nodes.
According to the documentation backup hosts can be provided as a property in JDBC connection.
How can I implement the same through vsql?

edd is correct, you can use -B SERVER:PORT. Also, if you have native connection load balancing set, you can use the -C option. This will allow the Vertica native load balancer to choose a host for you.
To set the load balancer you run:
SELECT SET_LOAD_BALANCE_POLICY('ROUNDROBIN');
Then when you connect, you use the -C option, and you will see that Vertica has selected a new host.
$ vsql -h host01 -U dbadmin -C
Welcome to vsql, the Vertica Analytic Database interactive terminal.
Type: \h or \? for help with vsql commands
\g or terminate with semicolon to execute query
\q to quit
INFO: Connected using a load-balanced connection.
INFO: Connected to host02 at port 5433.
dbadmin=>
Using -C should work if the node is down on the specified host, as long as the Vertica agent is still running on that host.

The docs say with vsql -B.
Have you tried that option?

Related

Can I connect to Tarantool with mysql or psql console?

I found that I can do SQL requests but only inside Tarantool.
Can I somehow connect to Tarantool like in MySQL shell or Postgres shell?
mysql -u admin -h localhost -P 3301
# or
psql ...
Or how to configure other programs that understand only MySQL or Postgres connections to use Tarantool?
You cannot use either mysql or psql console commands to connect to Tarantool, because the communication protocol is different for each server. For the same reason, for example, you cannot connect to Posgres using the mysql utility. However, nothing prevents you from using tarantoolctl to perform SQL requests to Tarantool. Once attached to an instance (either with tarantoolctl enter my_instance or tarantoolctl connect <uri>), you can switch the default language from Lua to SQL:
\set language sql
\set delimiter ;
After that you will be able to execute SQL statements directly in the console.
For the record, it's also possible to execute SQL using Lua functions, but this may seem less convenient:
box.execute([[ SELECT 1, 2, 3 ]])

IIB - client connection to integration node

I want to check number of active/inactive connection (on node port) at any point of time to my IIB broker.
basically there are multiple clients which connects to integration node (port) to verify if node is available. we suspect not all connections are closed properly.
Need suggestion. thanks.
Try below command in console:
mqsireportproperties -c JMSProviders -o AllReportableEntityNames -r
Using netstat command can show connection information. Grep on Linux and findstr command can be used to filter the output for certain port.

How to take a backup in secondary server of mongodb

I have a mongo's primary server and mongo's secondary server.
I want to take a backup mongo in secondary server in 1 time an hour.
I just wrote a simple bash script in secondary server:
mongodump --host localhost --port 27017 --db databasename --out /root/backupdatabasename --oplog
When I run this script. Geting error:
2016-02-15T07:42:46.713+0000 Failed: bad option: --oplog mode only supported on full dumps
As I know: --oplog is an options point-in-time backup.
Please give me advises if I run above script without --oplog
it works fine without --oplog option.
If you remove the database parameter, the command will dump all databases and include the oplog entries created since the backup started.
The oplog is stored per-mongod instance, rather than per-database, so it kind-of makes sense that you can't request the oplog for a single database.
mongodump --host localhost --port 27017 --out /root/backupdatabasename --oplog

Using postgres_fdw via ssh tunel

can be used postgres_fdw to connect via ssh tunnel?
The database is accessible only from the DB server, andI need to join from another remote server. The DB server log in with SSH keys.
If it's possible, how please?
Yes It is possible. I solved it for mysql_fdw like that;
I use autossh for port forwarding. With autossh, you can keep connection up all time.
Run command on Postgres server:
autossh -L 127.0.0.1:3306:mysql_ip:3306 root#mysql_ip -N -i .ssh/id_rsa.mysql
Test autossh access from Postgres to Mysql.
Run command on Postgres server;
mysql --host=127.0.0.1 --port=3306 -u mysqldbuser -p
Last different part is;
CREATE SERVER mysql_server FOREIGN DATA WRAPPER mysql_fdw OPTIONS (host '127.0.0.1', port '3306');
Other things are same.

Start Vertica database during boot on Linux

I have Vertica installed in an Ubuntu virtual machine and I'd like to have a specific database started during the boot, instead of me having to login, open admintools and start from there.
So, is there a command line that would allow me to start it without user interaction?
In which run level should I add this?
Also, I use a specific user to run everything Vertica related, does this need to be taken into account in my boot script?
Why not just set the restart policy(reboot on boot) in your admintools "Set Restart Policy"
You have 3 option :
Never
ksafe
always -- chose this one to start on boot.
And that is it !
admintools -t start_db
[dbadmin#hostname ~]$ admintools -t start_db --help
Usage: start_db [options]
Options:
-h, --help show this help message and exit
-d DB, --database=DB Name of database to be started
-p DBPASSWORD, --password=DBPASSWORD
Database password in single quotes
-i, --noprompts do not stop and wait for user input(default false)
-F, --force force the database to start at an epoch before data
consistency problems were detected.

Resources