gitlab-org--gitlab-foss/doc/raketasks/maintenance.md

189 lines
4.6 KiB
Markdown
Raw Normal View History

2014-05-27 08:12:15 -04:00
# Maintenance
2014-04-24 18:48:22 -04:00
## Gather information about GitLab and the system it runs on
2014-04-24 18:48:22 -04:00
This command gathers information about your GitLab installation and the System it runs on. These may be useful when asking for help or reporting issues.
```
# omnibus-gitlab
sudo gitlab-rake gitlab:env:info
# installation from source
2013-01-05 16:36:04 -05:00
bundle exec rake gitlab:env:info RAILS_ENV=production
```
Example output:
```
System information
System: Debian 7.8
Current User: git
Using RVM: no
Ruby Version: 2.1.5p273
Gem Version: 2.4.3
Bundler Version: 1.7.6
Rake Version: 10.3.2
Sidekiq Version: 2.17.8
GitLab information
Version: 7.7.1
Revision: 41ab9e1
Directory: /home/git/gitlab
DB Adapter: postgresql
URL: https://gitlab.example.com
HTTP Clone URL: https://gitlab.example.com/some-project.git
SSH Clone URL: git@gitlab.example.com:some-project.git
Using LDAP: no
Using Omniauth: no
2013-02-25 14:45:33 -05:00
GitLab Shell
Version: 2.4.1
Repositories: /home/git/repositories/
Hooks: /home/git/gitlab-shell/hooks/
Git: /usr/bin/git
```
2014-04-24 18:48:22 -04:00
## Check GitLab configuration
2012-12-12 17:55:09 -05:00
Runs the following rake tasks:
2014-04-24 18:48:22 -04:00
- `gitlab:gitlab_shell:check`
- `gitlab:sidekiq:check`
- `gitlab:app:check`
2012-12-12 17:55:09 -05:00
It will check that each component was setup according to the installation guide and suggest fixes for issues found.
You may also have a look at our [Trouble Shooting Guide](https://github.com/gitlabhq/gitlab-public-wiki/wiki/Trouble-Shooting-Guide).
```
# omnibus-gitlab
sudo gitlab-rake gitlab:check
# installation from source
2013-01-05 16:36:04 -05:00
bundle exec rake gitlab:check RAILS_ENV=production
```
2014-07-07 08:41:02 -04:00
NOTE: Use SANITIZE=true for gitlab:check if you want to omit project names from the output.
Example output:
```
2012-12-12 17:55:09 -05:00
Checking Environment ...
Git configured for git user? ... yes
2012-12-12 17:55:09 -05:00
Has python2? ... yes
python2 is supported version? ... yes
Checking Environment ... Finished
2013-05-19 05:13:39 -04:00
Checking GitLab Shell ...
2012-12-12 17:55:09 -05:00
GitLab Shell version? ... OK (1.2.0)
2012-12-12 17:55:09 -05:00
Repo base directory exists? ... yes
Repo base directory is a symlink? ... no
2012-12-12 17:55:09 -05:00
Repo base owned by git:git? ... yes
Repo base access is drwxrws---? ... yes
2012-12-12 17:55:09 -05:00
post-receive hook up-to-date? ... yes
post-receive hooks in repos are links: ... yes
2012-12-12 17:55:09 -05:00
2013-05-19 05:13:39 -04:00
Checking GitLab Shell ... Finished
2012-12-12 17:55:09 -05:00
Checking Sidekiq ...
2012-12-12 17:55:09 -05:00
Running? ... yes
Checking Sidekiq ... Finished
2012-12-12 17:55:09 -05:00
Checking GitLab ...
Database config exists? ... yes
Database is SQLite ... no
2012-12-12 17:55:09 -05:00
All migrations up? ... yes
GitLab config exists? ... yes
GitLab config outdated? ... no
2012-12-12 17:55:09 -05:00
Log directory writable? ... yes
Tmp directory writable? ... yes
Init script exists? ... yes
Init script up-to-date? ... yes
Redis version >= 2.0.0? ... yes
2012-12-12 17:55:09 -05:00
Checking GitLab ... Finished
```
## Rebuild authorized_keys file
In some case it is necessary to rebuild the `authorized_keys` file.
2014-11-20 06:22:46 -05:00
For Omnibus-packages:
```
sudo gitlab-rake gitlab:shell:setup
```
For installations from source:
```
2014-11-20 06:22:46 -05:00
cd /home/git/gitlab
sudo -u git -H bundle exec rake gitlab:shell:setup RAILS_ENV=production
```
```
This will rebuild an authorized_keys file.
You will lose any data stored in authorized_keys file.
Do you want to continue (yes/no)? yes
```
## Clear redis cache
2015-06-03 05:26:57 -04:00
If for some reason the dashboard shows wrong information you might want to
clear Redis' cache.
For Omnibus-packages:
```
sudo gitlab-rake cache:clear
```
For installations from source:
```
cd /home/git/gitlab
sudo -u git -H bundle exec rake cache:clear RAILS_ENV=production
```
## Precompile the assets
Sometimes during version upgrades you might end up with some wrong CSS or
missing some icons. In that case, try to precompile the assets again.
Note that this only applies to source installations and does NOT apply to
omnibus packages.
For installations from source:
```
cd /home/git/gitlab
sudo -u git -H bundle exec rake assets:precompile RAILS_ENV=production
```
For omnibus versions, the unoptimized assets (JavaScript, CSS) are frozen at
the release of upstream GitLab. The omnibus version includes optimized versions
of those assets. Unless you are modifying the JavaScript / CSS code on your
production machine after installing the package, there should be no reason to redo
rake assets:precompile on the production machine. If you suspect that assets
have been corrupted, you should reinstall the omnibus package.
## Tracking Deployments
GitLab provides a Rake task that lets you track deployments in GitLab
Performance Monitoring. This Rake task simply stores the current GitLab version
in the GitLab Performance Monitoring database.
For Omnibus-packages:
```
sudo gitlab-rake gitlab:track_deployment
```
For installations from source:
```
cd /home/git/gitlab
sudo -u git -H bundle exec rake gitlab:track_deployment RAILS_ENV=production
```