1.购买一台云主机,硬件配置为:4核16G+100G系统盘+200G数据盘,系统版本如下:
[root@iZuf6cub1nwgqq8z1ol7v9Z ~]# lsb_release -a
LSB Version: :core-4.1-amd64:core-4.1-noarch
Distributor ID: CentOS
Description: CentOS Linux release 7.4.1708 (Core)
Release: 7.4.1708
Codename: Core
2.分区并挂载数据盘
# 查看实例上的数据盘:执行命令后,如果不存在/dev/vdb,表示您的实例没有数据盘。确认数据盘是否已挂载。
[root@iZuf6cub1nwgqq8z1ol7v9Z ~]# fdisk -l
Disk /dev/vda: 107.4 GB, 107374182400 bytes, 209715200 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: dos
Disk identifier: 0x0008d73a
Device Boot Start End Blocks Id System
/dev/vda1 * 2048 209713151 104855552 83 Linux
Disk /dev/vdb: 214.7 GB, 214748364800 bytes, 419430400 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
# 依次运行以下命令,创建一个单分区数据盘
[root@iZuf6cub1nwgqq8z1ol7v9Z ~]# fdisk -u /dev/vdb
Welcome to fdisk (util-linux 2.23.2).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.
Device does not contain a recognized partition table
Building a new DOS disklabel with disk identifier 0x3f740e74.
Command (m for help): n
Partition type:
p primary (0 primary, 0 extended, 4 free)
e extended
Select (default p): p
Partition number (1-4, default 1): 1
First sector (2048-419430399, default 2048):
Using default value 2048
Last sector, +sectors or +size{K,M,G} (2048-419430399, default 419430399):
Using default value 419430399
Partition 1 of type Linux and of size 200 GiB is set
Command (m for help): p
Disk /dev/vdb: 214.7 GB, 214748364800 bytes, 419430400 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: dos
Disk identifier: 0x3f740e74
Device Boot Start End Blocks Id System
/dev/vdb1 2048 419430399 209714176 83 Linux
Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
Syncing disks.
# 运行fdisk -lu /dev/vdb命令查看新分区
[root@iZuf6cub1nwgqq8z1ol7v9Z ~]# fdisk -lu /dev/vdb
Disk /dev/vdb: 214.7 GB, 214748364800 bytes, 419430400 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: dos
Disk identifier: 0x3f740e74
Device Boot Start End Blocks Id System
/dev/vdb1 2048 419430399 209714176 83 Linux
# 运行mkfs.ext4 /dev/vdb1命令在新分区上创建一个文件系统。
[root@iZuf6cub1nwgqq8z1ol7v9Z ~]# mkfs.ext4 /dev/vdb1
mke2fs 1.42.9 (28-Dec-2013)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
Stride=0 blocks, Stripe width=0 blocks
13107200 inodes, 52428544 blocks
2621427 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=2199912448
1600 block groups
32768 blocks per group, 32768 fragments per group
8192 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
4096000, 7962624, 11239424, 20480000, 23887872
Allocating group tables: done
Writing inode tables: done
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done
# 运行cp /etc/fstab /etc/fstab.bak命令备份etc/fstab文件
# 运行echo /dev/vdb1 /data1 ext4 defaults 0 0 >> /etc/fstab命令向/etc/fstab写入新分区信息。
# 运行cat /etc/fstab命令查看/etc/fstab中的新分区信息
[root@iZuf6cub1nwgqq8z1ol7v9Z ~]# cat /etc/fstab
#
# /etc/fstab
# Created by anaconda on Sun Oct 15 15:19:00 2017
#
# Accessible filesystems, by reference, are maintained under '/dev/disk'
# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info
#
UUID=eb448abb-3012-4d8d-bcde-94434d586a31 / ext4 defaults 1 1
/dev/vdb1 /data1 ext4 defaults 0 0
# 创建挂载路径
[root@iZuf6cub1nwgqq8z1ol7v9Z ~]# mkdir -p /data1
# 挂载文件系统
[root@iZuf6cub1nwgqq8z1ol7v9Z ~]# mount /dev/vdb1 /data1
# 运行df -h命令查看目前磁盘空间和使用情况。如果出现新建文件系统的信息,表示挂载成功,您不需要重启实例即可以使用新的文件系统。
[root@iZuf6cub1nwgqq8z1ol7v9Z ~]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/vda1 99G 1.5G 92G 2% /
devtmpfs 7.8G 0 7.8G 0% /dev
tmpfs 7.8G 0 7.8G 0% /dev/shm
tmpfs 7.8G 328K 7.8G 1% /run
tmpfs 7.8G 0 7.8G 0% /sys/fs/cgroup
tmpfs 1.6G 0 1.6G 0% /run/user/0
/dev/vdb1 197G 61M 187G 1% /data1
参考Argo安装文档,操作历史命令如下:
1 mkdir /opt/soft
2 yum install wget unzip -y
3 cd /opt/soft/
4 ls
5 wget https://github.com/analysys/argo-installer/archive/4.3.4.zip
6 unzip 4.3.4.zip
7 cp argo-installer-4.3.4/config.properties /opt/soft/
8 cp argo-installer-4.3.4/standalone_remote_installer.sh /opt/soft/
9 cp argo-installer-4.3.4/init_ext4.sh /opt/soft/
10 sh init_ext4.sh
11 vim /opt/soft/config.properties
12 sh standalone_remote_installer.sh
# 方舟访问地址配置
upstream dashboard_server {
server ip:4005;
}
server {
listen 80 default backlog=2048;
listen 443 ssl;
server_name argo.rvhqs.com;
access_log /data/weblog/argo.access.log main;
error_log /data/weblog/argo.error.log;
# ssl on;
# ssl_certificate sslkey/_.analysys.cn_bundle.crt;
# ssl_certificate_key sslkey/_.analysys.cn.key;
ssl_certificate cert/argo.rvhqs.com.pem;
ssl_certificate_key cert/argo.rvhqs.com.key;
ssl_session_timeout 5m;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers AESGCM:ALL:!DH:!EXPORT:!RC4:+HIGH:!MEDIUM:!LOW:!aNULL:!eNULL;
ssl_prefer_server_ciphers on;
root html;
index index.html index.htm index.php;
location / {
if ($request_method !~ ^(GET|POST)$ ) {
return 405;
}
proxy_pass http://dashboard_server;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_next_upstream error timeout invalid_header http_500 http_502 http_503 http_504;
proxy_connect_timeout 75;
proxy_send_timeout 120;
proxy_read_timeout 120;
proxy_buffer_size 32k;
proxy_buffers 4 32k;
proxy_busy_buffers_size 64k;
proxy_temp_file_write_size 64k;
}
}
# sdk上报地址
upstream apachesdkserver {
server ip:8089;
}
server {
listen 4089;
server_name argo.rvhqs.com;
access_log /data/weblog/argo.access.log main;
error_log /data/weblog/argo.error.log;
ssl on;
ssl_certificate cert/argo.rvhqs.com.pem;
ssl_certificate_key cert/argo.rvhqs.com.key;
ssl_session_timeout 5m;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers AESGCM:ALL:!DH:!EXPORT:!RC4:+HIGH:!MEDIUM:!LOW:!aNULL:!eNULL;
ssl_prefer_server_ciphers on;
root html;
index index.html index.htm index.php;
location = /up {
if ($request_method !~ ^(GET|POST)$ ) {
return 405;
}
proxy_pass http://apachesdkserver;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_next_upstream error timeout invalid_header http_500 http_502 http_503 http_504;
proxy_connect_timeout 75;
proxy_send_timeout 120;
proxy_read_timeout 120;
proxy_buffer_size 32k;
proxy_buffers 4 32k;
proxy_busy_buffers_size 64k;
proxy_temp_file_write_size 64k;
}
location = /configure {
if ($request_method !~ ^(GET)$ ) {
return 405;
}
proxy_pass http://apachesdkserver;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_next_upstream error timeout invalid_header http_500 http_502 http_503 http_504;
proxy_connect_timeout 75;
proxy_send_timeout 120;
proxy_read_timeout 120;
proxy_buffer_size 32k;
proxy_buffers 4 32k;
proxy_busy_buffers_size 64k;
proxy_temp_file_write_size 64k;
}
location ^~ /ark/ {
if ($request_method !~ ^(GET|POST)$ ) {
return 405;
}
proxy_pass http://apachesdkserver;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_next_upstream error timeout invalid_header http_500 http_502 http_503 http_504;
proxy_connect_timeout 75;
proxy_send_timeout 120;
proxy_read_timeout 120;
proxy_buffer_size 32k;
proxy_buffers 4 32k;
proxy_busy_buffers_size 64k;
proxy_temp_file_write_size 64k;
}
}