Open source database | record a practice process based on the Kunpeng Euler operating system openGauss

Introduction | Kunpeng Certification-openEuler OS-openGauss Database 

Opening: In the words written above, each excerpt starts from the actual case scenario. Take time off on weekends to record each mark process. Technical solutions. No matter how small a technical solution is, it has a different meaning in its corresponding scene. Practice is the only criterion for testing the truth. Participating in the discussion after the real practice may give you some new discoveries. I hope that readers will think a little differently from IDea. Welcome to join who is keen to embrace new knowledge. Technical exchange + experience sharing -> translate some knowledge every day.

Information: After Hongmeng, the operating system based on the openEuler commercial version was officially launched, and the Kunpeng computing ecosystem developed rapidly. Kunpeng 920 series server CPUs, Kunpeng 920 processors are compatible with the ARM architecture, have innovative breakthroughs in performance and throughput, and support domestic-computing Pushing to a new height, not only the CPU, but also the operating system supporting Euler openEuler, Kirin Kylin, and Hongmeng are all around us.

Below, the editor mainly uses Kunpeng certification -> database openGauss as an example -> FAQ QA to explain:

First, obtain relevant environmental information of Kunpeng ,

Continue to read, FAQ operation manual ,

( Note: For Kunpeng operating system and installation, remote terminal connection, please refer to the above FAQ manual, which will not be elaborated in this article.)

Then, connect to the Kunpeng cloud host through tools like terminal Xshell or Xftp ,

Create a package folder and authorize it,

mkdir -p /home/softchmod 755 -R /home/soft

Create the current deployment path and authorize,

mkdir /home/opengausschmod 777 /home/opengauss

Query the current operating system information,

cat /etc/os-release

Query the current hardware environment - Kunpeng architecture server,

lscpu

Enter the software installation package file path, download the openGauss installation package,

cd /home/softwget https://opengauss.obs.cn-south-1.myhuaweicloud.com/1.0.0/arm/openGauss-1.0.0-openEuler-64bit.tar.gz

Enter the current deployment path, unzip the openGauss installation package,

cd /home/opengausstar -zxvf openGauss-1.0.0-openEuler-64bit.tar.gz

Enter the command, yum install auxiliary installation package,

yum install -y bzip2 libaio-devel flex bison ncurses-devel glibc-devel patch

( Note: Before initializing the openGauss installation environment + python environment, you can check it in advance. For more information, please refer to the official abstract of openGauss , and the performance.sh script modification + LD_LIBRARY_PATH environment variable configuration can also be referred to . )

export LD_LIBRARY_PATH=/home/opengauss/script/gspylib/clib:$LD_LIBRARY_PATHhttps://opengauss.org/en/docs/1.0.0/docs/installation/initializing-the-installation-environment.html#initializing-the-installation-environmenta-nameen-us_topic_0249784559a

The system default python version,

Among them, the python version matches and can be modified according to the current environment reference.

vi gspylib/common/CheckPythonVersion.pyif not pythonVersion == (3, 6)更新为if not pythonVersion >= (3, 6)

Create a clusterconfig.xml file under the script folder,

