Hot answers tagged

25

By default, the SELinux policy will only allow services access to recognized ports associated with those services: # semanage port -l | egrep '(^http_port_t|6379)' http_port_t tcp 80, 81, 443, 488, 8008, 8009, 8443, 9000 # curl http://localhost/redis.php Cannot connect to redis server. - add Redis port (6379) to SELinux policy # ...


22

Your post doesn't describe much in the way of specs (memory on the LS indexer, log volume or much else) but I'll try and answer your questions best I can first. Disclaimer: I'm one of the logstash devs - Apache going nuts was likely a side effect of the logstash process acting up. I'd put that aside for now. The sane way to make ES f/b/s is add more ES ...


17

Create a new config file /etc/redis/redis-new.conf (copied from redis.conf) and change these fields in the new config pidfile port logfile dir (for the default db) Create a new file /etc/init.d/redis-server-new (copied from the file redis-server) and change these fields in the new file name pidfile (same as in the config file in step 1) deamon_args (the ...


12

By default redis listens on 127.0.0.1 have you edited your redis.conf to include the line bind your.private.ip.address ?


12

You installed the EPEL repository for EL7, but you are actually running EL6. Remove the epel-release package, i.e., sudo yum search epel && sudo yum remove epel-release and replace it with the correct package. According to this documentation Redis could be installed on CentOS6 by issuing the following commands: // --- Compiling --- $ wget http://...


12

Here's my successful experience of updating Redis (2.4.10) on CentOS 6.5. How to update Redis on CentOS 6.5 First, make sure the following repos, EPEL and REMI, are installed: sudo rpm -Uvh http://download.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm sudo rpm -Uvh http://rpms.remirepo.net/enterprise/remi-release-6.rpm Check the ...


11

Either compile from source or build a .deb package via fpm: Install fpm with gem: # apt-get install rubygems # gem install fpm Compile Redis: # cd /usr/local/src/ # wget http://redis.googlecode.com/files/redis-2.4.16.tar.gz # tar zxvf redis-2.4.16.tar.gz # cd redis-2.4.16/ # make Build .deb package: # mkdir -p /tmp/redis-$VERSION.$$/usr/bin # mkdir -...


9

After few days of intense trial and errors, I'm glad to be able to say that I've understood where the bottleneck was, and I'll post it here so that other people can benefit from my findings. The problem lies in the pub/sub connections that I was using with socket.io, and in particular in the RedisStore used by socket.io to handle inter-process ...


8

There are two ways: The first is just to specify a numeric --retry value. Then it will use /signal/timeout/KILL/timeout schedule. I.e. send a terminating signal (specified with --signal option), then wait the specified number of seconds and then send a KILL signal that could not be ignored by a process and therefore it will be forced to exit. The command ...


7

You're abusing Nginx's worker_threads. There is absolutely no need to run that many workers. You should run as many workers as you have CPUs and call it a day. If you're running gunicorn on the same server, you should probably limit nginx workers to two. Otherwise, you're just going to thrash the CPUs with all the context switching required to manage all of ...


7

To do this, you need to make sure that your IPTables rules are configured properly. Ubuntu generally leaves their servers wide open by default, which is why I still don't recommend their use as servers unless you are quite well aware of how to do this properly already. I imagine that your iptables -L -nv looks something like this, yes? # iptables -L -nv ...


7

The way we handle this is by creating multiple groups of servers in a layered stack (even if a group currently only needs one instance). The first layer is your Elastic Load Balancer, clearly. The second layer is an Auto Scaling Group of web servers (multi-availability zone). These boot a custom AMI designed be in a proper ready-state for this task on ...


7

Memcached is an in-memory key/value store. Redis can be used that way, but is much much more. Ways Memcached and Redis Are Similar Both are capable of caching database results or anything else you might want to cache. Both are capable of storing simple string values for a key. A previous answer stated memcached is more flexible, and this is false. Storing ...


7

At Stack Exchange we run multiple instances of Redis on a single server and we have never seen any issues: [kbrandt@ny-redis01: ~] ps -e -o vsz,cmd | grep redis-server | sort -nr 15943668 /usr/sbin/redis-server *:6382 14966708 /usr/sbin/redis-server *:6379 7878376 /usr/sbin/redis-server *:6380 2692092 /usr/sbin/redis-server *:6384 1855480 /usr/sbin/redis-...


6

Is it possible that, in your innermost else block, the call to redis-server is returning immediately, but the server itself is taking more than one second to start up? In that case, wait won't wait long enough.


6

Redis shouldn't be crashing. I'd focus on that first. Is it running out of RAM? Use something like Supervisor or Monit, or run Redis through something like Upstart.


5

Do you have Redis listening on an interface other than localhost or 127.0.0.1? If so, the stop command is never being sent to the right interface, as the official Redis init template fails to include the host address. In the /etc/init.d/redis files I’ve worked with, I had to define REDISHOST=10.150.0.18 and then on line 30 (look for “shutdown”) add that ...


5

I would recommend installing redis on something, your laptop, whatever you have available now. Then generate some nontrivial amount of data shaped like what you plan to store on the eventual server. Say 100,000 values. Then, load that into redis in the way you expect your application to. Then, see how much memory redis is using: redis-cli info | grep "...


5

Adding to Dan's answer, According to this error in the log file we have to create one extra directory # Can't chdir to '/var/lib/redis-new': No such file or directory so mkdir /var/lib/redis-new Otherwise /etc/init.d/redis-server-new won't start. Don't forget to add proper rights by chown redis:redis /var/lib/redis-new


5

Find your redis.conf file and comment out the line that reads Bind 127.0.0.1. Most out of the box installs have the interface only excepting local connections. Once you comment that out and restart redis server you will be able to connect assuming no other firewall is keeping from getting in On Ubuntu Linux you can go location /etc/init.d and issue the this ...


5

Edit your config file to set the dir option to the current working directory: # The filename where to dump the DB dbfilename dump.rdb # The working directory. # # The DB will be written inside this directory, with the filename specified # above using the 'dbfilename' configuration directive. # # Also the Append Only File will be created inside this ...


5

At the server side, for a simple failover, you can do it by using Nagios and NRPE. On the Nagios server: define service{ use critical-service host_name B service_description redis:2302 check_command check_tcp!2302 event_handler promote_redis!C!2302 contact_groups ...


5

Go to source tree and try this command: make uninstall If that doesn't work you can list the steps that the software would take to install itself (without actually installing anything): make -n install


5

Seems iptables was filtering everything out. Solution was to create a REDIS chain. iptables -N REDIS iptables -A REDIS -s 192.168.10.1 -j ACCEPT iptables -A REDIS -s 192.168.10.2 -j ACCEPT iptables -A REDIS -j LOG --log-prefix "unauth-redis-access" iptables -A REDIS -j REJECT --reject-with icmp-port-unreachable iptables -I INPUT -p tcp --dport 6379 -j REDIS ...


5

EPEL redis package are kind of outdated, on RHEL6 you can use Remi's Repository: http://rpms.famillecollet.com/. They are up to date, also with the latest releases from 3.0 and 2.8 versions. Have a look here for a description of the latest packages.


5

just download Redis 3.0.3 (not 3.0.1! Is already old) and compile as usually with make, and then use make install. Make sure that the old binary is replaced by the new one, so check where your current Redis binary is. Redis 3.0.3 is mostly backward compatible with Redis 2.8.x (I would say 99.999%). The only few differences are listed in the Changelog file.


4

The output from 'top' might yield some clues. There's a field near the top left labeled '% stolen' which reflects the amount of hardware CPU diverted to other guests on the same physical box. I've seen these kinds of slow downs when the hypervisor decides to allocate more CPU to another guest, especially when I'm performing some long-running CPU-intensive ...


4

In this answer I assume that default redis port (6379) is used. You might create a tunnel via ssh so localhost->6379 will point to mydomainwhatever.net:6379 using this command: ssh -L 6379:localhost:6379 user@mydomainwhatever.net Then you might connect to localhost:6379 using redis client.


4

This is pretty well covered in the Supervisord intro chapter. Most services will run/work just fine with init.d, and that will be their default, out-of-the-box config. The process managers exist to give you expanded and finer-grained control and monitoring of your critical processes and services if that is something you desire/require.


4

It is not an environmental setting, but a default setting. Check the source code: def __init__(self, host='localhost', port=6379, password=None, ... ) Change it in the configuration file: # Accept connections on the specified port, default is 6379. # If port 0 is specified Redis will not listen on a TCP socket. #port 6379 # If you want you can bind a ...



Only top voted, non community-wiki answers of a minimum length are eligible