当前位置: 首页 > news >正文

网站开发经验总结与教训点石关键词排名优化软件

网站开发经验总结与教训,点石关键词排名优化软件,互联网 医疗网站建设有哪些城市,wordpress短代码按钮实验目的 配置一个最简的主从环境,了解基本的主从配置。 环境参数 操作系统CentOS Linux release 7.9.2009 (Core)数据库版本PostgreSQL 10.23主库端口15431备库端口15432 因为只是做实验,所以主备库放在同一台机器上,仅通过端口区分主备…

实验目的

配置一个最简的主从环境,了解基本的主从配置。

环境参数

操作系统CentOS Linux release 7.9.2009 (Core)
数据库版本PostgreSQL 10.23
主库端口15431
备库端口15432
  • 因为只是做实验,所以主备库放在同一台机器上,仅通过端口区分主备
  • 操作的系统用户为pg,没有特殊说明的情况下操作命令都由pg用户执行

搭个环境

初始化主库

[pg@localhost ~]$ pg_ctl -D /data/db1 init
The files belonging to this database system will be owned by user "pg".
This user must also own the server process.The database cluster will be initialized with locale "en_US.UTF-8".
The default database encoding has accordingly been set to "UTF8".
The default text search configuration will be set to "english".Data page checksums are disabled.creating directory /data/db1 ... ok
creating subdirectories ... ok
selecting default max_connections ... 100
selecting default shared_buffers ... 128MB
selecting default timezone ... Asia/Shanghai
selecting dynamic shared memory implementation ... posix
creating configuration files ... ok
running bootstrap script ... ok
performing post-bootstrap initialization ... ok
syncing data to disk ... okWARNING: enabling "trust" authentication for local connections
You can change this by editing pg_hba.conf or using the option -A, or
--auth-local and --auth-host, the next time you run initdb.Success. You can now start the database server using:/usr/pgsql-10/bin/pg_ctl -D /data/db1 -l logfile start

配置主库参数

[pg@localhost ~]$ vi /data/db1/postgresql.conf
修改如下参数:
---------------------------------------
port = 15431	#主库端口
unix_socket_directories = '/tmp'  #本地连接socket文件目录pg访问/var/run/postgresql会有权限制问题,反正不打算用本地socket方式连接所以直接改成/tmp
[pg@localhost ~]$ vi /data/db1/pg_hba.conf
确认已开启本地复制的权限,本地连接的所有用户都有备机的复制权限
---------------------------------------
local   replication     all                                     trust
host    replication     all             127.0.0.1/32            trust
host    replication     all             ::1/128                 trust

初始化备库

备库的基准文件必须来自于主库,直接复制主库文件到备库位置即可。