vi script/clusterconfig.xml<?xml version="1.0" encoding="UTF-8"?><ROOT>    <!-- openGauss信息 -->    <CLUSTER>        <PARAM name="clusterName" value="opengauss_cluster" />        <PARAM name="nodeNames" value="opengauss_node1" />        <PARAM name="backIp1s" value="ip"/>        <PARAM name="gaussdbAppPath" value="/home/opengauss/install/app" />        <PARAM name="gaussdbLogPath" value="/var/log/omm" />        <PARAM name="tmpMppdbPath" value="/home/opengauss/tmp" />        <PARAM name="gaussdbToolPath" value="/home/opengauss/install/om" />        <PARAM name="corePath" value="/home/opengauss/corefile" />        <!-- openGauss 类型簇类型。该参数是可选的。single-inst表示一个主节点多个备节点的独立集群。-->        <PARAM name="clusterType" value="single-inst"/>    </CLUSTER>    <DEVICELIST>        <!-- opengauss_node1节点信息 -->        <DEVICE sn="1000001">             <!-- 主机名。-->            <PARAM name="name" value="opengauss_node1"/>             <!-- AZ 名称。该值为字符串,不能包含特殊字符,例如AZ1、AZ2、AZ3。-->            <PARAM name="azName" value="AZ1"/>             <!-- AZ优先。-->            <PARAM name="azPriority" value="1"/>            <!-- 如果服务器只有一个网卡可用,将backIP1和sshIP1配置成同一个IP。后端存储网络中主机的内网IP地址,所有的 openGauss 主机都在这个网络上相互通信。-->            <PARAM name="backIp1" value="ip"/>             <!-- SSH可靠通道的外部IP地址。如果没有使用外部网络,您可以将其留空或将其设置为backIp1的值。-->            <PARAM name="sshIp1" value="ip"/>                         <!--dbnode1-->             <!-- 当前主机上要部署的数据库节点数。-->             <PARAM name="dataNum" value="1"/>             <!-- 数据库节点的基本端口号。默认值为40000。-->             <PARAM name="dataPortBase" value="15400"/>             <!-- 当前主机上存储数据库节点数据的目录。它是一个数据存储目录,应该在数据盘上。-->             <PARAM name="dataNode1" value="/home/opengauss/install/data/db1"/>             <!-- 当前集群中同步模式的节点数。该参数是可选的。取值范围为 0 到备用数据库节点数。-->             <PARAM name="dataNode1_syncNum" value="0"/>        </DEVICE>    </DEVICELIST></ROOT>

Next, initialize the installation environment,

./gs_preinstall -U omm -G dbgrp -X /home/opengauss/script/clusterconfig.xml

( Note: Children’s shoes are welcome to leave a message^_^. Due to time and other reasons, the explanation may not be complete. For the localization, there are few available search resources. I hope that for all readers, after adapting Kunpeng-Kirin, Euler operating system and It can be helpful in the process of localizing the database, and will continue to improve the technical manual - sharing, covering Java microservices + Kafka + Reids + Elastic middleware installation FAQ manual.)

// 驱动-连接地址-账号-密码等信息String driverClassName = "org.postgresql.Driver";String url = "jdbc:postgresql://ip:8000/postgres";String username = "yxd179";String password = "yxd179";// 加载驱动Class.forName(driverClassName);// 获取数据库连接对象Connection con = (Connection) DriverManager.getConnection(url,username,password);// 获取数据库操作对象PreparesStatement ps = con.preparesStatement("SELECT COUNT(*) FROM TEST;");// 执行sqlResultSet rs= ps.executeQuery();// 这里还可以获取到数据库产品名称DatabaseMetaData metaData = (DatabaseMetaData) con.getMetaData();// 这里为国产数据库-适配,在xml指定国产数据库的databaseId奠定基础System.out.println("数据库产品名称:" + metaData.getDatabaseProductName());最后需关闭连接close,释放资源->rs-ps-con. 

At the end of the article: write something off-topic, leading to such a little thought,

1. What time do you think sleep counts as staying up late? Are you staying up late?

2. Open your mind, why can't you find aliens? Advanced civilizations have escaped into the virtual world, perhaps the server is placed under the 2,000-meter ice layer in Antarctica to cool down naturally.

To review more highlights, please click ^_^, remember a domestic database adaptation thinking process-Dameng


"Past Articles"

Database Online Training Platform-MySQL

Kunpeng Certification | Migrating from Oracle to MySQL for Multi-database Switching

MySQL optimization case | View SQL statement execution plan

Sub-table sub-library | Horizontal split VS vertical split

Elasticsearch read and write data working principle | MySQL duplicate data insertion processing

Elasticsearch Advanced | Remember kibana's actual combat process of executing dsl scripts

Kafka | Remember to repair the downtime failure of the broker where the Kafka partition is located-the thinking process that caused the current partition to be unavailable

Open source database | record a practice process based on the Kunpeng Euler operating system openGauss

Serialization | Google's Gson and Alibaba's FastJson mechanism

Guess you like

Origin blog.csdn.net/yxd179/article/details/121793532