centos 安装 jdk PostgreSQL
1.下载:
anzhuang jDK
http://blog.csdn.net/youzhouliu/article/details/51183115
-------------------------------
http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html
http://www.cnblogs.com/tjpanda88/p/4306149.html
---------------------------------------------------------------------------------------------------------------
2.//官方安装_Postgresql
https://www.postgresql.org/download/linux/redhat/
3.//博客安装过程
http://blog.csdn.net/lk10207160511/article/details/50359549
http://www.jianshu.com/p/7e95fd0bc91a
1.添加RPM
[root@localhost ~]# yum install https://download.postgresql.org/pub/repos/yum/9.5/redhat/rhel-7-x86_64/pgdg-centos95-9.5-2.noarch.rpm
Loaded plugins: fastestmirror, langpacks
pgdg-centos95-9.5-.noarch.rpm | 5.3 kB :
Examining /var/tmp/yum-root-a5MmUk/pgdg-centos95-9.5-.noarch.rpm: pgdg-centos95-9.5-.noarch
Marking /var/tmp/yum-root-a5MmUk/pgdg-centos95-9.5-.noarch.rpm to be installed
Resolving Dependencies
--> Running transaction check
---> Package pgdg-centos95.noarch :9.5- will be installed
--> Finished Dependency Resolution Dependencies Resolved ================================================================================
Package Arch Version Repository Size
================================================================================
Installing:
pgdg-centos95 noarch 9.5- /pgdg-centos95-9.5-.noarch 2.2 k Transaction Summary
================================================================================
Install Package Total size: 2.2 k
Installed size: 2.2 k
Is this ok [y/d/N]: y
Downloading packages:
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Warning: RPMDB altered outside of yum.
** Found pre-existing rpmdb problem(s), 'yum check' output follows:
ipa-client-4.4.-.el7.centos.x86_64 has installed conflicts freeipa-client: ipa-client-4.4.-.el7.centos.x86_64
ipa-client-common-4.4.-.el7.centos.noarch has installed conflicts freeipa-client-common: ipa-client-common-4.4.-.el7.centos.noarch
ipa-common-4.4.-.el7.centos.noarch has installed conflicts freeipa-common: ipa-common-4.4.-.el7.centos.noarch
:java-1.8.-openjdk-headless-1.8.0.102-.b14.el7.x86_64 has missing requires of tzdata-java >= ('', '2015d', None)
Installing : pgdg-centos95-9.5-.noarch /
Verifying : pgdg-centos95-9.5-.noarch / Installed:
pgdg-centos95.noarch :9.5- Complete! 2.安装PostgreSQL 9.5 [root@localhost ~]# yum install postgresql95-server postgresql95-contrib
Loaded plugins: fastestmirror, langpacks
Repository pgdg95 is listed more than once in the configuration
Repository pgdg95-source is listed more than once in the configuration
Loading mirror speeds from cached hostfile
* base: mirrors.cn99.com
* extras: mirrors.aliyun.com
* updates: mirrors.aliyun.com
Resolving Dependencies
--> Running transaction check
---> Package postgresql95-contrib.x86_64 :9.5.-2PGDG.rhel7 will be installed
--> Processing Dependency: postgresql95-libs(x86-) = 9.5.-2PGDG.rhel7 for package: postgresql95-contrib-9.5.-2PGDG.rhel7.x86_64
--> Processing Dependency: postgresql95(x86-) = 9.5.-2PGDG.rhel7 for package: postgresql95-contrib-9.5.-2PGDG.rhel7.x86_64
--> Processing Dependency: libpq.so.()(64bit) for package: postgresql95-contrib-9.5.-2PGDG.rhel7.x86_64
---> Package postgresql95-server.x86_64 :9.5.-2PGDG.rhel7 will be installed
--> Running transaction check
---> Package postgresql95.x86_64 :9.5.-2PGDG.rhel7 will be installed
---> Package postgresql95-libs.x86_64 :9.5.-2PGDG.rhel7 will be installed
--> Finished Dependency Resolution Dependencies Resolved ================================================================================
Package Arch Version Repository Size
================================================================================
Installing:
postgresql95-contrib x86_64 9.5.-2PGDG.rhel7 pgdg95 k
postgresql95-server x86_64 9.5.-2PGDG.rhel7 pgdg95 4.1 M
Installing for dependencies:
postgresql95 x86_64 9.5.-2PGDG.rhel7 pgdg95 1.3 M
postgresql95-libs x86_64 9.5.-2PGDG.rhel7 pgdg95 k Transaction Summary
================================================================================
Install Packages (+ Dependent packages) Total size: 6.1 M
Total download size: k
Installed size: M
Is this ok [y/d/N]: y
Downloading packages:
pgdg95//x86_64/prestodelta | kB :
postgresql95-contrib-9.5.-2PGDG.rhel7.x86_64.rpm | kB :
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : postgresql95-libs-9.5.-2PGDG.rhel7.x86_64 /
Installing : postgresql95-9.5.-2PGDG.rhel7.x86_64 /
Installing : postgresql95-contrib-9.5.-2PGDG.rhel7.x86_64 /
Installing : postgresql95-server-9.5.-2PGDG.rhel7.x86_64 /
Verifying : postgresql95-contrib-9.5.-2PGDG.rhel7.x86_64 /
Verifying : postgresql95-server-9.5.-2PGDG.rhel7.x86_64 /
Verifying : postgresql95-libs-9.5.-2PGDG.rhel7.x86_64 /
Verifying : postgresql95-9.5.-2PGDG.rhel7.x86_64 / Installed:
postgresql95-contrib.x86_64 :9.5.-2PGDG.rhel7
postgresql95-server.x86_64 :9.5.-2PGDG.rhel7 Dependency Installed:
postgresql95.x86_64 :9.5.-2PGDG.rhel7
postgresql95-libs.x86_64 :9.5.-2PGDG.rhel7 Complete!
3.初始化数据库 [root@localhost ~]# /usr/pgsql-9.5/bin/postgresql95-setup initdb
Initializing database ... OK
4.设置开机自启动 [root@localhost ~]# systemctl enable postgresql-9.5
Created symlink from /etc/systemd/system/multi-user.target.wants/postgresql-9.5.service to /usr/lib/systemd/system/postgresql-9.5.service.
5.启动服务
[root@localhost ~]# systemctl start postgresql-9.5
[root@localhost ~]# systemctl status postgresql-9.5
● postgresql-9.5.service - PostgreSQL 9.5 database server
Loaded: loaded (/usr/lib/systemd/system/postgresql-9.5.service; enabled; vendor preset: disabled)
Active: active (running) since 一 -- :: CST; 49s ago
Process: ExecStart=/usr/pgsql-9.5/bin/pg_ctl start -D ${PGDATA} -s -w -t (code=exited, status=/SUCCESS)
Process: ExecStartPre=/usr/pgsql-9.5/bin/postgresql95-check-db-dir ${PGDATA} (code=exited, status=/SUCCESS)
Main PID: (postgres)
CGroup: /system.slice/postgresql-9.5.service
├─ /usr/pgsql-9.5/bin/postgres -D /var/lib/pgsql/9.5/data
├─ postgres: logger process
├─ postgres: checkpointer process
├─ postgres: writer process
├─ postgres: wal writer process
├─ postgres: autovacuum launcher process
└─ postgres: stats collector process 3月 :: localhost.localdomain systemd[]: Starting PostgreSQL 9.5 da...
3月 :: localhost.localdomain pg_ctl[]: < -- ::27.60…程
3月 :: localhost.localdomain pg_ctl[]: < -- ::27.60….
3月 :: localhost.localdomain systemd[]: Started PostgreSQL 9.5 dat...
Hint: Some lines were ellipsized, use -l to show in full.
//自此,PostgreSQL 9.5 安装完成,此过程中注意安装权限,我在安装过程中一直使用的是root用户进行的安装。 [root@localhost ~]# psql --version
psql (PostgreSQL) 9.5.6 接下来,进行一下简单的配置。 //su postgres 切换用户,执行后提示符会变为 '-bash-4.2$'
[root@localhost ~]# su postgres //登录数据库,执行后提示符变为
bash-4.2$ psql -U postgres
could not change directory to "/root": Permission denied
psql (9.5.)
Type "help" for help.
//设置postgres用户密码
postgres=# alter user postgres with password 'postgres123' //退出数据库
postgres-# \q
//系统管理用的帐号和密码变更完成,现在配置一下远程连接 可以参考:http://www.jianshu.com/p/7e95fd0bc91a或者http://www.cnblogs.com/Amos-Turing/p/7681323.html
.开启远程访问
vi /var/lib/pgsql/9.5/data/postgresql.conf
修改#listen_addresses = 'localhost' 为 listen_addresses='*'
当然,此处‘*’也可以改为任何你想开放的服务器IP
//远程连接配置完成,由于系统原因,还需要在防火墙中打开相应的端口。
bash-4.2$ firewall-cmd --list-all
public (active)
target: default
icmp-block-inversion: no
interfaces: wlp4s0
sources:
services: dhcpv6-client ssh
ports:
protocols:
masquerade: no
forward-ports:
sourceports:
icmp-blocks:
rich rules:
//开放postgresql服务
bash-4.2$ firewall-cmd --add-service=postgresql --permanent
success
//重载防火墙
bash-4.2$ firewall-cmd --reload
success
bash-4.2$ firewall-cmd --list-all
public (active)
target: default
icmp-block-inversion: no
interfaces: wlp4s0
sources:
services: dhcpv6-client postgresql ssh
ports:
protocols:
masquerade: no
forward-ports:
sourceports:
icmp-blocks:
rich rules:
//最后一步,不能忘记的,是重启数据库服务,使配置生效。
bash-4.2$ systemctl restart postgresql-9.5.service
bash-4.2$
卸载数据库:
http://www.cnblogs.com/tjpanda88/p/4306149.html4:
http://www.educity.cn/linux/1581284.html
---------------------------------------------------------------------------------------------------------------
centos 安装 jdk PostgreSQL的更多相关文章
- Linux安装Jdk,CentOS安装Jdk
Linux安装Jdk,CentOS安装Jdk >>>>>>>>>>>>>>>>>>>& ...
- 搭建centos测试环境:window安装xshell,WinSCP 。 centos安装jdk tomcat
通过ssh实现远程访问linux系统: 由于xshell 连接centos,需要centos开启ssh服务.所以先启动SSH服务,没有ssh需要先安装. 1 . 查看SSH是否安装命令:rpm -qa ...
- java环境变量 windows centos 安装jdk
windows: 1.安装jdk,注意不是jre 2. 计算机→属性→高级系统设置→高级→环境变量,选择下面的那个系统环境变量 3. 系统变量→新建 JAVA_HOME 变量 . 变量值填写jdk的安 ...
- CentOS安装JDK 8
准备工作 首先,更新包: yum update 检查服务器上是否已安装旧版本的Java: java -version 如果有旧版本的Java则移除: yum remove java-1.6.0-ope ...
- CentOS安装jdk的三种方法
方法一:手动解压JDK的压缩包,然后设置环境变量 方法二:用yum安装JDK,(全称为 Yellow dog Updater, Modified)是一个在Fedora和RedHat以及CentOS中的 ...
- CentOS安装JDK的三种办法
方法一:手动解压JDK的压缩包,然后设置环境变量 1.在/usr/目录下创建java目录 [root@localhost ~]# mkdir/usr/java[root@localhost ~]# c ...
- Centos安装JDK(java环境)
王小私下问我 centos 中 jdk 怎么安装呀,所以再次整理了这篇基础环境搭建的文章. 1.创建java目录2.下载上传jdk3.解压jdk4.配置环境变量 1.创建java目录 首先我们创建ja ...
- Centos——安装JDK
写在前面: Just mark! 创建linux虚拟机的时候经常要安装JDK,配置环境变量,却又经常忘记,这里记录一下. 环境:Centos-6.8-x86_64-minimal JDK :jdk-7 ...
- Centos 安装jdk jre
下载rpm http://www.oracle.com/technetwork/cn/java/javase/downloads/jdk7-downloads-1880260.html wget ht ...
随机推荐
- perl学习笔记——输入与输出
读取标准输入 用<STDIN>进行标准输入:chomp($line=<STDIN>); 如果读到文件尾,行输入操作符就会返回undef.便可利用这一性质跳出循环. while( ...
- POJ 2029 Get Many Persimmon Trees (二维树状数组)
Get Many Persimmon Trees Time Limit:1000MS Memory Limit:30000KB 64bit IO Format:%I64d & %I ...
- c语言用rand() 函数,实现random(int m)
函数rand()是真正的随机数生成器.而srand()会设置供rand()使用的随机数种子. 假设你在第一次调用rand()之前没有调用srand(),那么系统会为你自己主动调用srand(). 注意 ...
- 【BIEE】BI Publisher下拉菜单设置
在使用BIEE的过程中,通常会有需要根据下拉菜单所选内容进行数据展示,如下图所示: 设置参数 进入数据模型编辑界面→参数 新增参数,P_DATADATE为示例参数 参数赋值 同时点击"值列表 ...
- Web用户的身份验证及WebApi权限验证流程的设计和实现(尾)
5. WebApi 服务端代码示例 5.1 控制器基类ApiControllerBase [csharp] view plaincopy /// /// Controller的基类,用于实现适合业 ...
- 网站拓扑图(来自qq)
- Android下缓存以及解决OOM问题
1 http://my.oschina.net/ryanhoo/blog/93285 开篇来个简单的后续的慢慢补充 2 http://www.apkbus.com/forum.php?mod=view ...
- [django] 利用多线程添加异步任务
看到django异步大家的反应应该是celery这样的消息队列组件.如今用的最多的最推荐的也是这样的方式.然而我这需求就是请求来了,运行一个小程序.可是又不能确定这个小程序啥时候运行完.响应又要及时, ...
- call_user_func — 把第一个参数作为回调函数调用
call_user_func — 把第一个参数作为回调函数调用 说明 mixed call_user_func ( callable $callback [, mixed $parameter [, ...
- oracle分区表和分区索引概述
㈠ 分区表技术概述 ⑴ Range 分区 ① 例子 create table t (...列定义...) ...