临照无影 發表於 2024-10-14 16:17:00

iPortal部署之配置数据库,银河麒麟arm架构SP3系统中离线编译安装postgres、postgis

<h1>&nbsp;<strong><span style="font-family: 宋体">一、安装环境</span></strong></h1>
<p><span style="font-family: 宋体">准备</span><span style="font-family: Calibri">postgresql-11.2.tar.gz</span><span style="font-family: 宋体">、</span><span style="font-family: Calibri">postgis-2.5.0.tar.gz</span><span style="font-family: 宋体">文件,geos-3.6.1-12.ky10.aarch64.rpm包</span></p>
<p><span style="font-family: 宋体">最好准备一台有外网的机器,</span><span style="font-family: 宋体">如果遇到缺少的包,去有外网的机器下载,再考到内网机器里安装。</span></p>
<p><span style="font-family: 宋体">大部分安装都是编译安装,遵循配置、编译、安装这三步。</span></p>
<p><span style="font-family: 宋体">注意安装后的软件目录postgres用户要有权限访问</span></p>
<p><span style="font-family: 宋体">用命令</span></p>
<div class="cnblogs_code">
<pre><span style="color: rgba(0, 0, 255, 1)">cat</span> /etc/.kyinfo</pre>
</div>
<p>&nbsp;查询操作系统版本,本次测试版本为</p>
<p>dist_id=Kylin-Server-V10-SP3-General-Release-2303-arm64-2023-03-24 14:51:29</p>
<p>&nbsp;postgres、postgis源码下载地址</p>
<div class="cnblogs_code">
<pre>https:<span style="color: rgba(0, 128, 0, 1)">//</span><span style="color: rgba(0, 128, 0, 1)">www.postgresql.org/ftp/source/</span><span style="color: rgba(0, 0, 0, 1)">
https:</span><span style="color: rgba(0, 128, 0, 1)">//</span><span style="color: rgba(0, 128, 0, 1)">download.osgeo.org/postgis/source/</span></pre>
</div>
<pre><span style="font-family: 宋体, &quot;Songti SC&quot;; font-size: 18pt"><br><strong>二、使用ISO镜像作为本地源</strong></span></pre>
<pre>在开始之前,准备银河麒麟高级服务器操作系统V10的ISO镜像文件,例如Kylin-Server-V10-SP3-2403-Release-20240426-arm64.iso<br>去官网下载 https://www.kylinos.cn/<br>创建挂载路径并挂载ISO镜像</pre>
<div class="cnblogs_code">
<pre><span style="color: rgba(0, 0, 255, 1)">mkdir</span> -p /mnt/iso</pre>
</div>
<p>&nbsp; &nbsp; 挂载ISO镜像</p>
<div class="cnblogs_code">
<pre><span style="color: rgba(0, 0, 255, 1)">mount</span> -o loop -t iso9660 Kylin-Server-V10-SP3-2403-Release-20240426-arm64.iso /mnt/iso</pre>
</div>
<p>配置YUM源,备份原有的repo文件</p>
<div class="cnblogs_code">
<pre>cd /etc/<span style="color: rgba(0, 0, 255, 1)">yum</span>.repos.d/
<span style="color: rgba(0, 0, 255, 1)">mkdir</span><span style="color: rgba(0, 0, 0, 1)"> bak
</span><span style="color: rgba(0, 0, 255, 1)">mv</span> *.repo bak/</pre>
</div>
<p>创建新的repo文件,使用</p>
<div class="cnblogs_code">
<pre><span style="color: rgba(0, 0, 255, 1)">vi</span> kylin-Media.repo</pre>
</div>
<p>在文件中,添加以下内容:</p>
<div class="cnblogs_code">
<pre>
name</span>=kylin-<span style="color: rgba(0, 0, 0, 1)">Media
baseurl</span>=<span style="color: rgba(0, 0, 255, 1)">file</span>:<span style="color: rgba(128, 128, 128, 1)">///</span><span style="color: rgba(0, 128, 0, 1)">mnt/iso/</span>
gpgcheck=<span style="color: rgba(128, 0, 128, 1)">0</span><span style="color: rgba(0, 0, 0, 1)">
enabled</span>=<span style="color: rgba(128, 0, 128, 1)">1</span></pre>
</div>
<p>保存并退出编辑器</p>
<p>清理旧的YUM缓存</p>
<div class="cnblogs_code">
<pre><span style="color: rgba(0, 0, 255, 1)">yum</span> clean all</pre>
</div>
<p>生成新的YUM缓存</p>
<div class="cnblogs_code">
<pre><span style="color: rgba(0, 0, 255, 1)">yum</span> makecache</pre>
</div>
<p>最后,为了验证我们的本地源是否配置成功,我们可以使用yum list命令来查看所有可用的软件包:</p>
<div class="cnblogs_code">
<pre><span style="color: rgba(0, 0, 255, 1)">yum</span> list</pre>
</div>
<pre></pre>
<p><span style="font-family: 宋体; font-size: 2em">三、使用make方法安装posgresql</span></p>
<pre>安装这两个 yum&nbsp;install&nbsp;-y&nbsp;readline-devel&nbsp;zlib-devel&nbsp;如果缺少依赖,去查拿有外网的机器下载<br>解压postgresql-11.2.tar.gz<br>再解压目录,配置、编译、安装</pre>
<div class="cnblogs_code">
<pre>./configure --prefix=/usr/local/<span style="color: rgba(0, 0, 0, 1)">postgresql
</span><span style="color: rgba(0, 0, 255, 1)">make</span>
<span style="color: rgba(0, 0, 255, 1)">make</span> <span style="color: rgba(0, 0, 255, 1)">install</span> </pre>
</div>
<h1><span style="font-family: 宋体, &quot;Songti SC&quot;">四、创建用户postgres,用来启动postgres服务。</span></h1>
<div>创建postgres用户</div>
<div>
<div class="cnblogs_code">
<pre><span style="color: rgba(0, 0, 0, 1)">useradd postgres
</span><span style="color: rgba(0, 0, 255, 1)">passwd</span> postgres</pre>
</div>
</div>
<div>设置postgres安装目录权限</div>
<div><code class="sql plain">#首先创建一个文件夹,作为数据库的数据存储点</code>
<div class="line number2 index1 alt1">
<div class="cnblogs_code">
<pre><span style="color: rgba(0, 0, 255, 1)">mkdir</span> /usr/local/postgresql/<span style="color: rgba(0, 0, 0, 1)">data
</span><span style="color: rgba(0, 0, 255, 1)">chown</span> -R postgres /usr/local/postgresql</pre>
</div>
</div>
</div>
<pre>初始化数据库</pre>
<div class="cnblogs_code">
<pre>/usr/local/postgresql/bin/initdb -D /usr/local/postgresql/data -E UTF8</pre>
</div>
<pre>配置环境变量.bashrc</pre>
<div class="cnblogs_code">
<pre><span style="color: rgba(0, 0, 255, 1)">vi</span><span style="color: rgba(0, 0, 0, 1)"> .bashrc
export PGPORT</span>=<span style="color: rgba(128, 0, 128, 1)">6000</span><span style="color: rgba(0, 0, 0, 1)">
export PGUSER</span>=<span style="color: rgba(0, 0, 0, 1)">postgres
export PGHOME</span>=/usr/local/<span style="color: rgba(0, 0, 0, 1)">postgresql

export PGDATA</span>=/usr/local/postgresql/<span style="color: rgba(0, 0, 0, 1)">data

export PATH</span>=${PGHOME}/<span style="color: rgba(0, 0, 0, 1)">bin:${PATH}
LD_LIBRARY_PATH</span>=$PGHOME/lib:/usr/local/lib:/usr/local/lib64:/usr/lib64:$LD_LIBRARY_PATH</pre>
</div>
<p>–读取环境变量</p>
<div class="cnblogs_code">
<pre>source .bashrc</pre>
</div>
<p>启动数据库</p>
<div class="cnblogs_code">
<pre>/usr/local/postgresql/bin/pg_ctl -D /usr/local/postgresql/data -l logfile start</pre>
</div>
<p>停止数据库</p>
<div class="cnblogs_code">
<pre>/usr/local/postgresql/bin/pg_ctl stop -D /usr/local/postgresql/data -m fast</pre>
</div>
<h1><span style="font-family: 宋体, &quot;Songti SC&quot;">五、postgis安装</span></h1>
<p>新建posgtis下载目录,在目录下操作</p>
<p>如没有外网,从别的机器下载拷贝进行安装</p>
<h3>1.安装<span class="words-blog hl-git-1" data-tit="gdal" data-pretit="gdal">gdal</span></h3>
<div class="cnblogs_code">
<pre><span style="color: rgba(0, 0, 255, 1)">wget</span> http:<span style="color: rgba(0, 128, 0, 1)">//</span><span style="color: rgba(0, 128, 0, 1)">download.osgeo.org/gdal/2.2.4/gdal-2.2.4.tar.gz</span>
<span style="color: rgba(0, 0, 255, 1)">tar</span> xf gdal-<span style="color: rgba(128, 0, 128, 1)">2.2</span>.<span style="color: rgba(128, 0, 128, 1)">4</span>.<span style="color: rgba(0, 0, 255, 1)">tar</span><span style="color: rgba(0, 0, 0, 1)">.gz
cd gdal</span>-<span style="color: rgba(128, 0, 128, 1)">2.2</span>.<span style="color: rgba(128, 0, 128, 1)">4</span><span style="color: rgba(0, 0, 0, 1)">
.</span>/<span style="color: rgba(0, 0, 0, 1)">configure
</span><span style="color: rgba(0, 0, 255, 1)">make</span> -j <span style="color: rgba(128, 0, 128, 1)">10</span>
<span style="color: rgba(0, 0, 255, 1)">make</span> <span style="color: rgba(0, 0, 255, 1)">install</span> -j <span style="color: rgba(128, 0, 128, 1)">10</span></pre>
</div>
<h3>2.安装proj</h3>
<div class="cnblogs_code">
<pre><span style="color: rgba(0, 0, 255, 1)">wget</span> http:<span style="color: rgba(0, 128, 0, 1)">//</span><span style="color: rgba(0, 128, 0, 1)">download.osgeo.org/proj/proj-4.8.0.tar.gz</span>
<span style="color: rgba(0, 0, 255, 1)">tar</span> xf proj-<span style="color: rgba(128, 0, 128, 1)">4.8</span>.<span style="color: rgba(128, 0, 128, 1)">0</span>.<span style="color: rgba(0, 0, 255, 1)">tar</span><span style="color: rgba(0, 0, 0, 1)">.gz
cd proj</span>-<span style="color: rgba(128, 0, 128, 1)">4.8</span>.<span style="color: rgba(128, 0, 128, 1)">0</span><span style="color: rgba(0, 0, 0, 1)">
.</span>/<span style="color: rgba(0, 0, 0, 1)">configure
export PKG_CONFIG_PATH</span>=/usr/local/lib/<span style="color: rgba(0, 0, 0, 1)">pkgconfig
export LD_LIBRARY_PATH</span>=/usr/local/<span style="color: rgba(0, 0, 0, 1)">lib
</span><span style="color: rgba(0, 0, 255, 1)">make</span> -j <span style="color: rgba(128, 0, 128, 1)">10</span>
<span style="color: rgba(0, 0, 255, 1)">make</span> <span style="color: rgba(0, 0, 255, 1)">install</span> -j <span style="color: rgba(128, 0, 128, 1)">10</span></pre>
</div>
<p>如果报错:configure: error: cannot guess build type; you must specify one</p>
<p>参考https://blog.csdn.net/dragoo1/article/details/136484034解决</p>
<h3>3.安装geos</h3>
<p>下载 geos-3.6.1-12.ky10.aarch64.rpm</p>
<div class="cnblogs_code">
<pre>rpm -ivh geos-<span style="color: rgba(128, 0, 128, 1)">3.6</span>.<span style="color: rgba(128, 0, 128, 1)">1</span>-<span style="color: rgba(128, 0, 128, 1)">12</span>.ky10.aarch64.rpm</pre>
</div>
<h3>4.安装json-c</h3>
<div class="cnblogs_code">
<pre><span style="color: rgba(0, 0, 255, 1)">wget</span> https:<span style="color: rgba(0, 128, 0, 1)">//</span><span style="color: rgba(0, 128, 0, 1)">s3.amazonaws.com/json-c_releases/releases/json-c-0.13.1.tar.gz</span>
<span style="color: rgba(0, 0, 255, 1)">tar</span> -xf json-c-<span style="color: rgba(128, 0, 128, 1)">0.13</span>.<span style="color: rgba(128, 0, 128, 1)">1</span>.<span style="color: rgba(0, 0, 255, 1)">tar</span><span style="color: rgba(0, 0, 0, 1)">.gz
.</span>/autogen.<span style="color: rgba(0, 0, 255, 1)">sh</span><span style="color: rgba(0, 0, 0, 1)">
.</span>/<span style="color: rgba(0, 0, 0, 1)">configure
</span><span style="color: rgba(0, 0, 255, 1)">make</span> -j <span style="color: rgba(128, 0, 128, 1)">10</span>
<span style="color: rgba(0, 0, 255, 1)">make</span> <span style="color: rgba(0, 0, 255, 1)">install</span> -j <span style="color: rgba(128, 0, 128, 1)">10</span></pre>
</div>
<h3>5.安装<span class="words-blog hl-git-1" data-tit="protobuf" data-pretit="protobuf">protobuf-c</span></h3>
<div class="cnblogs_code">
<pre><span style="color: rgba(0, 0, 255, 1)">wget</span> https:<span style="color: rgba(0, 128, 0, 1)">//</span><span style="color: rgba(0, 128, 0, 1)">github.com/google/protobuf/releases/download/v2.6.1/protobuf-2.6.1.tar.gz</span>
<span style="color: rgba(0, 0, 255, 1)">tar</span> xvf protobuf-<span style="color: rgba(128, 0, 128, 1)">2.6</span>.<span style="color: rgba(128, 0, 128, 1)">1</span>.<span style="color: rgba(0, 0, 255, 1)">tar</span><span style="color: rgba(0, 0, 0, 1)">.gz
cd protobuf</span>-<span style="color: rgba(128, 0, 128, 1)">2.6</span>.<span style="color: rgba(128, 0, 128, 1)">1</span><span style="color: rgba(0, 0, 0, 1)">
.</span>/<span style="color: rgba(0, 0, 0, 1)">configure
</span><span style="color: rgba(0, 0, 255, 1)">make</span> -j <span style="color: rgba(128, 0, 128, 1)">10</span>
<span style="color: rgba(0, 0, 255, 1)">make</span><span style="color: rgba(0, 0, 0, 1)"> check
</span><span style="color: rgba(0, 0, 255, 1)">make</span> <span style="color: rgba(0, 0, 255, 1)">install</span> -j <span style="color: rgba(128, 0, 128, 1)">10</span>

<span style="color: rgba(0, 0, 255, 1)">wget</span> https:<span style="color: rgba(0, 128, 0, 1)">//</span><span style="color: rgba(0, 128, 0, 1)">github.com/protobuf-c/protobuf-c/releases/download/v1.2.1/protobuf-c-1.2.1.tar.gz</span>
<span style="color: rgba(0, 0, 255, 1)">tar</span> xvf protobuf-c-<span style="color: rgba(128, 0, 128, 1)">1.2</span>.<span style="color: rgba(128, 0, 128, 1)">1</span>.<span style="color: rgba(0, 0, 255, 1)">tar</span><span style="color: rgba(0, 0, 0, 1)">.gz
cd protobuf</span>-c-<span style="color: rgba(128, 0, 128, 1)">1.2</span>.<span style="color: rgba(128, 0, 128, 1)">1</span><span style="color: rgba(0, 0, 0, 1)">
export PKG_CONFIG_PATH</span>=/usr/local/lib/pkgconfig <span style="color: rgba(0, 128, 0, 1)">//</span><span style="color: rgba(0, 128, 0, 1)"> 指定protobuf.pc文件所在</span>
./<span style="color: rgba(0, 0, 0, 1)">configure
</span><span style="color: rgba(0, 0, 255, 1)">make</span> -j <span style="color: rgba(128, 0, 128, 1)">10</span>
<span style="color: rgba(0, 0, 255, 1)">make</span> <span style="color: rgba(0, 0, 255, 1)">install</span> -j <span style="color: rgba(128, 0, 128, 1)">10</span></pre>
</div>
<p>&nbsp;</p>
<h3>6.配置ldconfig</h3>
<p>cat /etc/ld.so.conf<br> </p>
<p>vim&nbsp;/etc/ld.so.conf</p>
<p>include ld.so.conf.d/*.conf</p>
<div class="cnblogs_code">
<p>/usr/local/gdal/lib/<br>/usr/local/proj/lib/<br>/usr/local/geos/lib/<br>/usr/local/postgresql/lib<br>/usr/local/lib</p>




</div>
<p>#保存退出</p>
<p>ldconfig</p>
<h3>7.安装postgis(./configure对应目录需校对)</h3>
<div class="cnblogs_code">
<pre><span style="color: rgba(0, 0, 255, 1)">wget</span> http:<span style="color: rgba(0, 128, 0, 1)">//</span><span style="color: rgba(0, 128, 0, 1)">download.osgeo.org/postgis/source/postgis-2.5.0.tar.gz</span>
<span style="color: rgba(0, 0, 255, 1)">tar</span> -xf postgis-<span style="color: rgba(128, 0, 128, 1)">2.5</span>.<span style="color: rgba(128, 0, 128, 1)">0</span>.<span style="color: rgba(0, 0, 255, 1)">tar</span><span style="color: rgba(0, 0, 0, 1)">.gz
cd postgis</span>-<span style="color: rgba(128, 0, 128, 1)">2.5</span>.<span style="color: rgba(128, 0, 128, 1)">0</span>/<span style="color: rgba(0, 0, 0, 1)">

.</span>/configure -prefix=/usr/local/postgis --with-geosconfig=/usr/bin/geos-config --with-projdir=/usr/local/share/proj --with-gdalconfig=/usr/local/bin/gdal-config--with-pgconfig=/usr/local/postgresql/bin/<span style="color: rgba(0, 0, 0, 1)">pg_config

</span><span style="color: rgba(0, 0, 255, 1)">make</span> -j <span style="color: rgba(128, 0, 128, 1)">10</span>
<span style="color: rgba(0, 0, 255, 1)">make</span> <span style="color: rgba(0, 0, 255, 1)">install</span> -j <span style="color: rgba(128, 0, 128, 1)">10</span></pre>
</div>
<p>&nbsp;</p>
<p>验证POSTGIS是否正确安装</p>
<div class="cnblogs_code">
<pre><span style="color: rgba(0, 0, 0, 1)"># 连接登录postgresql数据库
postgres</span><span style="color: rgba(128, 128, 128, 1)">=</span># psql <span style="color: rgba(128, 128, 128, 1)">-</span>U postgres <span style="color: rgba(128, 128, 128, 1)">-</span>h localhost <span style="color: rgba(128, 128, 128, 1)">-</span>d postgres <span style="color: rgba(128, 128, 128, 1)">-</span>p <span style="color: rgba(128, 0, 0, 1); font-weight: bold">5432</span><span style="color: rgba(0, 0, 0, 1)">
用户 postgres 的口令:
psql (</span><span style="color: rgba(128, 0, 0, 1); font-weight: bold">11.2</span><span style="color: rgba(0, 0, 0, 1)">)
输入 "help" 来获取帮助信息.

# 创建test数据库
postgres</span><span style="color: rgba(128, 128, 128, 1)">=</span># <span style="color: rgba(0, 0, 255, 1)">create</span> <span style="color: rgba(0, 0, 255, 1)">database</span><span style="color: rgba(0, 0, 0, 1)"> test;
</span><span style="color: rgba(128, 128, 128, 1)">&gt;</span> <span style="color: rgba(0, 0, 255, 1)">CREATE</span> <span style="color: rgba(0, 0, 255, 1)">DATABASE</span><span style="color: rgba(0, 0, 0, 1)">

# 切换test数据库
postgres</span><span style="color: rgba(128, 128, 128, 1)">=</span><span style="color: rgba(0, 0, 0, 1)"># \c test;
您现在已经连接到数据库 "test",用户 "postgres".

# 创建postgis扩展
test</span><span style="color: rgba(128, 128, 128, 1)">=</span># <span style="color: rgba(0, 0, 255, 1)">create</span><span style="color: rgba(0, 0, 0, 1)"> extension postgis;
</span><span style="color: rgba(0, 0, 255, 1)">CREATE</span><span style="color: rgba(0, 0, 0, 1)"> EXTENSION

# 查询全部扩展
test</span><span style="color: rgba(128, 128, 128, 1)">=</span># <span style="color: rgba(0, 0, 255, 1)">select</span><span style="color: rgba(0, 0, 0, 1)"> postgis_full_version();
postgis_full_version
</span><span style="color: rgba(0, 128, 128, 1)">--</span><span style="color: rgba(0, 128, 128, 1)">--------------------------------------------------------------------------------------------------------------------------------------------------------------</span>
POSTGIS<span style="color: rgba(128, 128, 128, 1)">=</span>"<span style="color: rgba(128, 0, 0, 1); font-weight: bold">3.1</span>.<span style="color: rgba(128, 0, 0, 1); font-weight: bold">0</span> <span style="color: rgba(128, 0, 0, 1); font-weight: bold">3.1</span>.<span style="color: rgba(128, 0, 0, 1); font-weight: bold">0</span>" <span style="color: rgba(255, 0, 0, 1)">[</span><span style="color: rgba(255, 0, 0, 1)">EXTENSION</span><span style="color: rgba(255, 0, 0, 1)">]</span> PGSQL<span style="color: rgba(128, 128, 128, 1)">=</span>"<span style="color: rgba(128, 0, 0, 1); font-weight: bold">110</span>" GEOS<span style="color: rgba(128, 128, 128, 1)">=</span>"<span style="color: rgba(128, 0, 0, 1); font-weight: bold">3.9</span>.<span style="color: rgba(128, 0, 0, 1); font-weight: bold">0</span><span style="color: rgba(128, 128, 128, 1)">-</span>CAPI<span style="color: rgba(128, 128, 128, 1)">-</span><span style="color: rgba(128, 0, 0, 1); font-weight: bold">1.14</span>.<span style="color: rgba(128, 0, 0, 1); font-weight: bold">1</span>" PROJ<span style="color: rgba(128, 128, 128, 1)">=</span>"<span style="color: rgba(128, 0, 0, 1); font-weight: bold">7.1</span>.<span style="color: rgba(128, 0, 0, 1); font-weight: bold">1</span>" LIBXML<span style="color: rgba(128, 128, 128, 1)">=</span>"<span style="color: rgba(128, 0, 0, 1); font-weight: bold">2.9</span>.<span style="color: rgba(128, 0, 0, 1); font-weight: bold">9</span>" LIBJSON<span style="color: rgba(128, 128, 128, 1)">=</span>"<span style="color: rgba(128, 0, 0, 1); font-weight: bold">0.12</span>" LIBPROTOBUF<span style="color: rgba(128, 128, 128, 1)">=</span>"<span style="color: rgba(128, 0, 0, 1); font-weight: bold">1.2</span>.<span style="color: rgba(128, 0, 0, 1); font-weight: bold">1</span>" WAGYU<span style="color: rgba(128, 128, 128, 1)">=</span>"<span style="color: rgba(128, 0, 0, 1); font-weight: bold">0.5</span>.<span style="color: rgba(128, 0, 0, 1); font-weight: bold">0</span><span style="color: rgba(0, 0, 0, 1)"> (Internal)"
(</span><span style="color: rgba(128, 0, 0, 1); font-weight: bold">1</span> 行记录)</pre>
</div>
<p>&nbsp;</p>
<p>配置数据库远程连接</p>
<p><span style="font-family: 宋体">要配置</span>PostgreSQL<span style="font-family: 宋体">以允许远程连接,请按照以下步骤操作:</span></p>
<p>&nbsp;</p>
<p><span style="font-family: 宋体">编辑</span>postgresql.conf<span style="font-family: 宋体">文件:</span></p>
<p><span style="font-family: 宋体">找到该文件(通常位于</span>/etc/postgresql/<span style="font-family: 宋体">版本</span><span style="font-family: Calibri">/main/</span><span style="font-family: 宋体">),并编辑它。取消注释或修改</span><span style="font-family: Calibri">listen_addresses</span><span style="font-family: 宋体">参数,设置为</span><span style="font-family: Calibri">'*'</span><span style="font-family: 宋体">以允许监听所有接口。</span></p>
<div class="cnblogs_code">
<pre>listen_addresses <span style="color: rgba(128, 128, 128, 1)">=</span> <span style="color: rgba(255, 0, 0, 1)">'</span><span style="color: rgba(255, 0, 0, 1)">*</span><span style="color: rgba(255, 0, 0, 1)">'</span></pre>
</div>
<p>&nbsp;</p>
<p><span style="font-family: 宋体">编辑</span>pg_hba.conf<span style="font-family: 宋体">文件:</span></p>
<p><span style="font-family: 宋体">同样找到该文件,并进行编辑。在文件末尾添加规则以允许远程连接:</span></p>
<div class="cnblogs_code">
<pre>host <span style="color: rgba(128, 128, 128, 1)">all</span> <span style="color: rgba(128, 128, 128, 1)">all</span> <span style="color: rgba(128, 0, 0, 1); font-weight: bold">0.0</span>.<span style="color: rgba(128, 0, 0, 1); font-weight: bold">0.0</span><span style="color: rgba(128, 128, 128, 1)">/</span><span style="color: rgba(128, 0, 0, 1); font-weight: bold">0</span> md5</pre>
</div>
<p>&nbsp;最后在客户端用navicat连一下测试一下</p>
<h1><span style="font-family: 宋体, &quot;Songti SC&quot;">六、配置超图iportal</span></h1>
<p>postgres中新建iportal数据库</p>
<p>执行下面两个命令</p>
<div class="cnblogs_code">
<pre>./psql -U postgres -d iportal -f /usr/local/postgresql/share/contrib/postgis-<span style="color: rgba(128, 0, 128, 1)">2.5</span>/<span style="color: rgba(0, 0, 0, 1)">postgis.sql
.</span>/psql -U postgres -d iportal -f /usr/local/postgresql/share/contrib/postgis-<span style="color: rgba(128, 0, 128, 1)">2.5</span>/spatial_ref_sys.sql</pre>
</div>
<p>剩下的按照超图帮助文档来</p>
<h1><span style="font-family: 宋体, &quot;Songti SC&quot;">七、其他的辅助命令</span></h1>
<p>查看所有运行的端口</p>
<div class="cnblogs_code">
<pre><span style="color: rgba(0, 0, 255, 1)">sudo</span> ss -tuln</pre>
</div>
<p>查看端口占用情况</p>
<div class="cnblogs_code">
<pre data-eusoft-translate-failed-en="1">netstat -tulnp | <span style="color: rgba(0, 0, 255, 1)">grep</span> <span style="color: rgba(128, 0, 128, 1)">8190</span>
#iportal常用端口,shutdown.sh运行后需要多等一会,如果shutdown.sh执行完,进程杀不掉,手动清理以下端口
<span style="color: rgba(128, 0, 128, 1)">8190</span>
<span style="color: rgba(128, 0, 128, 1)">8195</span>
<span style="color: rgba(128, 0, 128, 1)">8292</span>
<span style="color: rgba(128, 0, 128, 1)">38194</span><span class="eusoft-eudic-chrome-extension-translate-content"><span class="eusoft-eudic-translate-error-tag ng-star-inserted"><br></span></span></pre>
</div>
<p>&nbsp;包安哪找不着了,用</p>
<div class="cnblogs_code">
<pre><span style="color: rgba(0, 0, 255, 1)">find</span> /usr -<span style="color: rgba(0, 0, 0, 1)">name 包名
</span><span style="color: rgba(0, 0, 255, 1)">find</span> /opt -name 包名</pre>
</div>
<p>&nbsp;</p><br><br>
来源:https://www.cnblogs.com/webgis-mc/p/18464440
頁: [1]
查看完整版本: iPortal部署之配置数据库,银河麒麟arm架构SP3系统中离线编译安装postgres、postgis