Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gisEnv
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
徐鸿
gisEnv
Commits
675fc3c0
Commit
675fc3c0
authored
Apr 11, 2022
by
root
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
modify postgresql install
parent
a2a2753e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
69 deletions
+5
-69
postgresql-10.5.tar.gz
postgresql-10.5.tar.gz
+0
-0
postgresql.sh
postgresql.sh
+5
-69
No files found.
postgresql-10.5.tar.gz
deleted
100644 → 0
View file @
a2a2753e
File deleted
postgresql.sh
View file @
675fc3c0
#!/bin/bash
mv
./postgresql-10.5.tar.gz /usr/gisdeploy
cd
/usr/gisdeploy
tar
zxvf postgresql-10.5.tar.gz
echo
"pgsql tar sucess"
#is postgres exist
id
$postgres
>
& /dev/null
if
[
$?
==
0
]
then
echo
"create postgres"
groupadd postgres
useradd
-g
postgres postgres
fi
echo
"enter postgresql dir"
rm
/usr/gisdeploy/postgresql-10.5.tar.gz
-rf
mv
/usr/gisdeploy/postgresql-10.5 /usr/gisdeploy/pgsql/
cd
/usr/gisdeploy/pgsql/
#-------------------------------pgsql------------------------------------
echo
"install lib"
yum
install
-y
zlib zlib-devel
>
& /dev/null
echo
"configure"
./configure
--prefix
=
/usr/gisdeploy/pgsql
--without-readline
if
[
$?
==
0
]
then
echo
"configure finish make"
make
if
[
$?
==
0
]
then
echo
"start make"
make
install
if
[
$?
!=
0
]
;
then
echo
"make install fail"
fi
echo
"make install sucess"
else
echo
"make fail"
fi
else
echo
"configure check error"
fi
echo
"configure pgsql"
echo
"create pgsql data dir"
mkdir
-p
/usr/gisdeploy/pgsql/data
echo
"modify group"
chown
-R
postgres:postgres /usr/gisdeploy/pgsql
echo
"add env"
cd
/home/postgres
if
[
-f
.bash_profile
]
;
then
cp
.bash_profile .bash_profile.bak
echo
"export PGHOME=/usr/gisdeploy/pgsql"
>>
.bash_profile
echo
"export PGDATA=/usr/gisdeploy/pgsql/data"
>>
.bash_profile
echo
"PATH=
$PGHOME
/bin:
$PATH
"
>>
.bash_profile
echo
"MANPATH=
$PGHOME
/share/man:
$MANPATH
"
>>
.bash_profile
echo
"LD_LIBRARY_PATH=
$PGHOME
/lib:
$LD_LIBRARY_PATH
"
>>
.bash_profile
fi
alias
pg_start
=
'pg_ctl -D $PGDATA -l /usr/gisdeploy/pgsql/logfile start'
alias
ps_stop
=
'pg_ctl -D $PGDATA -l /usr/gisdeploy/pgsql/logfile stop'
echo
"postgres init"
yum
install
-y
epel-release
sudo
yum
install
-y
https://download.postgresql.org/pub/repos/yum/reporpms/EL-7-x86_64/pgdg-redhat-repo-latest.noarch.rpm
sudo
yum
install
-y
postgresql110-server
sudo
yum
install
-y
postgis25_10.x86_64
sudo
yum
install
-y
pgrouting_10.x86_64
sudo
firewall-cmd
--zone
=
public
--add-port
=
5432/tcp
--permanent
su - postgres
-c
"/usr/local/pgsql/bin/initdb -D /usr/local/pgsql/data --locale=zh_CN.UTF-8 -E UTF-8"
su - postgres
-c
"/usr/gisdeploy/pgsql/bin/pg_ctl -D /usr/gisdeploy/pgsql/data -l logfile start"
echo
"---------------------------------------------------------------------------------------"
echo
"---------------------------------------------------------------------------------------"
echo
"----------------------------finish-------------------------"
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment