Best way to send Orion to background? - fiware

Literally from:
https://ask.fiware.org/question/86/best-way-to-send-orion-to-background/
Hi there,
I've installed Orion in a CentOS 6 as recommended in the documentation and I'm wondering how to run this on the background.
Running contextBroker, it stays in foreground:
[centos#oc-orion fiware-orion]$ contextBroker
INFO#15:04:54 contextBroker.cpp[1502]: Orion Context Broker is running
[centos#oc-orion fiware-orion]$ INFO#15:04:54 mongoConnectionPool.cpp[196]: Successful connection to database
INFO#15:04:54 mongoConnectionPool.cpp[196]: Successful connection to database
INFO#15:04:54 mongoConnectionPool.cpp[196]: Successful connection to database
INFO#15:04:54 mongoConnectionPool.cpp[196]: Successful connection to database
INFO#15:04:54 mongoConnectionPool.cpp[196]: Successful connection to database
INFO#15:04:54 mongoConnectionPool.cpp[196]: Successful connection to database
INFO#15:04:54 mongoConnectionPool.cpp[196]: Successful connection to database
INFO#15:04:54 mongoConnectionPool.cpp[196]: Successful connection to database
INFO#15:04:54 mongoConnectionPool.cpp[196]: Successful connection to database
INFO#15:04:54 mongoConnectionPool.cpp[196]: Successful connection to database
INFO#15:04:54 contextBroker.cpp[1282]: Connected to mongo at localhost:orion
INFO#15:04:54 MongoGlobal.cpp[2856]: Database Operation Successful ({})
INFO#15:04:54 MongoGlobal.cpp[504]: Database Operation Successful ({ conditions.type: "ONTIMEINTERVAL" })
INFO#15:04:54 contextBroker.cpp[1590]: Startup completed
INFO#15:05:04 MongoGlobal.cpp[2856]: Database Operation Successful ({})
I've been thinking on running this with supervisor or similar, but not sure...any ideas?
Thanks!

In fact, running Orion just using contextBroker runs the process in background (note that algthough the standard output is printed in the same terminal where the command was issued, that doesn't mean that the process runs in foreground). In order to run in foreground, use the -fg CLI argument.
The proper way of running Orion in background in CentOS 6 is as service (I'm assuming that you installed Orion as RPM):
/etc/init.d/contextBroker start

Related

I'm getting a "connection attempt failed" while trying to create a database/table on a mySQL server on RDS

I created a mySQL server on RDS and I'm trying to create a database on it. I provided the correct username and password, I made it publicly accessible, the security group is allowing all traffic on all ports and I'm still getting connection failed.
Here's what I'm trying to run in my code
import mysql.connector
mydb = mysql.connector.connect(
host="I entered my RDS endpoint here",
user="admin",
password="admin123"
)
mycursor = mydb.cursor()
mycursor.execute("CREATE DATABASE test")
And here's the error I received
mysql.connector.errors.InterfaceError: 2003: Can't connect to MySQL server on 'The Endpoint to my RDS:3306' (10060 A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond)
I'm not sure what else to try to create a database on RDS

Server side forclose me to connect with remote database

I have created SpringBoot application which connectes to the remote database mysql. I test it with two remote db connection: one has a dynamic IP, the second one has a permanent IP - it's a hosting.
Running locally:
When I try to run application locally (connection to DB with permanent IP), straightforward from Intellij everything works properly - in my browser I can see the application.
When I try to run the application with dynamic IP - I need to provide the host name instead of IP, the application throws:
com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Could not create connection to database server. Attempted reconnect 3 times. Giving up.
Caused by: java.sql.SQLException: null, message from server: "Host 'HomeGateway' is not allowed to connect to this MySQL server"
Running on server:
When I try to run it on server eventhough I provide the connection to the host with dynamic IP or with pernament IP it also throws:
com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Could not create connection to database server. Attempted reconnect 3 times. Giving up.
Caused by: java.sql.SQLException: Access denied for user 'root'#'localhost' (using password: YES)
The application.properties file looks like - the connection with database with dynamic IP:
# REMOTE DATABASE
spring.datasource.url = jdbc:mysql://modraszka.sth.sth:3336/test3?autoReconnect=true&useSSL=false
spring.datasource.username = root
spring.datasource.password = password
I must add that when the appication has been deployed at server, at the same server is located database - this one which has dynamic server - modraszka.sth.sth.
Summary:
Whenever I want to run the application from server which has connection to remote DB it always throws fails even when I want to connect to the DB which is located on the same server as my application. I also tried to run application with db properites connection as: localhost:3306/test3 -> but it also failed.

Openshift mysql connection error channel timeout

I have an Tomcat 7 application on openshift and I have added a MySQL cartridge. I have a problem connecting to that database using MySQL workbench.
I have added all the necessary parameters like hostname, username, password and SSH key, I have tested the connection and I get no errors. But when I try to connect to the db I get the following error:
Your connection attempt failed for user 'adminxxxx' from your host to server xx.xxx.xxx.xxx:3306:
Tunnel error: Remote connection to xx.xxx.xxx.xxx:3306 failed: IOError('open SSH tunnel timeout',)
What can I do to fix this? Connecting to the db is a big part of the application.

Access mysql data base remotely from playframework 1.2.4

I want to access sql database remotely from play framework version 1.2.4
I am running play in virtualbox and I have mysql database in local pc.
app/conf/application.conf
db.url=jdbc:mysql://xxx.xxx.47.78:3306/vedb
db.driver=org.postgresql.Driver
db.user=root
db.pass=aaa123aaa
/etc/mysql/my.cnf
bind-address=xxx.xxx.47.78
when I start the app with http://localhost:9000/ I am getting below error
A database error occured : Cannot connected to the database,
Communications link failure The last packet sent successfully to the
server was 0 milliseconds ago. The driver has not received any packets
from the server.
In your example you define a mysql URL but set the driver to postgresql...
Try to comment the driver setting, or set it to: 'com.mysql.jdbc.Driver'
You can alos try to connect to your mysql server using the mysql command line:
mysql -h xxx.xxx.47.78 -u root -p
Then enter the root password (mysql root password). This will test the network connection to the mysql server.

MySQL Connection Pool in Glassfish not working

I'm trying to setup a connection pool in Glassfish for a MySQL server. But when i try and PING it it fails, server gives this error stating:
WARNING: RAR8054: Exception while creating an unpooled [test] connection for pool
[myPoolName], Connection could not be allocated because: Access denied for user
''#'localhost' {using password: YES}
In my connection pool properties I did specify the password, but ping is still not working.
Seems to me that the user name is missing.
MySQL server often has root/pass combination by default. In your connection pool you should give the username and the password. You could try to connect with a different client to test the correct credentials (e.g. your IDE or MySQL Workbench or MySQL command line ...)