Commit 892371bc authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Merge branch 'redis_socket' into 'master'

Use sockets to connect to Redis

See merge request !1088
parents 09b23228 5704e6fe
v 7.3.0 v 7.3.0
- Always set the 'origin' remote in satellite actions - Always set the 'origin' remote in satellite actions
- Write authorized_keys in tmp/ during tests - Write authorized_keys in tmp/ during tests
- Use sockets to connect to Redis
- Expire Rack sessions after 1 week - Expire Rack sessions after 1 week
- Cleaner signin/signup pages - Cleaner signin/signup pages
- Improved comments UI - Improved comments UI
......
development: redis://localhost:6379 development: redis://localhost:6379
test: redis://localhost:6379 test: redis://localhost:6379
production: redis://redis.example.com:6379 production: unix:/var/run/redis/redis.sock
...@@ -133,7 +133,21 @@ We recommend using a PostgreSQL database. For MySQL check [MySQL setup guide](da ...@@ -133,7 +133,21 @@ We recommend using a PostgreSQL database. For MySQL check [MySQL setup guide](da
# Try connecting to the new database with the new user # Try connecting to the new database with the new user
sudo -u git -H psql -d gitlabhq_production sudo -u git -H psql -d gitlabhq_production
## 5. GitLab ## 5. Redis
sudo apt-get install redis-server
# Configure redis to use sockets
sudo cp /etc/redis/redis.conf /etc/redis/redis.conf.orig
sed -e 's/^# unixsocket /unixsocket /' -e 's/^port .*/port 0/' /etc/redis/redis.conf.orig | sudo tee /etc/redis/redis.conf
# Activate the changes to redis.conf
sudo service redis-server restart
# Add git to the redis group
sudo usermod -aG redis git
## 6. GitLab
# We'll install GitLab into home directory of the user "git" # We'll install GitLab into home directory of the user "git"
cd /home/git cd /home/git
...@@ -193,6 +207,12 @@ We recommend using a PostgreSQL database. For MySQL check [MySQL setup guide](da ...@@ -193,6 +207,12 @@ We recommend using a PostgreSQL database. For MySQL check [MySQL setup guide](da
sudo -u git -H git config --global user.email "example@example.com" sudo -u git -H git config --global user.email "example@example.com"
sudo -u git -H git config --global core.autocrlf input sudo -u git -H git config --global core.autocrlf input
# Configure Redis connection settings
sudo -u git -H cp config/resque.yml.example config/resque.yml
# Change the Redis socket path if necessary
sudo -u git -H editor config/resque.yml
**Important Note:** Make sure to edit both `gitlab.yml` and `unicorn.rb` to match your setup. **Important Note:** Make sure to edit both `gitlab.yml` and `unicorn.rb` to match your setup.
**Note:** If you want to use HTTPS, see [Using HTTPS](#using-https) for the additional steps. **Note:** If you want to use HTTPS, see [Using HTTPS](#using-https) for the additional steps.
...@@ -288,7 +308,7 @@ Check if GitLab and its environment are configured correctly: ...@@ -288,7 +308,7 @@ Check if GitLab and its environment are configured correctly:
# or # or
sudo /etc/init.d/gitlab restart sudo /etc/init.d/gitlab restart
## 6. Nginx ## 7. Nginx
**Note:** Nginx is the officially supported web server for GitLab. If you cannot or do not want to use Nginx as your web server, have a look at the [GitLab recipes](https://gitlab.com/gitlab-org/gitlab-recipes/). **Note:** Nginx is the officially supported web server for GitLab. If you cannot or do not want to use Nginx as your web server, have a look at the [GitLab recipes](https://gitlab.com/gitlab-org/gitlab-recipes/).
......
...@@ -8,3 +8,24 @@ This document currently just serves as a place to keep track of updates that wil ...@@ -8,3 +8,24 @@ This document currently just serves as a place to keep track of updates that wil
* HTTP setups: Make `/etc/nginx/sites-available/nginx` the same as https://gitlab.com/gitlab-org/gitlab-ce/blob/7-0-stable/lib/support/nginx/gitlab but with your settings. * HTTP setups: Make `/etc/nginx/sites-available/nginx` the same as https://gitlab.com/gitlab-org/gitlab-ce/blob/7-0-stable/lib/support/nginx/gitlab but with your settings.
* HTTPS setups: Make `/etc/nginx/sites-available/nginx-ssl` the same as https://gitlab.com/gitlab-org/gitlab-ce/blob/7-0-stable/lib/support/nginx/gitlab-ssl but with your setting * HTTPS setups: Make `/etc/nginx/sites-available/nginx-ssl` the same as https://gitlab.com/gitlab-org/gitlab-ce/blob/7-0-stable/lib/support/nginx/gitlab-ssl but with your setting
### Configure Redis to use sockets
# Configure redis to use sockets
sudo cp /etc/redis/redis.conf /etc/redis/redis.conf.orig
sed -e 's/^# unixsocket /unixsocket /' -e 's/^port .*/port 0/' /etc/redis/redis.conf.orig | sudo tee /etc/redis/redis.conf
# Activate the changes to redis.conf
sudo service redis-server restart
# Add git to the redis group
sudo usermod -aG redis git
cd /home/git/gitlab
# Configure Redis connection settings
sudo -u git -H cp config/resque.yml.example config/resque.yml
# Change the Redis socket path if necessary
sudo -u git -H editor config/resque.yml
cd /home/git/gitlab-shell
# Configure gitlab-shell to use Redis sockets
sudo -u git -H sed -i 's|^ # socket.*| socket: /var/run/redis/redis.sock|' config.yml
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment