cannot store values into memcache - memcached

I am running apache+php+memcache on suse 10.1.
I can connect Ok to memcached on port 11211, but I cannot do getVersion, add, get, etc.
Error message:
[Thu Jan 21 14:38:15 2010] [error] [client ] PHP Notice: Memcache::add() [function.Memcache-add]: Server localhost (tcp 11211) failed with: Failed reading line from stream (0) in /testmem/index.php on line 13
How can I debug this?

Try with 127.0.0.1.
Make sure your firewall allows connecting to port 11211.
Make sure your Memcached server is up and running on port 11211.

You may be running memcached without ASCII protocol support, such as if you ran:
$ memcached -B binary
If this is the case, remove the -B argument entirely, and PHP and telnet should work.
It is also possible that your memcached was compiled with SASL support enabled, which disabled the ASCII protocol that PHP requires to connect to memcached.
This would explain why it is running, but you cannot issue ASCII commands through telnet (or PHP).
You could test this by running:
$ memcached -S
You should see this output if memcached wasn't compiled with SASL:
"This server is not built with SASL support."

Related

Failed to use 'sudo systemctl status apache2'

I'm currently trying to install and run apache2, I could install it but not configure it using 'sudo systemctl status apache2' and this error appears:
systemd[1]: Starting The Apache HTTP Server...
apachectl[16656]: (98)Address already in use: AH00072: make_sock: could not bind to ad>
apachectl[16656]: (98)Address already in use: AH00072: make_sock: could not bind to ad>
apachectl[16656]: no listening sockets available, shutting down
apachectl[16656]: AH00015: Unable to open logs
apachectl[16646]: The Apache error log may have more information.
systemd[1]: apache2.service: Control process exited, code=exited, status=1/FAILURE
systemd[1]: apache2.service: Failed with result 'exit-code'.
systemd[1]: Failed to start The Apache HTTP Server.
lines 1-15/15 (END)
So, when I googled about this error I found maybe my port 80 was alredy been used and tried 'ss --listening --tcp --numeric --processes' to find out what is using port 80/tcp, I also kind of messed up using this command sudo kill -9, and now but none of the outputs say 80.
Thank you so much for your valuable help.
Hi, This error is most probably caused by another process in the port you are trying to run apache on. Or it can also be the fact that your firewall (ufw)
might be blocking apache.
To check if the firewall is blocking apache run: sudo ufw app list in your teminal. If apache is in the list then it might be another process. If apache is not in your app list run this command: sudo ufw allow apache2 and then restart apache using sudo systemctl start apache2.
Hope this was helpful

Can´t connect with socket after upgrading from maraidab 10.2.29 -> 10.3.31 in SuSE SLES 12

