MPP 一、Greenplum 集群安裝

来源:http://www.cnblogs.com/lanston/archive/2017/05/30/installating_and_initializing_Greenplumdb.html
-Advertisement-
Play Games

Installating and Initializing a Greenplum Database System... 1 安裝說明 1.1 環境說明 1.2 集群說明 2 準備工作 2.1 Linux用戶 在所有節點上創建greenplum管理員用戶。 2.2 主機名和hosts配置 相同的配置 ...


Installating and Initializing a Greenplum Database System...

1 安裝說明

1.1 環境說明

名稱版本下載地址
虛擬機 Oracle VirtualBox 4.3.10 http://www.virtualbox.org
操作系統 CentOS 6.7 64bit https://www.centos.org
greenplum 5.0.0-alpha.5 https://network.pivotal.io/products/pivotal-gpdb
文件系統 ext4  

1.2 集群說明

角色數量主機名IP
Greenplum Master 1 gp-master 192.168.56.10
Greenplum Standby
Greenplum Segment 3 gp-sdw1、gp-sdw2、gp-sdw1 192.168.56.12、192.168.56.14、192.168.56.16

2 準備工作

2.1 Linux用戶

在所有節點上創建greenplum管理員用戶。

groupadd -g 530 gpadmin
useradd -g 530 -u 530 -m -d /home/gpadmin -s /bin/bash gpadmin
chown -R gpadmin:gpadmin /home/gpadmin
echo "gpadmin" | passwd --stdin gpadmin

2.2 主機名和hosts配置

相同的配置先在一個節點上配置,配置完成後在2.6小節中複製到其它節點上。

vi /etc/hosts

192.168.56.10 gp-master
192.168.56.12 gp-sdw1
192.168.56.14 gp-sdw2
192.168.56.16 gp-sdw3

分別對應每一臺主機修改主機名;

vi /etc/sysconfig/network

2.3 防火牆

禁用防火牆;

vi /etc/selinux/config

SELINUX=disabled

service iptables stop
chkconfig iptables off

查看防火牆狀態 service iptables status

2.4 系統資源配置

vi /etc/sysctl.conf

kernel.shmmni = 4096
kernel.shmall = 4000000000
kernel.sem = 250 512000 100 2048
kernel.sysrq = 1
kernel.core_uses_pid = 1
kernel.msgmnb = 65536
kernel.msgmax = 65536
kernel.msgmni = 2048
net.ipv4.tcp_syncookies = 1
net.ipv4.ip_forward = 0
net.ipv4.tcp_tw_recycle = 1
net.ipv4.tcp_max_syn_backlog = 4096
net.ipv4.conf.defalut.arp_filter = 1
net.ipv4.ip_local_port_range = 1025 65535
net.core.netdev_max_backlog = 10000
net.core.rmem_max = 2097152
net.core.wmem_max = 2097152
#vm.overcommit_memory = 2     ### 測試環境要取消這個,否則oracle啟不來 ### 值為1

使資源文件生效;

sysctl -p

進程數配置;

vi /etc/security/limits.d/90-nproc.conf

*          soft    nproc     131072
root       soft    nproc     unlimited

2.5 暫時啟用gpadmin sudo

因為後面的集群節點上安裝greenplum時會涉及到創建目錄和文件操作,在此臨時啟用sudo,安裝成功後撤銷。

visudo

gpadmin    ALL=(ALL)       ALL
gpadmin    ALL=(ALL)       NOPASSWD:ALL

2.6 複製配置文件到所有節點上

scp /etc/hosts gp-sdw1:/etc
scp /etc/sysctl.conf gp-sdw1:/etc
scp /etc/security/limits.d/90-nproc.conf gp-sdw1:/etc/security/limits.d
scp /etc/selinux/config gp-sdw1:/etc/selinux

重啟操作系統。

3 安裝Greenplum DB

3.1 在Master節點上安裝Greenplum DB

首先在master節點上安裝,設置安裝路徑為/opt/greenplum/greenplum-db-5.0.0-alpha.5;

cd /tmp
unzip greenplum-db-5.0.0-alpha.5-rhel6-x86_64.zip
/tmp/greenplum-db-5.0.0-alpha.5-rhel6-x86_64.bin 

********************************************************************************
Do you accept the Pivotal Database license agreement? [yes|no]
********************************************************************************

yes

