20170505
RAID級(jí)別
raid0 為帶區(qū)陣列;
raid1 為鏡像陣列
raid0+1 為四塊磁盤實(shí)現(xiàn)的榮譽(yù)磁盤陣列;
raid5 至少三塊,容量為(n-1)/n 廣泛用于各種服務(wù)器:文件,數(shù)據(jù)庫,web,郵件服務(wù)器
1.git回退到某個(gè)歷史版本
1. 使用Git log命令查看所有的歷史版本,獲取某個(gè)歷史版本的id,假設(shè)查到歷史版本的id是139dcfaa558e3276b30b6b2e5cbbb9c00bbdca96。
2.?
[html] view plain copy
git reset --hard 139dcfaa558e3276b30b6b2e5cbbb9c00bbdca96?
3. 把修改推到遠(yuǎn)程服務(wù)器
[javascript] view plain copy
git push -f -u origin maste
因?yàn)閜ythonanywhere上沒有 PostgreSQL,所以今天完成的無法在上面實(shí)現(xiàn),但是我上傳了,結(jié)果報(bào)錯(cuò),所以回退回去了
當(dāng)然發(fā)布更新:
command-line
$ git status
$ git add --all .
$ git status
$ git commit -m "Added views to create/edit blog post inside the site."
$ git push
Then, in a PythonAnywhere Bash console:
command-line
$ cd my-first-blog
$ git pull
[...]
2.Detailed installation guides
Want to edit, but don't see an edit button when logged in? Click here.
YUM Installation
PostgreSQL can be installed using RPMs (binary) or SRPMs (source) managed by YUM. This is available for the following Linux distributions (both 32- and 64-bit platforms; for the current release and prior release or two):
Fedora
Red Hat Enterprise Linux
CentOS
Scientific Linux
Oracle Enterprise Linux
See links from the main repository, http://yum.postgresql.org:
A list of available packages
Repository packages for different version combinations
Status of RPM builds
Contents [hide]?
1 Instructions
1.1 Configure your YUM repository
1.2 Install PGDG RPM file
1.3 Install PostgreSQL
1.4 Post-installation commands
1.4.1 Data Directory
1.4.2 Initialize
1.4.3 Startup
1.5 Control service
2 Removing
3 Support
4 After installation
Instructions
Configure your YUM repository
Locate and edit your distributions .repo file, located:
On Fedora: /etc/yum.repos.d/fedora.repo and /etc/yum.repos.d/fedora-updates.repo, [fedora] sections
On CentOS: /etc/yum.repos.d/CentOS-Base.repo, [base] and [updates] sections
On Red Hat: /etc/yum/pluginconf.d/rhnplugin.conf [main] section
To the section(s) identified above, you need to append a line (otherwise dependencies might resolve to the postgresql supplied by the base repository):
exclude=postgresql*
Install PGDG RPM file
A PGDG file is available for each distribution/architecture/database version combination. Browse https://yum.postgresql.org/repopackages.php and find your correct RPM. For example, to install PostgreSQL 9.6 on CentOS 7 64-bit: yum install https://download.postgresql.org/pub/repos/yum/9.6/redhat/rhel-7-x86_64/pgdg-redhat96-9.6-3.noarch.rpm
Install PostgreSQL
To list available packages:
yum list postgresql*
For example, to install a basic PostgreSQL 9.6 server:
yum install postgresql96-server
Other packages can be installed according to your needs.
Post-installation commands
After installing the packages, a database needs to be initialized and configured.
In the commands below, the value of <name> will vary depending on the version of PostgreSQL used.
For PostgreSQL version 9.0 and above, the <name> includes the major.minor version of PostgreSQL, e.g., postgresql-9.4
Data Directory
The PostgreSQL data directory contains all of the data files for the database. The variable PGDATA is used to reference this directory.
The default data directory is:
/var/lib/pgsql/<name>/data
For example:
/var/lib/pgsql/9.6/data
Initialize
The first command (only needed once) is to initialize the database in PGDATA.
For Red Hat 6:
service <name> initdb
E.g. for version 9.6:
service postgresql-9.6 initdb
For Red Hat 7, and Fedora 23 and above:
If the previous command did not work, try directly calling the setup binary, located in a similar naming scheme:
/usr/pgsql-y.x/bin/postgresqlyx-setup initdb
E.g. for version 9.6:
/usr/pgsql-9.6/bin/postgresql96-setup initdb
Startup
If you want PostgreSQL to start automatically when the OS starts, do the following:
In RHEL 6 and PostgreSQL 9.6:
chkconfig postgresql-9.6 on
In RHEL 7+, and Fedora 23+ try:
systemctl enable postgresql-9.6.service
Control service
To control the database service, use:
for RHEL 5 and 6:
service <name> <command>
where <command> can be:
start : start the database
stop : stop the database
restart : stop/start the database; used to read changes to core configuration files
reload : reload pg_hba.conf file while keeping database running
E.g. to start version 9.6:
service postgresql-9.6 start
With RHEL 7.1+ and CentOS 7.1+, and Fedora 23+, systemd is introduced. Use this instead:
systemctl enable postgresql-9.6.service
systemctl start postgresql-9.6.service
Removing
To remove everything:
yum erase postgresql96*
or?
dnf remove postgresql96* for Fedora 23+.
Or remove individual packages as desired.
Support
Email: pgsql-pkg-yum@postgresql.org (requires subscription)
After installation
sudo su - postgres
Or the more modern form:
sudo -u postgres -i
Out of all the answers above nothing worked for me. I had to manually change the users password in the database and it suddenly worked.
psql -U postgres -d postgres -c "alter user produser with password 'produser';"
I used the following settings:
pg_hba.conf
local all all peer
# IPv4 local connections:
host all all 127.0.0.1/32 password?
# IPv6 local connections:
host all all ::1/128 password
Connection is successful finally for the following command:
psql -U produser -d dbname -h localhost -W?
這其中會(huì)出現(xiàn)用戶找不到的問題,所以下面是解決方法
3.今天實(shí)現(xiàn)評(píng)論的功能,但是在本地!!!!
轉(zhuǎn)載于:https://www.cnblogs.com/Jt00/p/7154947.html
總結(jié)
- 上一篇: 梦到一只好大的乌龟是什么意思
- 下一篇: 梦到三次男朋友出轨预示什么