Merge branch '39426-update-fog-google-docs' into 'master'
Add docs for backing up to Google Cloud Storage See merge request gitlab-org/gitlab-ce!15074
This commit is contained in:
parent
1842b7f870
commit
61f78b349c
|
|
@ -136,44 +136,54 @@ In the example below we use Amazon S3 for storage, but Fog also lets you use
|
|||
for AWS, Google, OpenStack Swift, Rackspace and Aliyun as well. A local driver is
|
||||
[also available](#uploading-to-locally-mounted-shares).
|
||||
|
||||
For omnibus packages, add the following to `/etc/gitlab/gitlab.rb`:
|
||||
#### Using Amazon S3
|
||||
|
||||
```ruby
|
||||
gitlab_rails['backup_upload_connection'] = {
|
||||
'provider' => 'AWS',
|
||||
'region' => 'eu-west-1',
|
||||
'aws_access_key_id' => 'AKIAKIAKI',
|
||||
'aws_secret_access_key' => 'secret123'
|
||||
# If using an IAM Profile, don't configure aws_access_key_id & aws_secret_access_key
|
||||
# 'use_iam_profile' => true
|
||||
}
|
||||
gitlab_rails['backup_upload_remote_directory'] = 'my.s3.bucket'
|
||||
```
|
||||
For Omnibus GitLab packages:
|
||||
|
||||
Make sure to run `sudo gitlab-ctl reconfigure` after editing `/etc/gitlab/gitlab.rb` to reflect the changes.
|
||||
1. Add the following to `/etc/gitlab/gitlab.rb`:
|
||||
|
||||
```ruby
|
||||
gitlab_rails['backup_upload_connection'] = {
|
||||
'provider' => 'AWS',
|
||||
'region' => 'eu-west-1',
|
||||
'aws_access_key_id' => 'AKIAKIAKI',
|
||||
'aws_secret_access_key' => 'secret123'
|
||||
# If using an IAM Profile, don't configure aws_access_key_id & aws_secret_access_key
|
||||
# 'use_iam_profile' => true
|
||||
}
|
||||
gitlab_rails['backup_upload_remote_directory'] = 'my.s3.bucket'
|
||||
```
|
||||
|
||||
1. [Reconfigure GitLab] for the changes to take effect
|
||||
|
||||
---
|
||||
|
||||
For installations from source:
|
||||
|
||||
```yaml
|
||||
backup:
|
||||
# snip
|
||||
upload:
|
||||
# Fog storage connection settings, see http://fog.io/storage/ .
|
||||
connection:
|
||||
provider: AWS
|
||||
region: eu-west-1
|
||||
aws_access_key_id: AKIAKIAKI
|
||||
aws_secret_access_key: 'secret123'
|
||||
# If using an IAM Profile, leave aws_access_key_id & aws_secret_access_key empty
|
||||
# ie. aws_access_key_id: ''
|
||||
# use_iam_profile: 'true'
|
||||
# The remote 'directory' to store your backups. For S3, this would be the bucket name.
|
||||
remote_directory: 'my.s3.bucket'
|
||||
# Turns on AWS Server-Side Encryption with Amazon S3-Managed Keys for backups, this is optional
|
||||
# encryption: 'AES256'
|
||||
# Specifies Amazon S3 storage class to use for backups, this is optional
|
||||
# storage_class: 'STANDARD'
|
||||
```
|
||||
1. Edit `home/git/gitlab/config/gitlab.yml`:
|
||||
|
||||
```yaml
|
||||
backup:
|
||||
# snip
|
||||
upload:
|
||||
# Fog storage connection settings, see http://fog.io/storage/ .
|
||||
connection:
|
||||
provider: AWS
|
||||
region: eu-west-1
|
||||
aws_access_key_id: AKIAKIAKI
|
||||
aws_secret_access_key: 'secret123'
|
||||
# If using an IAM Profile, leave aws_access_key_id & aws_secret_access_key empty
|
||||
# ie. aws_access_key_id: ''
|
||||
# use_iam_profile: 'true'
|
||||
# The remote 'directory' to store your backups. For S3, this would be the bucket name.
|
||||
remote_directory: 'my.s3.bucket'
|
||||
# Turns on AWS Server-Side Encryption with Amazon S3-Managed Keys for backups, this is optional
|
||||
# encryption: 'AES256'
|
||||
# Specifies Amazon S3 storage class to use for backups, this is optional
|
||||
# storage_class: 'STANDARD'
|
||||
```
|
||||
|
||||
1. [Restart GitLab] for the changes to take effect
|
||||
|
||||
If you are uploading your backups to S3 you will probably want to create a new
|
||||
IAM user with restricted access rights. To give the upload user access only for
|
||||
|
|
@ -226,6 +236,50 @@ with the name of your bucket:
|
|||
}
|
||||
```
|
||||
|
||||
#### Using Google Cloud Storage
|
||||
|
||||
If you want to use Google Cloud Storage to save backups, you'll have to create
|
||||
an access key from the Google console first:
|
||||
|
||||
1. Go to the storage settings page https://console.cloud.google.com/storage/settings
|
||||
1. Select "Interoperability" and create an access key
|
||||
1. Make note of the "Access Key" and "Secret" and replace them in the
|
||||
configurations below
|
||||
1. Make sure you already have a bucket created
|
||||
|
||||
For Omnibus GitLab packages:
|
||||
|
||||
1. Edit `/etc/gitlab/gitlab.rb`:
|
||||
|
||||
```ruby
|
||||
gitlab_rails['backup_upload_connection'] = {
|
||||
'provider' => 'Google',
|
||||
'google_storage_access_key_id' => 'Access Key',
|
||||
'google_storage_secret_access_key' => 'Secret'
|
||||
}
|
||||
gitlab_rails['backup_upload_remote_directory'] = 'my.google.bucket'
|
||||
```
|
||||
|
||||
1. [Reconfigure GitLab] for the changes to take effect
|
||||
|
||||
---
|
||||
|
||||
For installations from source:
|
||||
|
||||
1. Edit `home/git/gitlab/config/gitlab.yml`:
|
||||
|
||||
```yaml
|
||||
backup:
|
||||
upload:
|
||||
connection:
|
||||
provider: 'Google'
|
||||
google_storage_access_key_id: 'Access Key'
|
||||
google_storage_secret_access_key: 'Secret'
|
||||
remote_directory: 'my.google.bucket'
|
||||
```
|
||||
|
||||
1. [Restart GitLab] for the changes to take effect
|
||||
|
||||
### Uploading to locally mounted shares
|
||||
|
||||
You may also send backups to a mounted share (`NFS` / `CIFS` / `SMB` / etc.) by
|
||||
|
|
@ -554,3 +608,6 @@ The rake task runs this as the `gitlab` user which does not have the superuser a
|
|||
Those objects have no influence on the database backup/restore but they give this annoying warning.
|
||||
|
||||
For more information see similar questions on postgresql issue tracker[here](http://www.postgresql.org/message-id/201110220712.30886.adrian.klaver@gmail.com) and [here](http://www.postgresql.org/message-id/2039.1177339749@sss.pgh.pa.us) as well as [stack overflow](http://stackoverflow.com/questions/4368789/error-must-be-owner-of-language-plpgsql).
|
||||
|
||||
[reconfigure GitLab]: ../administration/restart_gitlab.md#omnibus-gitlab-reconfigure
|
||||
[restart GitLab]: ../administration/restart_gitlab.md#installations-from-source
|
||||
|
|
|
|||
Loading…
Reference in New Issue