********************************************************************************
Provide the installation path for Greenplum Database or press ENTER to 
accept the default installation path: /usr/local/greenplum-db-5.0.0-alpha.5
********************************************************************************

/opt/greenplum/greenplum-db-5.0.0-alpha.5

********************************************************************************
Install Greenplum Database into /opt/greenplum/greenplum-db-5.0.0-alpha.5? [yes|no]
********************************************************************************

yes

********************************************************************************
/opt/greenplum/greenplum-db-5.0.0-alpha.5 does not exist.
Create /opt/greenplum/greenplum-db-5.0.0-alpha.5 ? [yes|no]
(Selecting no will exit the installer)
********************************************************************************

yes

Extracting product to /opt/greenplum/greenplum-db-5.0.0-alpha.5

********************************************************************************
Installation complete.
Greenplum Database is installed in /opt/greenplum/greenplum-db-5.0.0-alpha.5

Pivotal Greenplum documentation is available
for download at http://gpdb.docs.pivotal.io
********************************************************************************

安裝過程中系統會預設創建一個指向greenplum-db-5.0.0-alpha.5的軟鏈接(greenplum-db);

ls -ltr /opt/greenplum/
total 8
lrwxrwxrwx  1 gpadmin gpadmin   28 May 30 12:14 greenplum-db -> ./greenplum-db-5.0.0-alpha.5
drwxr-xr-x 11 gpadmin gpadmin 4096 May 30 12:19 greenplum-db-5.0.0-alpha.5

修改目錄許可權和所有者為gpadmin;

chown -R gpadmin:gpadmin /opt/greenplum/
chown -R gpadmin:gpadmin /opt/greenplum/greenplum-db

3.2 在Master節點上配置集群host

su - gpadmin
mkdir -p /opt/greenplum/greenplum-db/conf
vi /opt/greenplum/greenplum-db/conf/hostlist

gp-master
gp-sdw1
gp-sdw2
gp-sdw3

創建一個 seg_hosts ,包含所有的Segment Host的主機名;

vi /opt/greenplum/greenplum-db/conf/seg_hosts

gp-sdw1
gp-sdw2
gp-sdw3

3.3 配置SSH免密連接

su - gpadmin
source /opt/greenplum/greenplum-db/greenplum_path.sh   # 不設置報錯Error: unable to import module: No module named gppylib.commands
/opt/greenplum/greenplum-db/bin/gpssh-exkeys -f /opt/greenplum/greenplum-db/conf/hostlist

[STEP 1 of 5] create local ID and authorize on local host
  ... /home/gpadmin/.ssh/id_rsa file exists ... key generation skipped

[STEP 2 of 5] keyscan all hosts and update known_hosts file

[STEP 3 of 5] authorize current user on remote hosts
  ... send to gp-sdw1
  ... send to gp-sdw2
  ... send to gp-sdw3

[STEP 4 of 5] determine common authentication file content

[STEP 5 of 5] copy authentication files to all remote hosts
  ... finished key exchange with gp-sdw1
  ... finished key exchange with gp-sdw2
  ... finished key exchange with gp-sdw3

[INFO] completed successfully

測試ssh gp-sdw1,不需要密碼即可登錄。

3.4 Segment節點上安裝Greenplum DB

在Master節點上遠程創建Segment節點所需的目錄,並更改目錄許可權和所有者為gpadmin;

su - gpadmin
source /opt/greenplum/greenplum-db/greenplum_path.sh 
/opt/greenplum/greenplum-db/bin/gpssh -f /opt/greenplum/greenplum-db/conf/seg_hosts -e -v "sudo mkdir -p /opt/greenplum && sudo chown gpadmin:gpadmin -R /opt/greenplum"

[INFO] login gp-master
[INFO] login gp-sdw1
[INFO] login gp-sdw2
[INFO] login gp-sdw3
[  gp-sdw1] sudo mkdir -p /opt/greenplum && sudo chown gpadmin:gpadmin -R /opt/greenplum
[  gp-sdw2] sudo mkdir -p /opt/greenplum && sudo chown gpadmin:gpadmin -R /opt/greenplum
[  gp-sdw3] sudo mkdir -p /opt/greenplum && sudo chown gpadmin:gpadmin -R /opt/greenplum
[INFO] completed successfully

[Cleanup...]

將Master節點上安裝的Greenplum db文件複製到所有Segment節點上安裝;

su - gpadmin
source /opt/greenplum/greenplum-db/greenplum_path.sh 
/opt/greenplum/greenplum-db/bin/gpseginstall -f /opt/greenplum/greenplum-db/conf/hostlist -u gpadmin -p gpadmin

20170530:12:26:50:004409 gpseginstall:gp-master:gpadmin-[INFO]:-Installation Info:
link_name greenplum-db
binary_path /opt/greenplum/greenplum-db-5.0.0-alpha.5
binary_dir_location /opt/greenplum
binary_dir_name greenplum-db-5.0.0-alpha.5
20170530:12:26:50:004409 gpseginstall:gp-master:gpadmin-[INFO]:-check cluster password access
20170530:12:26:50:004409 gpseginstall:gp-master:gpadmin-[INFO]:-de-duplicate hostnames
20170530:12:26:50:004409 gpseginstall:gp-master:gpadmin-[INFO]:-master hostname: gp-master
20170530:12:26:51:004409 gpseginstall:gp-master:gpadmin-[INFO]:-rm -f /opt/greenplum/greenplum-db-5.0.0-alpha.5.tar; rm -f /opt/greenplum/greenplum-db-5.0.0-alpha.5.tar.gz
20170530:12:26:51:004409 gpseginstall:gp-master:gpadmin-[INFO]:-cd /opt/greenplum; tar cf greenplum-db-5.0.0-alpha.5.tar greenplum-db-5.0.0-alpha.5
20170530:12:26:54:004409 gpseginstall:gp-master:gpadmin-[INFO]:-gzip /opt/greenplum/greenplum-db-5.0.0-alpha.5.tar
20170530:12:27:22:004409 gpseginstall:gp-master:gpadmin-[INFO]:-remote command: mkdir -p /opt/greenplum
20170530:12:27:23:004409 gpseginstall:gp-master:gpadmin-[INFO]:-remote command: rm -rf /opt/greenplum/greenplum-db-5.0.0-alpha.5
20170530:12:27:24:004409 gpseginstall:gp-master:gpadmin-[INFO]:-scp software to remote location
20170530:12:27:40:004409 gpseginstall:gp-master:gpadmin-[INFO]:-remote command: gzip -f -d /opt/greenplum/greenplum-db-5.0.0-alpha.5.tar.gz
20170530:12:28:00:004409 gpseginstall:gp-master:gpadmin-[INFO]:-md5 check on remote location
20170530:12:28:05:004409 gpseginstall:gp-master:gpadmin-[INFO]:-remote command: cd /opt/greenplum; tar xf greenplum-db-5.0.0-alpha.5.tar
20170530:12:28:38:004409 gpseginstall:gp-master:gpadmin-[INFO]:-remote command: rm -f /opt/greenplum/greenplum-db-5.0.0-alpha.5.tar
20170530:12:28:39:004409 gpseginstall:gp-master:gpadmin-[INFO]:-remote command: cd /opt/greenplum; rm -f greenplum-db; ln -fs greenplum-db-5.0.0-alpha.5 greenplum-db
20170530:12:28:40:004409 gpseginstall:gp-master:gpadmin-[INFO]:-rm -f /opt/greenplum/greenplum-db-5.0.0-alpha.5.tar.gz
20170530:12:28:41:004409 gpseginstall:gp-master:gpadmin-[INFO]:-version string on master: gpssh version 5.0.0 alpha.5 build commit:2e87c5aa435c779b2f3837fa8c7273876497f6ba
20170530:12:28:41:004409 gpseginstall:gp-master:gpadmin-[INFO]:-remote command: . /opt/greenplum/greenplum-db/./greenplum_path.sh; /opt/greenplum/greenplum-db/./bin/gpssh --version
20170530:12:28:48:004409 gpseginstall:gp-master:gpadmin-[INFO]:-remote command: . /opt/greenplum/greenplum-db-5.0.0-alpha.5/greenplum_path.sh; /opt/greenplum/greenplum-db-5.0.0-alpha.5/bin/gpssh --version
20170530:12:28:49:004409 gpseginstall:gp-master:gpadmin-[INFO]:-SUCCESS -- Requested commands completed

檢查每個節點安裝和目錄情況;

