I am trying to connect with couchbase like given below
telnet 127.0.0.1 11210
I am getting connected also but when i am giving keyword "stats" it is getting hung there
root#vcb01-korakoram:~# telnet 127.0.0.1 11210
Trying 127.0.0.1...
Connected to 127.0.0.1.
Escape character is '^]'.
stats
^C
quit
^CConnection closed by foreign host.
for coming out I pressed 2-3 time "ctrl-C"
Tried to cnnect by using cbstats as given below:
root#vcb01-korakoram:~# /opt/couchbase/bin/cbstats 127.0.0.1:11210 all
Stats '' are not available from the requested engine. (Memcached error #36: EACCESS : Not authorized for command : {"error":{"context":"An exception occurred. command: [STAT]","ref":"d6582c0d-a06a-411b-bc29-bfa758359a37"}})
but here it is showing this issue
Please let me know what is the issue.
Related
I am trying to analyze MySQL error logs that are generated on my OSSEC agent and raise alerts using OSSEC server.
here is the code block added to /var/ossec/etc/ossec.conf on the agent side to read the error logs of MySQL from the agent:
<localfile>
<log_format>mysql_log</log_format>
<location>/var/log/mysql/error.log</location>
</localfile>
After doing so I have restarted the agent and server but unable test any error logs that are getting generated on the agent side like:
2020-09-15T04:09:24.164859Z 12 [Note] Access denied for user 'root'#'localhost' (using password: YES)
As per doc https://ossec-docs.readthedocs.io/en/latest/docs/programs/ossec-logtest.html under Caveats we need to add MySQL log: to the log generated for the ossec-logtest.
This will be added automatically when we send these logs to the OSSEC server for analysis from the agent.
ossec-logtest result for MySQL error log
ossec-logtest is working fine after adding MySQL log: to the beginning but they are not working in the realtime.
Can anyone please help me through this problem.
The fact that ossec-logtest trigger an alert means that mysql decoder and rules are working fine
Check on Agent
MySql is running. systemctl status mysqld.service
MySql configuration (loglevel and output file) allow to log that kind of event . See here
If the value is greater than 1, aborted connections are written to the
error log, and access-denied errors for new connection attempts are
written.
MySql is effectively logging 'Access denied': grep "Access denied" /var/log/mysql/error.log
Ossec and their processes is running ok: /var/ossec/bin/ossec-control status
Check on Manager
log_alert_level field in /var/ossec/etc/ossec.conf is lower o equal than 9 (loglevel showed in your ossec-logtest)
This question already has an answer here:
OpenShift: How to connect to postgresql from my PC
(1 answer)
Closed 6 years ago.
I've deployed a nodejs application at openshift.redhat.com with a mysql and phpmyadmin cartridge. I can access my database fine by going to mywebsite.rhcloud.com/phpmyadmin and logging in with my credentials, but when I try to add a connection to MySQL workbench on my local computer it doesn't seem to connect.
The infomation I'm using is from sshing to my application and typing:
echo $OPENSHIFT_MYSQL_DB_USERNAME
echo $OPENSHIFT_MYSQL_DB_PASSWORD
echo $OPENSHIFT_MYSQL_DB_HOST
echo $OPENSHIFT_MYSQL_DB_PORT
This gives my username, password, host and port which I use in MySQL workbench.
I've tried this: https://stackoverflow.com/a/27333276/2890156
Changed the bind-address from my databse ip to 0.0.0.0, added a new user from the phpmyadmin webinterface with % to allow this account to connect from any ip but it all doesn't seem to work.
I can't figue out what I'm doing wrong or missing, can anyone help me out?
EDIT:
Seems the bind-address I've changed has changed back to my remote database ip after restarting the mysql cartridge...
It's likely that a firewall is blocking access to your hosted database. You can verify this by using a network scan utility like nmap.
I'm going to assume the following for this example, change the respective values if they differ:
echo $OPENSHIFT_MYSQL_DB_HOST is mywebsite.rhcloud.com
echo $OPENSHIFT_MYSQL_DB_PORT is 3306
After installing it on your local machine, then run the command:
nmap -Pn -p 3306 mywebsite.rhcloud.com
If it's blocked, then you'll get a filtered scan that looks like this:
Starting Nmap 6.40 ( http://nmap.org ) at 2016-05-05 13:05 CDT
Nmap scan report for rhcloud.com (54.174.51.64)
Host is up.
Other addresses for rhcloud.com (not scanned): 52.2.3.89
rDNS record for 54.174.51.64: ec2-54-174-51-64.compute-1.amazonaws.com
PORT STATE SERVICE
3306/tcp filtered mysql
Nmap done: 1 IP address (1 host up) scanned in 2.10 seconds
Otherwise, you'll get an open scan like this:
Starting Nmap 6.40 ( http://nmap.org ) at 2016-05-05 13:05 CDT
Nmap scan report for rhcloud.com (54.174.51.64)
Host is up.
Other addresses for rhcloud.com (not scanned): 52.2.3.89
rDNS record for 54.174.51.64: ec2-54-174-51-64.compute-1.amazonaws.com
PORT STATE SERVICE
3306/tcp open mysql
Nmap done: 1 IP address (1 host up) scanned in 0.06 seconds
On HDP 2.3.2 with Sqoop 1.4.6, I'm trying to import tables from SQL Server 2008.
I'm able to successfully connect to the SQL Server because I can list databases and tables etc.
However, every single time during imports I run into the following error:
Error: java.lang.RuntimeException: java.lang.RuntimeException:
com.microsoft.sqlserver.jdbc.SQLServerException: The TCP/IP connection
to the host x.x.x.x, port 1433 has failed. Error: "connect timed
out. Verify the connection properties. Make sure that an instance of
SQL Server is running on the host and accepting TCP/IP connections at
the port. Make sure that TCP connections to the port are not blocked
by a firewall.".
Again, I am actually able to successfully import from SQL Server, but only after a couple of retries. However, regardless of whether the import succeeded or failed, I always get the error mentioned above and I was wondering what could be causing the problem? It's rather cumbersome to have to keep repeating the imports whenever they fail.
I've already turned off the connection time-out on the SQL Server, and though the connection from the Hadoop cluster and the SQL Server passes through our corporate firewall, our admins tell me that the timeout on the firewall is 3600 seconds. The imports fail before getting anywhere near that mark.
Just an example of one of the sqoop commands I use:
sqoop import \
--connect "jdbc:sqlserver://x.x.x.:1433;database=CEMHistorical" \
--table StreamSummary --username hadoop \
--password-file hdfs:///user/sqoop/.adg.password --hive-import \
--hive-overwrite --create-hive-table --split-by OfferedTime \
--hive-table develop.streamsummary --map-column-hive Call_ID=STRING,Stream_ID=STRING,OriginalCall_ID=STRING,TransactionID=TIMESTAMP
Update:
After getting in touch with our network team, it seems this is most definitely a network issue. To add context, the Hadoop cluster is on a different VLAN as the SQL Server and it goes through a number of firewalls. To test, I tried importing from a different SQL Server within the same VLAN as the Hadoop cluster and I didn't encounter this exception at all.
Posting this here as a reference:
I never heard back from our network team with regards to firewall logs, but our NameNode's OS got corrupted and had to be reformatted and HDP reinstalled. For some reason we're not encountering this error any longer.
One difference between the original cluster and the new installation is that we had 4 nodes (1 name node and 3 data nodes) which were virtualized in a single server. Now, we're running a single node cluster (HDP 2.3.4) with no virtualization on the server.
Mysql client is behaving strangely on one of my servers.
I have my mysql server (ip 10.0.0.190, used to be 172.16.0.190).
I have another server from which I try to connect, which I will refer to as collab.
Bind address is set to 0.0.0.0 server-side, as well as the Grant options for collab.
When I try to connect through mysql-client, here is what I do :
> mysql -u user -p -h mysql.domain
This doesn't work, and after 30s I get this error message :
ERROR 2003 (HY000): Can't connect to MySQL server on 'mysql.domain' (110)
Now the weird thing is that if I do :
> mysql -u user -p -h 10.0.0.190
Everything works correctly. At first, I thought it was a DNS issue, so I tried ping, dig which all answered properly. ie, from client :
> ping mysql.domain
64 bytes from mysql.domain (10.0.0.190): icmp_req=1 ttl=64 time=0.999 ms
So I launched tcpdump on both the server and the client. On the server I get nothing.
On the client :
> tcpdump port 3306
[ ... ]
11:11:41.139499 IP client.domain.49186 > 172.16.0.190.mysql
[ ... ]
As I said, 172.16.0.190 used to be the client's IP before I switched my network. I understand this is where the error comes from, but I can't figure out how to solve it.
Obviously the error comes from the collab but I can't figure out where does it comes from. I've tried to grep '172.16.0' in my /etc on collab in case I had forgotten anything, but nothing came back.
Moreover, when I try to connect from another server using the FQDM, it works.
Anyone has an idea ?
Thanks,
Cheers
H
this may be a DNS cache issue. Try flushing your cache. If you are on windows/osx, look at this: http://docs.cpanel.net/twiki/bin/view/AllDocumentation/ClearingBrowserCache
I'm not sure what has to be done on Linux.
(Flush on CLIENT side, by the way).
I have query regarding connecting mysql to comand prompt.
I did:
open cmd prompt
telnet localhost com 3306
I RECEIVED REPLY as---
some instructions mentioning
telnet [-a][-e escape char][-f log file][-1 user][-t term][host [port]]
-a attempt automatic logon. same as -1 option except uses the currently logged on user's name.
-e Escape char to enter telnet client prompt.
and some more...
but is it right?? or i am lost???
kindly help.
do not telnet to your mysql database.
Instead use the mysql command, a UI like db visualizer (they have a pay version and a free version), or the free ui that comes with maria db (a drop in replacement for mysql).
more more info on the mysql command, try running mysql --help or find it in the mysql reference manual
Edit: more info added here.
Telnet is not a "command prompt", it is a communication protocol (check out telnet protocol on wikipedia) and a program (that uses the communication protocol to communicate). You can not connect to mySql with telnet because mySql does not use the telnet protocol for communication.
I have only accessed mySql for jdbc, so I'm not sure how to solve your problem. I know there is a c api interface for mySql as well. Sections "20 Connectors and APIs," and "15 Replication" in the mysql reference might be helpful.