Gitlab Introductory Tutorials

Source: Internet
Author: User
Tags postgresql psql server port
(i) Installation

(1) chmod +x Bitnami-gitlab-7.13.0-0-linux-x64-installer.run

[Root@localhost download]#./bitnami-gitlab-7.13.0-0-linux-x64-installer.run
----------------------------------------------------------------------------
Welcome to the Bitnami gitlab Stack Setup Wizard.

----------------------------------------------------------------------------
Select the components you want to install; Clear the components you don't want
To install. Click Next When you are are ready to continue.


Phppgadmin [y/n]: Y


Gitlab:y (cannot be edited)


Gitlab CI [y/n]: Y


Is the selection above correct? [y/n]: Y


----------------------------------------------------------------------------
installation folder


Please, choose a folder to install Bitnami Gitlab Stack


Select a folder [/opt/gitlab-7.13.0-0]:/usr/local/gitlab


----------------------------------------------------------------------------
Create Admin Account


Bitnami gitlab Stack Admin user creation


Email address [user@example.com]: wanglitao@tuzuu.com


Login [user]: Git


Password:
Please confirm your password:
----------------------------------------------------------------------------
Web Server Port


Please enter the port this bundled Apache Server'll listen to by default.


Apache Web Server Port [80]:


----------------------------------------------------------------------------
Hostname that'll be used to create internal URLs. If This value is incorrect,
You are unable to access your Gitlab installation from the other computers. It is
advisable to use a Domain instead of the IP address for compatibility with
Different browsers.


Domain [127.0.0.1]:


Do your want to configure mail support? [y/n]: N


----------------------------------------------------------------------------
The Setup is now ready to begin installing Bitnami Gitlab Stack on your computer.


Do your want to continue? [y/n]: Y


----------------------------------------------------------------------------
Please wait while the Setup installs Bitnami Gitlab Stack on your computer.


Installing
0% ______________ 50% ______________ 100%
#########################################


----------------------------------------------------------------------------
The Setup has finished installing Bitnami Gitlab Stack on your computer.


Info:to access the Bitnami gitlab Stack, go
Http://127.0.0.1:80 from your browser.
Press [Enter] to continue:




Connect PostgreSQL using Remote Tools


(1) vim/usr/local/gitlab/apps/gitlabci/htdocs/config/database.yml


Database:bitnami_gitlabci
Pool:5
Username:bitnami
Password: "d73115599d8b"
host:127.0.0.1
port:5432




(2) Cat vim/usr/local/gitlab/apps/gitlab/htdocs/config/database.yml




Production
Adapter:postgresql
Encoding:unicode
Database:bitnami_gitlab
Pool:10
Username:bitnami
Password: "d73115599d8b"
host:127.0.0.1
port:5432
# port:5432





Vim/home/gitlab/postgresql/data/pg_hba.conf


Http://www.ruanyifeng.com/blog/2013/12/getting_started_with_postgresql.html


Gitlab Configuration
Vim/usr/local/gitlab/postgresql/data/pg_hba.conf


Add host all 0.0.0.0/0 MD5


Vim/usr/local/gitlab/postgresql/data/postgresql.conf
Modify listen_addresses = ' * '


sh/usr/local/gitlab/ctlscript.sh Stop PostgreSQL


Login
/usr/local/gitlab/postgresql/bin/psql.bin-u bitnami-d bitnami_gitlab-h 192.168.1.39-p 5432


Or


./psql-u bitnami-d bitnami_gitlab-h 192.168.1.30-p 5432




General configuration

Su-postgres


Pg_ctl stop

Pg_ctl start-l/var/lib/pgsql/pgsql.log

Pg_dump Bitnami_gitlab >/tmp/tt.sql

Backup
Pg_dump Bitnami_gitlab >/tmp/my.sql




Pg_dump-u bitnami-f Mydatabase.sql Bitnami_gitlab










View the original database password


Vim/usr/local/gitlab/apps/gitlabci/htdocs/config/database.yml




V. Database operations


(1) Start the database
Pg_ctl start-l/var/lib/pgsql/pgsql.log


Close Database


Pg_ctl stop


(2) Database backup
Pg_dump Bitnami_gitlab >/tmp/wlt.sql


(3) Import
Psql Exampledb </tmp/wlt.sql






(4)
The basic database operation is to use the normal SQL language.
# Create a new table?
CREATE TABLE user_tbl (name VARCHAR, signup_date date);
# Insert data?
INSERT into USER_TBL (name, signup_date) VALUES (' John ', ' 2013-12-22 ');
# Select records?
SELECT * from USER_TBL;
# Update data?
UPDATE user_tbl Set name = ' Dick ' WHERE name = ' John ';
# delete records?
DELETE from user_tbl WHERE name = ' Dick ';
# add fields?
ALTER TABLE user_tbl ADD email VARCHAR (40);
# Update structure?
Alter TABLE USER_TBL ALTER COLUMN signup_date SET not NULL;
# rename field?
ALTER TABLE user_tbl RENAME COLUMN signup_date to signup;
# delete fields?
ALTER TABLE user_tbl DROP COLUMN email;
# Table name change?
ALTER TABLE user_tbl RENAME to Backup_tbl;
# Delete table?
DROP TABLE IF EXISTS backup_tbl;










(2) Daily backup


1. Set up backup directory:
Vim/home/gitlab/apps/gitlab/htdocs/config/gitlab.yml


Add a backup directory inside the backup module
Backup
Path: "/tmp/backups" # relative paths are relative to Rails.root (default:tmp/backups/)








(2) Perform backup operations
Toggle User
/home/gitlab/use_gitlab
cd/home/gitlab/apps/gitlab/htdocs/
Bundle EXEC Bin/rake gitlab:backup:create rails_env=production
The generated backup file is
/tmp/backup/1466567296_gitlab_backup.tar




(3) Reply to backup operation




/home/gitlab/use_gitlab
cd/home/gitlab/apps/gitlab/htdocs/
Bundle EXEC bin/rake Gitlab:backup:restore rails_env=production backup=1466567296
Chown Git:git-r/home/gitlab/apps/gitlab/repositories













Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.