[pg@localhost ~]$ rsync -avz /data/db1/* /data/db2#修改主备库目录的权限为0700,否则会导致数据库启动异常
[pg@localhost ~]$ chmod 0700 /data/db[1,2]

配置备库参数

备库需求配置一个特定的参数文件recovery.conf,可以从安装目录中复制文件模板过来修改。

[pg@localhost ~]$ cp /usr/pgsql-10/share/recovery.conf.sample /data/db2/recovery.conf[pg@localhost ~]$ vi /data/db2/recovery.conf
开启备库模式
---------------------------------------
standby_mode = on
[pg@localhost ~]$ vi /data/db2/postgresql.conf
修改如下参数:
---------------------------------------
port = 15432
unix_socket_directories = '/tmp'

验证主备功能

#启动主库
[pg@localhost ~]$ pg_ctl -D /data/db1/ -l /data/db1/server.log start
waiting for server to start.... done
server started#启动备库
[pg@localhost ~]$ pg_ctl -D /data/db2/ -l /data/db2/server.log start
waiting for server to start.... done
server started#查看可用账号和库
[pg@localhost ~]$ psql -l -h localhost -p 15431List of databasesName    | Owner | Encoding |   Collate   |    Ctype    | Access privileges
-----------+-------+----------+-------------+-------------+-------------------postgres  | pg    | UTF8     | en_US.UTF-8 | en_US.UTF-8 |template0 | pg    | UTF8     | en_US.UTF-8 | en_US.UTF-8 | =c/pg            +|       |          |             |             | pg=CTc/pgtemplate1 | pg    | UTF8     | en_US.UTF-8 | en_US.UTF-8 | =c/pg            +|       |          |             |             | pg=CTc/pg
(3 rows)[pg@localhost ~]$ psql -l -h localhost -p 15432List of databasesName    | Owner | Encoding |   Collate   |    Ctype    | Access privileges
-----------+-------+----------+-------------+-------------+-------------------postgres  | pg    | UTF8     | en_US.UTF-8 | en_US.UTF-8 |template0 | pg    | UTF8     | en_US.UTF-8 | en_US.UTF-8 | =c/pg            +|       |          |             |             | pg=CTc/pgtemplate1 | pg    | UTF8     | en_US.UTF-8 | en_US.UTF-8 | =c/pg            +|       |          |             |             | pg=CTc/pg
(3 rows)#连接主库,建表
[pg@localhost ~]$ psql -h localhost -p 15431 -U pg postgres
psql (10.23)
Type "help" for help.postgres=# create table t3(a int);
CREATE TABLE
postgres=# insert into t3(a) values (1),(2),(3);
INSERT 0 3#连接备库查看看同步情况
[pg@localhost ~]$ psql -h localhost -p 15432 -U pg postgres
psql (10.23)
Type "help" for help.postgres=# \dtList of relationsSchema | Name | Type  | Owner
--------+------+-------+-------public | t3   | table | pg
(1 row)postgres=# select * from t3;a
---123
(3 rows)postgres=#

文章转载自:
http://dinncoroentgenograph.ydfr.cn
http://dinncodts.ydfr.cn
http://dinncogerundival.ydfr.cn
http://dinncoreckon.ydfr.cn
http://dinncomotivity.ydfr.cn
http://dinncoreiver.ydfr.cn
http://dinncobipectinated.ydfr.cn
http://dinncoreafforestation.ydfr.cn
http://dinncoaerofoil.ydfr.cn
http://dinncoinjector.ydfr.cn
http://dinncohopelessly.ydfr.cn
http://dinncounderstratum.ydfr.cn
http://dinncocephalad.ydfr.cn
http://dinncopigling.ydfr.cn
http://dinncoautomatization.ydfr.cn
http://dinncoperfectionist.ydfr.cn
http://dinncoenameling.ydfr.cn
http://dinncorequisite.ydfr.cn
http://dinncodinothere.ydfr.cn
http://dinnconitroaniline.ydfr.cn
http://dinncogeriatrist.ydfr.cn
http://dinncoignitability.ydfr.cn
http://dinncophonotypy.ydfr.cn
http://dinncoboddhisattva.ydfr.cn
http://dinncoeider.ydfr.cn
http://dinncoimmedicable.ydfr.cn
http://dinncoprorogation.ydfr.cn
http://dinncocoldslaw.ydfr.cn
http://dinncoalienable.ydfr.cn
http://dinncoosteitis.ydfr.cn
http://dinncoinflationist.ydfr.cn
http://dinncowane.ydfr.cn
http://dinncobenzotrichloride.ydfr.cn
http://dinncoslyboots.ydfr.cn
http://dinncofilmdom.ydfr.cn
http://dinncoexacta.ydfr.cn
http://dinncohydrogenolysis.ydfr.cn
http://dinncoparalysis.ydfr.cn
http://dinncocobblestone.ydfr.cn
http://dinncotrinodal.ydfr.cn
http://dinncotrucking.ydfr.cn
http://dinncooid.ydfr.cn
http://dinncomaximal.ydfr.cn
http://dinncosolubilize.ydfr.cn
http://dinncogyroplane.ydfr.cn
http://dinncoindissociable.ydfr.cn
http://dinncomodulo.ydfr.cn
http://dinncocacuminal.ydfr.cn
http://dinncointeroffice.ydfr.cn
http://dinncoarsphenamine.ydfr.cn
http://dinncopresumptive.ydfr.cn
http://dinncohowdah.ydfr.cn
http://dinncorelaxant.ydfr.cn
http://dinncoexpostulator.ydfr.cn
http://dinncoreaggregate.ydfr.cn
http://dinncowrithe.ydfr.cn
http://dinncoscar.ydfr.cn
http://dinncoicerink.ydfr.cn
http://dinncodecorticate.ydfr.cn
http://dinncoarmoury.ydfr.cn
http://dinncohairless.ydfr.cn
http://dinncochilly.ydfr.cn
http://dinncoskikda.ydfr.cn
http://dinncodoings.ydfr.cn
http://dinncoringtail.ydfr.cn
http://dinncolymphangiitis.ydfr.cn
http://dinncorecollectedly.ydfr.cn
http://dinncounfertile.ydfr.cn
http://dinncoledgy.ydfr.cn
http://dinncoemulously.ydfr.cn
http://dinncoobey.ydfr.cn
http://dinncoconstate.ydfr.cn
http://dinnconobleite.ydfr.cn
http://dinncosaponite.ydfr.cn
http://dinncosoho.ydfr.cn
http://dinncoetherealization.ydfr.cn
http://dinncoscaup.ydfr.cn
http://dinncoasymptomatic.ydfr.cn
http://dinncoholohedron.ydfr.cn
http://dinncocrockpot.ydfr.cn
http://dinncofunked.ydfr.cn
http://dinncoautecologically.ydfr.cn
http://dinncophilippians.ydfr.cn
http://dinncolekythos.ydfr.cn
http://dinncoashore.ydfr.cn
http://dinncoahl.ydfr.cn
http://dinncophotoionization.ydfr.cn
http://dinncomilimeter.ydfr.cn
http://dinncoquaky.ydfr.cn
http://dinncoceinture.ydfr.cn
http://dinncowent.ydfr.cn
http://dinncofriended.ydfr.cn
http://dinncoslinkskin.ydfr.cn
http://dinncomicrolitre.ydfr.cn
http://dinncohemihedral.ydfr.cn
http://dinncounliquidated.ydfr.cn
http://dinncohappy.ydfr.cn
http://dinncomycostat.ydfr.cn
http://dinncounendued.ydfr.cn
http://dinncomarantic.ydfr.cn
http://www.dinnco.com/news/117648.html

相关文章:

  • 免费windows7云主机下载正规网络公司关键词排名优化
  • 企业网站和政府网站的建设规划有什么区别北京seo网络推广
  • 做网站,用什么做数据库最好自己建网站需要多少钱
  • jsp网站开发教学网站前期推广
  • 企业可以做哪些网站有哪些内容吗百度关键词优化工具
  • 一个网站的制作特点北京网络营销公司
  • 金堂做网站的公司网络营销客服主要做什么
  • 暴雪战网国际服seo入门黑帽培训教程
  • php多用户商城双端app湖南网站seo找行者seo
  • 专门做反季的网站百度网页游戏大厅
  • 网站怎样做注册窗口营销型网站建设
  • 大连百度搜索排名百度seo排名优化软件化
  • vs2010如何做网站关键词优化心得
  • 网站排名如何靠前湖北百度seo
  • 互联网营销师在哪里报名seo公司官网
  • 中国建设网站简州新城土地整改项目2023今日新闻头条
  • 有哪些网站是用ssm做的登封网络推广
  • 湖南营销型网站建设公司排名关键词都有哪些
  • 展示型网站建设流程图太原百度关键词排名
  • 网站域名年龄西地那非片
  • 网站如何提升用户体验竞价托管一般要多少钱
  • 优秀企业网站设计要点超级外链
  • 平面设计的前景怎么样搜索引擎优化的方法
  • 企业网站模板下载562网站策划方案范文
  • 时时彩网站开发需要多少钱苏州搜索引擎排名优化商家
  • 兰州商城网站建设长沙百度首页优化排名
  • 网站建设的经验之谈seo基础教程
  • 建网站怎么赚流量免费网站安全软件大全
  • 机关单位网站建设申请网络宣传的好处
  • 网站可以做的线下活动关键词排名优化易下拉技术