Manage a cassandra database on docker with opscenter - database

I have a cassandra instance running on Docker and I am wondering (if possible) to use datastax opscenter to monitor the cassandra instance.
To cennect to my cassandra instance I run:
$ docker run -it --rm cassandra:3.0.2 bash
$ cqlsh [MY_HOST] -u USERNAME -p PASSWORD
After installing opscenter I dont know what to put here:

In order to use OpsCenter to monitor your cassandra instance you will need to have the Datastax-agent running on your cassandra instance. You then add the IP address of the running cassandra instance to the dialog box in your post. Click Save Cluster and OpsCenter will try to connect to your cassandra instance.
If this is the free version of OpsCenter it will have some limitations like only managing a single node instance, but I have done what your asking so you should be able to connect to your cassandra instance and it should come up in opscenter.
Give it a try, hope this helps.
Pat

Related

How to deploy and configure a remote clickhouse db instance with docker

I recently had to add clickhouse to our technology stack but unfortunately I didn't find any good, simple and fast tutorials for my needs and after some trial and error I could manage to do it by myself. To help others I decided to share my experience.
So how to deploy and configure a remote ClickHouse DB instance with docker?
ClickHouse setup
This is a setup guide for deploying ClickHouse with docker on remote servers.
Installation
You have to have docker preinstalled on your remote system.
Server
Run the following command:
$ docker run -d --name some-clickhouse-server -p 8123:8123 --ulimit nofile=262144:262144 --volume=$HOME/some_clickhouse_database:/var/lib/clickhouse yandex/clickhouse-server
ClickHouse server uses port 8123 as the default port but you can uses any other open port but remember to expose the port to the external network. The server comes with a default users with no password.
Client
Run the following command in the server to connect to the clickhouse server with the default user.
$ docker run -it --rm --link some-clickhouse-server:clickhouse-server yandex/clickhouse-client --host clickhouse-server
Configuration
Open the clickhouse server docker container
$ docker exec -it some-clickhouse-server bash
1. Enable SQL-driven access control and account management for the default user.
In the clickhouse server docker container:
$ cd etc/clickhouse-server
Comment out the following line in user.xml file to enable access control:
<access_management>1</access_management>
Note that this operation is unsafe and after finishing you work, you should change the access control to :
<access_management>0</access_management>
2. Listening to other networks:
In the etc/clickhouse-server/config.xml comment out <listen_host>::</listen_host> to allow remote connections.
You should see the port is open in the systems network:
root#myvm:~# lsof -i :8123
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
docker-pr 1141768 root 4u IPv6 53989091 0t0 TCP *:8123 (LISTEN)
Creating a DB with users
In this part we create a simple database and a users. Then we Grant privileges of the database to that user.
There are two types of synchronization and they can complement each other:
1. Creating an users
CREATE USER IF NOT EXISTS user1 IDENTIFIED WITH PLAINTEXT_PASSWORD BY 'pass1'
You can check the users with the SHOW USERS command.
2. Creating a database
CREATE DATABASE IF NOT EXISTS db1
You can check the databases with the SHOW DATABASES command.
3. Grant database privileges to the user
You can grant limited privileges or all privileges to a users.
GRANT ALL PRIVILEGES ON db1.* TO user1
4. Connect with the new users to the database
Now we can connect to the server with the created account.
$ docker run -it --rm --link some-clickhouse-server:clickhouse-server yandex/clickhouse-client --host clickhouse-server -u user1 --password pass1
Make sure the users has all the permissions and has access to the databases:
:) SHOW GRANTS
:) SHOW DATABASES
Creating a Sample Table
Clickhouse supports SQL .
To create a table:
:) USE db1
:) CREATE TABLE names (
id UInt64,
name String,
created DateTime
) ENGINE = MergeTree()
PRIMARY KEY id
ORDER BY id;
:) SHOW TABLES
There you have it. You can connect to the databases from other networks with the clickhouse-client and your user/password.
Please clone this project and follow the instructions as per the README.md file. After running the docker compose you will have 2 shards and 2 replica setup of clickhouse.
https://github.com/vinitk95/clickhouse-cluster.git

Restore corrupt mongo db from WiredTiger files