Two weeks ago, SuSE updated the packages for their SuSE Linux Enterprise Server (SLES) for mariaDB from 10.2.29-3.22.1 to 10.2.31-3.25.1. This minor update broke the database connections on my SLES 12SP4 production server as well as on my SLES12SP5 development server.
This update introduced a problem with socket connections: Until now I declared the socket in my.cnf with
socket = /var/lib/mysql/mysql.sockfor the [client] and [mysqld] group which was the default location on SLES11 and worked flawlessly.
This behavior changed after the update: When my drupal php applications now try to connect to this socket they only throw PDOException: SQLSTATE[HY000] [2006] MySQL server has gone away in lock_may_be_available() (. If I call
systemctl status mysql.service it my terminal it informs me that mysqld[pid]: refused connect from IP.
Luckily, I figured out that my production machine works with the default socket = /run/mysql/mysql.sock. My guess would have been that the new mariaDB version does not accept symlinks as /var/lib/mysql is located on a different volume and integrated by symlink in my setup.
But my developement machine refuses this solution as well, I am not able to get the database working again. The major difference between prod and dev is that I already migrated dev to service pack 5, therefore I hesitate upgrading my production environment from SP4 to SP5.
This is no firewall issue as it does not change after turning off the
firewall.
bind-address = 127.0.0.1 which is also configured in the drupal settings as host
I changed the socket directory to /tmp/mysql.sock as this
should be reachable from anywhere with no result.
The file permissions are srwxrwxrwx 1 mysql mysql 0 13. Mär 11:59 mysql.sock=
netstat -ln | grep mysql returns unix 2 [ ACC ] STREAM LISTEN 670834 /tmp/mysql.sock
systemctl status mysql.service returns
mariadb.service - MySQL server
Loaded: loaded (/usr/lib/systemd/system/mariadb.service; disabled; vendor preset: disabled)
Active: active (running) since Fr 2020-03-13 11:59:54 CET; 3h 2min ago
Main PID: 12393 (mysqld)
Status: "Taking your SQL requests now..."
Tasks: 30 (limit: 512)
CGroup: /system.slice/mariadb.service
└─12393 /usr/sbin/mysqld --defaults-file=/etc/my.cnf --user=mysql
There is no evidence of a something concerning the socket handlings in the mariaDB changelog.
Has anybody experienced the same problem? Or any ideas how I could fix this? Unfortunatly, I am no database expert...
Thanks,
Rob
I found the solution: MariaDB 10.2.31-3.25.1. on SLES starts to use /etc/hosts.allow which is configured different - much more restricted on my dev than on my production server. Therefore the client was not able to reach the database server.
I wonder where this different behavior was introduced - I found nothing in the change logs of mariaDB...

Zabbix-agent on HAProxy discover load-balanced host doesn't show up on Zabbix Server

I have been following this tutorial for a moment but I don't know why it isn't working:
https://github.com/anapsix/zabbix-haproxy/blob/master/README.md
To make a long story short:
I have a Zabbix server on Amazon EC2 and I want to monitor a HAproxy server which is inside my network. The HAProxy Server has a Zabbix Agent working on it.
The tutorial explain how to setup a script for the zabbix-agent to explore what's behind it (what's the haproxy is load-balancing) and send it back to the Zabbix Server.
However everything is working fine but nothing shows up on the Zabbix server, no host are discovered despite the zabbix agent and server are communicating.
1 - I did place the userparameter_haproxy.conf into /etc/zabbix/zabbix_agentd.d/ and
set it in the zabbix_agend.conf file.
2 - I did place the haproxy_discovery.sh into /usr/local/bin/ and gave it the +x rights
3 - I did import haproxy_zbx_template.xml
4 - Configure HAProxy control socket: I assume there is my mistake.
5- The scripts are working because I get result when I execute this commands:
zabbix_agentd -t haproxy.list.discovery[FRONTEND]
zabbix_agentd -t haproxy.list.discovery[BACKEND]
zabbix_agentd -t haproxy.list.discovery[SERVERS]
6 - I added the host with HAproxy on it to the right template
7 - I can wait forever nothing is showing up, no new hosts.
I think the step 4 is where I am doing wrong. In the tutorial they say:
Configure HAProxy to listen on /var/run/haproxy/info.sock or set
custom socket path in checks (set {$HAPROXY_SOCK} template macro to
your custom socket path) or update userparameter_haproxy.conf and
haproxy_discovery.sh with your socket path
I did make the haproxy.cfg file listen to the file /var/lib/haproxy/stats
and set a custom socket path in the template macro.
Additionnal info:
Version of Zabbix: 3.4
Zabbix Server: RHEL 7.4
Zabbix Agent: Centos 7.2
No errors when I restart zabbix-agent
No errors in haproxy.log
UPDATE: I did add Zabbix to the root group.
Now, in Zabbix server logs I can see this message:
changed: Value "which: no nc in (/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin)
2" of type "string" is not suitable for value type "Numeric (unsigned)"
And I'm lost again.
UPDATE: I was missing netcat, I installed it on the zabbix server and client.
UPDATE: It's working
According to your update, I guess netcat (nc) is not installed on your system.
Install it and try again

Libvirt Connect to XEN from Windows

I have setup XEN on SLES12 and created few virtual machines. Using virsh I am able to connect to libvirt from linux but not from windows. I was trying:
# connect xen://hostname
# connect xen://hostname/system
# connect xen+tcp://hostname
# connect xen+tcp://hostname/system
I have recieved following error messages:
# connect xen+tcp://hostname 'Unable to connect to server at 'hostname:16509': Unknown error 107'
# connect xen://hostname 'error: Cannot read CA certificate '/usr/i686-w64-mingw32/sys-root/mingw/etc/pki/CA/cacert.pem': No such file or directory'
Other commands stated above produce same errors. I runned netstat and I cannot find port number 16509. I assume that when I connect from linux it uses different port(?) as there is no problem with that. the only difference is that from linux I use ssh connection:
# connect xen+ssh://root#hostname
Any ideas will be appriciated
It’s likely that your libvirtd is not listening to the TCP port. You must have –listen option while running the libvirtd.
Check following link
Additionally you may need to modify /etc/libvirt/libvirtd.conf
listen_tls = 0 #it's enabled by default. To disable it, set it to be zero
listen_tcp = 1
tcp_port="16509"
listen_addr="192.168.45.22"
# tcp_auth = "sasl"
auth_tcp = "none"
# /usr/sbin/libvirtd –listen
Use command libvirtd -d
It will create libvirtd deamon
and then use libvirtd --listen to make libvirtd listen on TCP port.

Orion: "curl: (7) couldn't connect to host"

I have installed the last version of Orion, 0.12.0, and when I send a queryContext or updateContext, the system gives me: "curl: (7) couldn't connect to host",
what's the problem?
Thanks!
After analyzing the user feedback in the question comments, the problem seems to be that Orion Context Broker is not running.
In order to start Orion Context Broker (see reference documentation in https://wiki.fi-ware.org/Publish/Subscribe_Broker_-_Orion_Context_Broker_-_Installation_and_Administration_Guide#Running_Orion_Context_Broker for more detail) you can either:
Use the /etc/init.d/contextBroker start command (run it as root or with sudo privileges)
Using contextBroker command directly
In order to check that everything is ok, it uses to be a good idea to do a first run in foreground with maximum tracelevel activated, i.e. contextBroker -fg -t 0-255. Once you ensure that it works properly (e.g. curl version, etc.), then interrupt the process with Ctrl+C in the console and run it in background.