su - gpadmin
source /opt/greenplum/greenplum-db/greenplum_path.sh 
/opt/greenplum/greenplum-db/bin/gpssh -f /opt/greenplum/greenplum-db/conf/hostlist -e ls -l $GPHOME
```xml
[gp-master] ls -l /opt/greenplum/greenplum-db/.
[gp-master] total 40
[gp-master] drwxr-xr-x 7 gpadmin gpadmin 4096 May 20 02:29 bin
[gp-master] drwxrwxr-x 2 gpadmin gpadmin 4096 May 30 12:21 conf
[gp-master] drwxr-xr-x 4 gpadmin gpadmin 4096 May 20 02:20 docs
[gp-master] drwxr-xr-x 2 gpadmin gpadmin 4096 May 20 02:20 etc
[gp-master] drwxr-xr-x 3 gpadmin gpadmin 4096 May 20 02:20 ext
[gp-master] -rw-r--r-- 1 gpadmin gpadmin  745 May 30 12:14 greenplum_path.sh
[gp-master] drwxr-xr-x 6 gpadmin gpadmin 4096 May 20 02:20 include
[gp-master] drwxr-xr-x 7 gpadmin gpadmin 4096 May 20 02:20 lib
[gp-master] drwxr-xr-x 2 gpadmin gpadmin 4096 May 20 02:27 sbin
[gp-master] drwxr-xr-x 4 gpadmin gpadmin 4096 May 20 02:16 share
[  gp-sdw2] ls -l /opt/greenplum/greenplum-db/.
[  gp-sdw2] total 40
[  gp-sdw2] drwxr-xr-x 7 gpadmin gpadmin 4096 May 20 02:29 bin
[  gp-sdw2] drwxrwxr-x 2 gpadmin gpadmin 4096 May 30 12:21 conf
[  gp-sdw2] drwxr-xr-x 4 gpadmin gpadmin 4096 May 20 02:20 docs
[  gp-sdw2] drwxr-xr-x 2 gpadmin gpadmin 4096 May 20 02:20 etc
[  gp-sdw2] drwxr-xr-x 3 gpadmin gpadmin 4096 May 20 02:20 ext
[  gp-sdw2] -rw-r--r-- 1 gpadmin gpadmin  745 May 30 12:14 greenplum_path.sh
[  gp-sdw2] drwxr-xr-x 6 gpadmin gpadmin 4096 May 20 02:20 include
[  gp-sdw2] drwxr-xr-x 7 gpadmin gpadmin 4096 May 20 02:20 lib
[  gp-sdw2] drwxr-xr-x 2 gpadmin gpadmin 4096 May 20 02:27 sbin
[  gp-sdw2] drwxr-xr-x 4 gpadmin gpadmin 4096 May 20 02:16 share
[  gp-sdw1] ls -l /opt/greenplum/greenplum-db/.
[  gp-sdw1] total 40
[  gp-sdw1] drwxr-xr-x 7 gpadmin gpadmin 4096 May 20 02:29 bin
[  gp-sdw1] drwxrwxr-x 2 gpadmin gpadmin 4096 May 30 12:21 conf
[  gp-sdw1] drwxr-xr-x 4 gpadmin gpadmin 4096 May 20 02:20 docs
[  gp-sdw1] drwxr-xr-x 2 gpadmin gpadmin 4096 May 20 02:20 etc
[  gp-sdw1] drwxr-xr-x 3 gpadmin gpadmin 4096 May 20 02:20 ext
[  gp-sdw1] -rw-r--r-- 1 gpadmin gpadmin  745 May 30 12:14 greenplum_path.sh
[  gp-sdw1] drwxr-xr-x 6 gpadmin gpadmin 4096 May 20 02:20 include
[  gp-sdw1] drwxr-xr-x 7 gpadmin gpadmin 4096 May 20 02:20 lib
[  gp-sdw1] drwxr-xr-x 2 gpadmin gpadmin 4096 May 20 02:27 sbin
[  gp-sdw1] drwxr-xr-x 4 gpadmin gpadmin 4096 May 20 02:16 share
[  gp-sdw3] ls -l /opt/greenplum/greenplum-db/.
[  gp-sdw3] total 40
[  gp-sdw3] drwxr-xr-x 7 gpadmin gpadmin 4096 May 20 02:29 bin
[  gp-sdw3] drwxrwxr-x 2 gpadmin gpadmin 4096 May 30 12:21 conf
[  gp-sdw3] drwxr-xr-x 4 gpadmin gpadmin 4096 May 20 02:20 docs
[  gp-sdw3] drwxr-xr-x 2 gpadmin gpadmin 4096 May 20 02:20 etc
[  gp-sdw3] drwxr-xr-x 3 gpadmin gpadmin 4096 May 20 02:20 ext
[  gp-sdw3] -rw-r--r-- 1 gpadmin gpadmin  745 May 30 12:14 greenplum_path.sh
[  gp-sdw3] drwxr-xr-x 6 gpadmin gpadmin 4096 May 20 02:20 include
[  gp-sdw3] drwxr-xr-x 7 gpadmin gpadmin 4096 May 20 02:20 lib
[  gp-sdw3] drwxr-xr-x 2 gpadmin gpadmin 4096 May 20 02:27 sbin
[  gp-sdw3] drwxr-xr-x 4 gpadmin gpadmin 4096 May 20 02:16 share

創建數據存儲區域目錄;

su - gpadmin
source /opt/greenplum/greenplum-db/greenplum_path.sh
/opt/greenplum/greenplum-db/bin/gpssh -f /opt/greenplum/greenplum-db/conf/hostlist -e 'mkdir -p /opt/greenplum/data'

在master上創建master數據存儲區域;

su - gpadmin
source /opt/greenplum/greenplum-db/greenplum_path.sh
/opt/greenplum/greenplum-db/bin/gpssh -h gp-master -e 'mkdir -p /opt/greenplum/data/master'

在Segment節點上創建數據存儲區域

su - gpadmin
source /opt/greenplum/greenplum-db/greenplum_path.sh
/opt/greenplum/greenplum-db/bin/gpssh -f /opt/greenplum/greenplum-db/conf/seg_hosts -e 'mkdir -p /opt/greenplum/data/primary && mkdir -p /opt/greenplum/data/mirror'

3.5 環境變數配置

gpssh -f /opt/greenplum/greenplum-db/conf/hostlist -e -v "cat >> /home/gpadmin/.bash_profile <<EOF

source /opt/greenplum/greenplum-db/greenplum_path.sh
export MASTER_DATA_DIRECTORY=/opt/greenplum/data/master
export GPPORT=5432
export PGDATABASE=gp_sydb
EOF"

3.6 NTP 配置

啟用master節點上的ntp,併在Segment節點上配置和啟用NTP;

echo "server gp-master perfer" >>/etc/ntp.conf
/opt/greenplum/greenplum-db/bin/gpssh -f /opt/greenplum/greenplum-db/conf/hostlist -v -e 'sudo ntpd'
/opt/greenplum/greenplum-db/bin/gpssh -f /opt/greenplum/greenplum-db/conf/hostlist -v -e 'sudo /etc/init.d/ntpd start && sudo chkconfig --level 35 ntpd on'

4 初始化Greenplum DB

4.1 初始化前檢查

檢查主機名配置;

su gpadmin
source /opt/greenplum/greenplum-db/greenplum_path.sh
gpssh -f /opt/greenplum/greenplum-db/conf/hostlist -e hostname

[  gp-sdw3] hostname
[  gp-sdw3] gp-sdw3
[  gp-sdw1] hostname
[  gp-sdw1] gp-sdw1
[gp-master] hostname
[gp-master] gp-master
[  gp-sdw2] hostname
[  gp-sdw2] gp-sdw2

檢查節點與節點之間文件讀取;

gpcheckperf -h gp-sdw1 -h gp-sdw2 -d /tmp -r d -D -v
gpcheckperf -f /opt/greenplum/greenplum-db/conf/hostlist -d /tmp -r d -D -v
$ gpcheckperf -f /opt/greenplum/greenplum-db/conf/hostlist -r N -d /tmp
/opt/greenplum/greenplum-db/./bin/gpcheckperf -f /opt/greenplum/greenplum-db/conf/hostlist -r N -d /tmp

-------------------
--  NETPERF TEST
-------------------

====================
==  RESULT
====================
Netperf bisection bandwidth test
gp-master -> gp-sdw1 = 72.220000
gp-sdw2 -> gp-sdw3 = 21.470000
gp-sdw1 -> gp-master = 43.510000
gp-sdw3 -> gp-sdw2 = 44.200000

Summary:
sum = 181.40 MB/sec
min = 21.47 MB/sec
max = 72.22 MB/sec
avg = 45.35 MB/sec
median = 44.20 MB/sec

[Warning] connection between gp-sdw2 and gp-sdw3 is no good
[Warning] connection between gp-sdw1 and gp-master is no good
[Warning] connection between gp-sdw3 and gp-sdw2 is no good

4.2 初始化

初始化 Greenplum 配置文件模板都在/opt/greenplum/greenplum-db/docs/cli_help/gpconfigs目錄下,gpinitsystem_config是初始化 Greenplum 的模板,此模板中 Mirror Segment的配置都被註釋;創建一個副本,對其修改;

cd /opt/greenplum/greenplum-db/docs/cli_help/gpconfigs
cp gpinitsystem_config initgp_config
vi initgp_config        

declare -a DATA_DIRECTORY=(/opt/greenplum/data/primary /opt/greenplum/data/primary /opt/greenplum/data/primary)
MASTER_HOSTNAME=gp-master
MASTER_DIRECTORY=/opt/greenplum/data/master
declare -a MIRROR_DATA_DIRECTORY=(/opt/greenplum/data/mirror /opt/greenplum/data/mirror /opt/greenplum/data/mirror)
DATABASE_NAME=gp_sydb
MACHINE_LIST_FILE=/opt/greenplum/greenplum-db/conf/seg_hosts

執行初始化;

gpinitsystem -c initgp_config -S

若初始化失敗,需要刪除數據目錄重新初始化;

5 後續操作

5.1 停止和啟動集群

gpstop -a
gpstart -a

5.2 登錄資料庫

$ psql -d postgres

postgres=# \l # 查詢資料庫
                 List of databases
   Name    |  Owner  | Encoding |  Access privileges  
-----------+---------+----------+---------------------
 gp_sydb   | gpadmin | UTF8     | 
 postgres  | gpadmin | UTF8     | 
 template0 | gpadmin | UTF8     | =c/gpadmin          
                                : gpadmin=CTc/gpadmin
 template1 | gpadmin | UTF8     | =c/gpadmin          
                                : gpadmin=CTc/gpadmin
(4 rows)

postgres=# \l # 查詢資料庫表

5.3 集群狀態

gpstate -e #查看mirror的狀態
gpstate -f #查看standby master的狀態
gpstate -s #查看整個GP群集的狀態
gpstate -i #查看GP的版本
gpstate --help #幫助文檔,可以查看gpstate更多用法

您的分享是我們最大的動力!

-Advertisement-
Play Games
更多相關文章
  • 拼圖,游戲是廣受歡迎的一種智力游戲,它的變化多端,難度不一,讓人百玩不厭。 個性化的拼圖,拼湊的不僅僅是一張照片,而是一個故事,一段回憶,一縷溫情。每一片的單片都有它自己的位置,就像每段回憶都有它的故事,你要將它放在專屬的地方,放對了就慢慢豐富起來,放錯了就無法完整。 你可以把你記憶中最深的片段,可 ...
  • PlistBuddy簡單使用 由於PlistBuddy並不在Mac預設的Path里,所以我們得通過絕對路徑來引用這個工具: 查看幫助 下麵我們來看看PlistBuddy的簡單使用 初始化一個 info.plist 文件 初始化info.plist 初始化info.plist 列印info.plist ...
  • BottomNavigationView是Google推出的底部導航欄組件,在沒有這些底部導航組件之前,Android開發者多使用的是RadioGroup,在上一個項目開發中我們使用了Google的BottomNaviationView與ViewPager相結合搭建了UI框架,現項目已經完成,總結如 ...
  • 最近才發現Study Jams China的官方論壇也支持MarkDown,所以就直接把筆記發在了那兒。 http://www.studyjamscn.com/thread 21855 1 1.html pid279318 ...
  • 伺服器端是與單片機連接的esp8266模塊,ip與port分別:192.168.4.1 333 android軟體的設計思路:打開無線網路,連上無線網路名字為“Backx”,的無線,連接成功後進行發送與接收線程;軟體也加了網路許可權,可是打開軟體連接時閃退。 ...
  • 課程3B的主要內容有:控制流、導航至其他App、支持其他語言(不是編程語言,是自然語言 :-D )、風格與主題。 ...
  • 第一篇 申請帳號 https://mp.weixin.qq.com/cgi-bin/registermidpage?action=index&lang=zh_CN 這裡註冊帳號,記得選小程式,不然其他都是之前的老功能不行的,我就遇到過坑。 記住郵箱只能使用一次,身份證只能綁定5次。好坑沒有找到解綁的 ...
  • Redis 小白指南(四)- 數據的持久化保存 簡介 因為 redis 將數據保存在記憶體中,很容易誘發的一個問題就是,程式崩潰或伺服器重啟等情況如何保證數據的正常存儲。 當我們以 redis 作為主資料庫使用時,或者將 redis 作為緩存伺服器使用時,在緩存被穿透後會對性能造成很大的影響,所有緩存 ...
一周排行
    -Advertisement-
    Play Games
  • 移動開發(一):使用.NET MAUI開發第一個安卓APP 對於工作多年的C#程式員來說,近來想嘗試開發一款安卓APP,考慮了很久最終選擇使用.NET MAUI這個微軟官方的框架來嘗試體驗開發安卓APP,畢竟是使用Visual Studio開發工具,使用起來也比較的順手,結合微軟官方的教程進行了安卓 ...
  • 前言 QuestPDF 是一個開源 .NET 庫,用於生成 PDF 文檔。使用了C# Fluent API方式可簡化開發、減少錯誤並提高工作效率。利用它可以輕鬆生成 PDF 報告、發票、導出文件等。 項目介紹 QuestPDF 是一個革命性的開源 .NET 庫,它徹底改變了我們生成 PDF 文檔的方 ...
  • 項目地址 項目後端地址: https://github.com/ZyPLJ/ZYTteeHole 項目前端頁面地址: ZyPLJ/TreeHoleVue (github.com) https://github.com/ZyPLJ/TreeHoleVue 目前項目測試訪問地址: http://tree ...
  • 話不多說,直接開乾 一.下載 1.官方鏈接下載: https://www.microsoft.com/zh-cn/sql-server/sql-server-downloads 2.在下載目錄中找到下麵這個小的安裝包 SQL2022-SSEI-Dev.exe,運行開始下載SQL server; 二. ...
  • 前言 隨著物聯網(IoT)技術的迅猛發展,MQTT(消息隊列遙測傳輸)協議憑藉其輕量級和高效性,已成為眾多物聯網應用的首選通信標準。 MQTTnet 作為一個高性能的 .NET 開源庫,為 .NET 平臺上的 MQTT 客戶端與伺服器開發提供了強大的支持。 本文將全面介紹 MQTTnet 的核心功能 ...
  • Serilog支持多種接收器用於日誌存儲,增強器用於添加屬性,LogContext管理動態屬性,支持多種輸出格式包括純文本、JSON及ExpressionTemplate。還提供了自定義格式化選項,適用於不同需求。 ...
  • 目錄簡介獲取 HTML 文檔解析 HTML 文檔測試參考文章 簡介 動態內容網站使用 JavaScript 腳本動態檢索和渲染數據,爬取信息時需要模擬瀏覽器行為,否則獲取到的源碼基本是空的。 本文使用的爬取步驟如下: 使用 Selenium 獲取渲染後的 HTML 文檔 使用 HtmlAgility ...
  • 1.前言 什麼是熱更新 游戲或者軟體更新時,無需重新下載客戶端進行安裝,而是在應用程式啟動的情況下,在內部進行資源或者代碼更新 Unity目前常用熱更新解決方案 HybridCLR,Xlua,ILRuntime等 Unity目前常用資源管理解決方案 AssetBundles,Addressable, ...
  • 本文章主要是在C# ASP.NET Core Web API框架實現向手機發送驗證碼簡訊功能。這裡我選擇是一個互億無線簡訊驗證碼平臺,其實像阿裡雲,騰訊雲上面也可以。 首先我們先去 互億無線 https://www.ihuyi.com/api/sms.html 去註冊一個賬號 註冊完成賬號後,它會送 ...
  • 通過以下方式可以高效,並保證數據同步的可靠性 1.API設計 使用RESTful設計,確保API端點明確,並使用適當的HTTP方法(如POST用於創建,PUT用於更新)。 設計清晰的請求和響應模型,以確保客戶端能夠理解預期格式。 2.數據驗證 在伺服器端進行嚴格的數據驗證,確保接收到的數據符合預期格 ...