So here is my scenario:
Today my server was restarted by our hoster (acpi shutdown).
My mongo database is a simple docker container (mongo:3.2.18)
Because of an unknown reason the container wasn't restarted on reboot (restart: always was set in docker-compose).
I started it and noticed the volume mapping were gone.
I restored them to the old paths, restarted the mongo container and it started without errors.
I connected to the database and it was completely empty.
> show dbs
local 0.000GB
> use wekan
switched to db wekan
> show collections
> db.users.find();
>
Also I already tried db.repairDatabase();, no effect.
Now my _data directory contains a lot of *.wt files and more. (File list)
I found collection-0-2713973085537274806.wt which has a file size about 390MiB.
This could be the data I need to restore, assuming its size.
Any way of restoring this data?
I already tried my luck using wt salvage according to this article, but I can't get it running - still trying.
I know backups,backups,backups! Sadly this database wasn't backuped.
Related GitHub issue, contains details to software.
Update:
I was able to create a .dump file with the WiredTiger Data Engine tool. However I can't get it imported into a mongoDB.
Try running a repair on the mongo db container. It should repair your database and the data should be completely restored.
Start mongo container in bash mode.
sudo docker-compose -f docker-compose.yml run mongo bash
or
docker run -it mongo bash
Once you are inside the docker container, run mongo db repair.
mongod --dbpath /data/db --repair
The DB should repaired successfully and all your data should be restored.

How to load db2 dump data from the one db(remotly installed) to docker based db

I am new to docker concept. I have followed this to start and able to install db2 under docker environment.
My questions are
1)i need to load data in to this docker based db2. Data dump is from the db2 instance present remotely in linux machines.How can i load the dump from the docker db2 console?
2)every time i start docker quick start terminal i need to do all the procedure done in above link again. can't i just run db2 container and go to db2 console?
3) su - db2inst1(from link) is asking for password non of attempts to that password succeed(will give my machine admin password,db2 password etc).i need to restart or start again the process to go in to db2 container.

How to create solr cloud as a windows service

We are using solr cloud as a search service and currently we run this from command prompt of windows, but I don't know how we can create solr cloud as a windows service on production environment.
I referred below document for the same,
http://www.norconex.com/how-to-run-solr5-as-a-service-on-windows/
but it is not working as expected for solr cloud.
Can anybody please help me on this.
Thanks,
Santosh
You need to give some information on what is not as expected .
The link shown looks like it will get you some of the way, but you obviously need to run a couple of instances, give different home locations and probably setup dependencies between the services to ensure that the one with the Zookeeper starts first. All of which you should already have by running it on the command line, so you should only need to put the corresponding parameters into corresponding fields in the GUI.
Sorry for late reply, I was on vacation.
I can run solr cloud as a windows service , but for that I need to first ccreate a complete setup of solr cloud instance using command:
solr -e cloud -z localhost:2181
then need to stop all the solr port running in command prompt , by closing the command prompt.
Then I configure individual windows service for each solr port running as below:
restart -c -f -p 8984 -z 0.0.0.0:2181 -s "C:/solr-5.2.1/example/cloud/node1/solr"
and so on for every port.
This way I can configure each solr running port as a windows service.
But I want to know , is there any command in solr cloud, which will create solr cloud setup as well run all solr port under single windows service instance.
the command like " solr -f -e cloud -z localhost:2181 -noprompt" , is doing that but it is running for only one default port i.e 8983, and I want to configure solr cloud setup for at least two ports just like "solr -e cloud -z localhost:2181 -noprompt" configured default in solr.cmd.
Thanks,
Santosh

Oracle public server

I want to learn about oracle, to try some queries and other SQL features of oracle data base, but don't want to install and mess with all realted issues. So my question is - is there any publicly available oracle server, to which I can connect through terminal and play with it?
I mean a service where I can register and some space would be allocated to my profile
Take a look at: http://apex.oracle.com/
The only thing I can think of is SQLFiddle: http://sqlfiddle.com/
But it won't let you have a "private" space. You need to re-create your schema each time (but you can bookmark your script which might be enough for you).
You could also try one of the pre-built virtual appliances - see
http://www.oracle.com/technetwork/community/developer-vm/index.html
If you need direct database access, you can run it in a Docker instance:
docker run -d -p 1521:1521 -p 8080:8080 alexeiled/docker-oracle-xe-11g
Then connect to it with sqlplus
sqlplus system/oracle#localhost:1521/xe
See here for more passwords, info on apex, etc.
Just came across this: Oracle Live SQL. It is browser based so nothing to install locally. But, you need to have an Oracle account.
Browser based SQL worksheet access to an Oracle database schema

Resources