OceanBase 社区版安装实践
概要
1.上传安装包到环境,并解压
环境:CentOS7.6 X86_64
[root@centos7 ~]# tar xf oceanbase-all-in-one-4.2.1.1-100120231117154841.el7.x86_64.tar.gz
[root@centos7 ~]# ll
total 501780
-rw-------. 1 root root 1509 Dec 2 18:12 anaconda-ks.cfg
drwxr-xr-x. 2 root root 6 Dec 2 19:09 Desktop
drwxr-xr-x. 2 root root 6 Dec 2 19:09 Documents
drwxr-xr-x. 2 root root 6 Dec 2 19:09 Downloads
-rw-r--r--. 1 root root 1557 Dec 2 18:48 initial-setup-ks.cfg
drwxr-xr-x. 2 root root 6 Dec 2 19:09 Music
drwxr-xr-x. 7 root root 100 Nov 17 15:48 oceanbase-all-in-one
-rw-r--r--. 1 root root 513811252 Dec 2 22:24 oceanbase-all-in-one-4.2.1.1-100120231117154841.el7.x86_64.tar.gz
drwxr-xr-x. 2 root root 6 Dec 2 19:09 Pictures
drwxr-xr-x. 2 root root 6 Dec 2 19:09 Public
drwxr-xr-x. 2 root root 6 Dec 2 19:09 Templates
drwxr-xr-x. 2 root root 6 Dec 2 19:09 Videos
2.执行安装脚本./install.sh
[root@centos7 ~]# cd oceanbase-all-in-one/bin/
[root@centos7 bin]# ll
total 16
-rw-r--r--. 1 root root 238 Nov 17 15:48 env.sh
-rwxr-xr-x. 1 root root 1678 Nov 17 15:48 install.sh
-rwxr-xr-x. 1 root root 161 Nov 17 15:48 uninstall.sh
-rwxr-xr-x. 1 root root 1838 Nov 17 15:48 upgrade.sh
[root@centos7 bin]# ./install.sh
name: grafana
version: 7.5.17
release:1
arch: x86_64
md5: 1bf1f338d3a3445d8599dc6902e7aeed4de4e0d6
add /root/oceanbase-all-in-one/rpms/grafana-7.5.17-1.el7.x86_64.rpm to local mirror
name: obagent
version: 4.2.1
release:100000122023103020.el7
arch: x86_64
md5: c08058fef64b2dc6b5e2f99748fbd76fe872e356
add /root/oceanbase-all-in-one/rpms/obagent-4.2.1-100000122023103020.el7.x86_64.rpm to local mirror
name: obproxy-ce
version: 4.2.1.0
release:11.el7
arch: x86_64
md5: 0aed4b782120e4248b749f67be3d2cc82cdcb70d
add /root/oceanbase-all-in-one/rpms/obproxy-ce-4.2.1.0-11.el7.x86_64.rpm to local mirror
name: oceanbase-ce
version: 4.2.1.1
release:101010012023111012.el7
arch: x86_64
md5: e98c6ef860b5644c36f806e6fa2265255572b40a
add /root/oceanbase-all-in-one/rpms/oceanbase-ce-4.2.1.1-101010012023111012.el7.x86_64.rpm to local mirror
name: oceanbase-ce-libs
version: 4.2.1.1
release:101010012023111012.el7
arch: x86_64
md5: 411c69202b38e7e656ced7146b85c01414727149
add /root/oceanbase-all-in-one/rpms/oceanbase-ce-libs-4.2.1.1-101010012023111012.el7.x86_64.rpm to local mirror
name: ocp-express
version: 4.2.1
release:100000222023111619.el7
arch: x86_64
md5: c69fe1fe0ec0d1a4e14f75468ccda4d0a7ca8d28
add /root/oceanbase-all-in-one/rpms/ocp-express-4.2.1-100000222023111619.el7.x86_64.rpm to local mirror
name: prometheus
version: 2.37.1
release:10000102022110211.el7
arch: x86_64
md5: 58913c7606f05feb01bc1c6410346e5fc31cf263
add /root/oceanbase-all-in-one/rpms/prometheus-2.37.1-10000102022110211.el7.x86_64.rpm to local mirror
Trace ID: a736bb48-911f-11ee-8102-000c29fcb2df
If you want to view detailed obd logs, please run: obd display-trace a736bb48-911f-11ee-8102-000c29fcb2df
Disable remote ok
Trace ID: a7eab8b4-911f-11ee-b134-000c29fcb2df
If you want to view detailed obd logs, please run: obd display-trace a7eab8b4-911f-11ee-b134-000c29fcb2df
add auto set env logic to profile: /root/.bash_profile
#####################################################################
Install Finished
=====================================================================
Setup Environment: source ~/.oceanbase-all-in-one/bin/env.sh
Start Web Service: obd web
Quick Start: obd demo
More Details: obd -h
=====================================================================
[root@centos7 bin]#
3.配置环境变量生效
[root@centos7 bin]# source ~/.oceanbase-all-in-one/bin/env.sh
[root@centos7 bin]#
[root@centos7 bin]# obd demo
Package grafana-7.5.17-1 is available.
Package oceanbase-ce-4.2.1.1-101010012023111012.el7 is available.
Package obagent-4.2.1-100000122023103020.el7 is available.
Package prometheus-2.37.1-10000102022110211.el7 is available.
Package obproxy-ce-4.2.1.0-11.el7 is available.
install grafana-7.5.17 for local ok
install oceanbase-ce-4.2.1.1 for local ok
install obagent-4.2.1 for local ok
install prometheus-2.37.1 for local ok
install obproxy-ce-4.2.1.0 for local ok
Cluster param config check ok
Open ssh connection ok
Generate grafana configuration ok
Generate observer configuration ok
Generate obagent configuration ok
Generate prometheus configuration ok
Generate obproxy configuration ok
+--------------------------------------------------------------------------------------------+
| Packages |
+--------------+---------+------------------------+------------------------------------------+
| Repository | Version | Release | Md5 |
+--------------+---------+------------------------+------------------------------------------+
| grafana | 7.5.17 | 1 | 1bf1f338d3a3445d8599dc6902e7aeed4de4e0d6 |
| oceanbase-ce | 4.2.1.1 | 101010012023111012.el7 | e98c6ef860b5644c36f806e6fa2265255572b40a |
| obagent | 4.2.1 | 100000122023103020.el7 | c08058fef64b2dc6b5e2f99748fbd76fe872e356 |
| prometheus | 2.37.1 | 10000102022110211.el7 | 58913c7606f05feb01bc1c6410346e5fc31cf263 |
| obproxy-ce | 4.2.1.0 | 11.el7 | 0aed4b782120e4248b749f67be3d2cc82cdcb70d |
+--------------+---------+------------------------+------------------------------------------+
Repository integrity check ok
Parameter check ok
Cluster status check ok
Initializes grafana work home ok
Initializes observer work home ok
Initializes obagent work home ok
Initializes prometheus work home ok
Initializes obproxy work home ok
Remote grafana-7.5.17-1-1bf1f338d3a3445d8599dc6902e7aeed4de4e0d6 repository install ok
Remote grafana-7.5.17-1-1bf1f338d3a3445d8599dc6902e7aeed4de4e0d6 repository lib check ok
Remote oceanbase-ce-4.2.1.1-101010012023111012.el7-e98c6ef860b5644c36f806e6fa2265255572b40a repository install ok
Remote oceanbase-ce-4.2.1.1-101010012023111012.el7-e98c6ef860b5644c36f806e6fa2265255572b40a repository lib check !!
Remote obagent-4.2.1-100000122023103020.el7-c08058fef64b2dc6b5e2f99748fbd76fe872e356 repository install ok
Remote obagent-4.2.1-100000122023103020.el7-c08058fef64b2dc6b5e2f99748fbd76fe872e356 repository lib check ok
Remote prometheus-2.37.1-10000102022110211.el7-58913c7606f05feb01bc1c6410346e5fc31cf263 repository install ok
Remote prometheus-2.37.1-10000102022110211.el7-58913c7606f05feb01bc1c6410346e5fc31cf263 repository lib check ok
Remote obproxy-ce-4.2.1.0-11.el7-0aed4b782120e4248b749f67be3d2cc82cdcb70d repository install ok
Remote obproxy-ce-4.2.1.0-11.el7-0aed4b782120e4248b749f67be3d2cc82cdcb70d repository lib check ok
Try to get lib-repository
Package oceanbase-ce-libs-4.2.1.1-101010012023111012.el7 is available.
install oceanbase-ce-libs-4.2.1.1 for local ok
Remote oceanbase-ce-libs-4.2.1.1-101010012023111012.el7-411c69202b38e7e656ced7146b85c01414727149 repository install ok
Remote oceanbase-ce-4.2.1.1-101010012023111012.el7-e98c6ef860b5644c36f806e6fa2265255572b40a repository lib check ok
demo deployed
Get local repositories ok
Search plugins ok
Open ssh connection ok
Load cluster param plugin ok
Check before start observer x
[ERROR] OBD-1007: (127.0.0.1) open files must not be less than 20000 (Current value: 1024)
[ERROR] OBD-2000: (127.0.0.1) not enough memory. (Free: 157.9M, Buff/Cache: 5.7G, Need: 6.0G)
[WARN] OBD-1012: (127.0.0.1) clog and data use the same disk (/)
Check before start obagent ok
Check before start prometheus ok
Check before start obproxy ok
Check before start grafana ok
See https://www.oceanbase.com/product/ob-deployer/error-codes .
Trace ID: b367709c-911f-11ee-8d32-000c29fcb2df
If you want to view detailed obd logs, please run: obd display-trace b367709c-911f-11ee-8d32-000c29fcb2df
4.修改OS参数
[root@centos7 bin]# vi /etc/sysctl.conf
[root@centos7 bin]# vi /etc/security/limits.conf
5.启动服务
[root@centos7 ~]# cd oceanbase-all-in-one/bin/
[root@centos7 bin]# ll
total 16
-rw-r--r--. 1 root root 238 Nov 17 15:48 env.sh
-rwxr-xr-x. 1 root root 1678 Nov 17 15:48 install.sh
-rwxr-xr-x. 1 root root 161 Nov 17 15:48 uninstall.sh
-rwxr-xr-x. 1 root root 1838 Nov 17 15:48 upgrade.sh
[root@centos7 bin]# cd
[root@centos7 ~]#
[root@centos7 ~]#
[root@centos7 ~]# obd demo
Get local repositories ok
Open ssh connection ok
Check for standby tenant ok
Search plugins ok
Cluster status check ok
grafana work dir cleaning ok
observer work dir cleaning ok
obagent work dir cleaning ok
prometheus work dir cleaning ok
obproxy work dir cleaning ok
demo destroyed
Cluster param config check ok
Open ssh connection ok
Generate observer configuration ok
Generate prometheus configuration ok
Generate obagent configuration ok
Generate grafana configuration ok
Generate obproxy configuration ok
+--------------------------------------------------------------------------------------------+
| Packages |
+--------------+---------+------------------------+------------------------------------------+
| Repository | Version | Release | Md5 |
+--------------+---------+------------------------+------------------------------------------+
| oceanbase-ce | 4.2.1.1 | 101010012023111012.el7 | e98c6ef860b5644c36f806e6fa2265255572b40a |
| prometheus | 2.37.1 | 10000102022110211.el7 | 58913c7606f05feb01bc1c6410346e5fc31cf263 |
| obagent | 4.2.1 | 100000122023103020.el7 | c08058fef64b2dc6b5e2f99748fbd76fe872e356 |
| grafana | 7.5.17 | 1 | 1bf1f338d3a3445d8599dc6902e7aeed4de4e0d6 |
| obproxy-ce | 4.2.1.0 | 11.el7 | 0aed4b782120e4248b749f67be3d2cc82cdcb70d |
+--------------+---------+------------------------+------------------------------------------+
Repository integrity check ok
Parameter check ok
Cluster status check ok
Initializes observer work home ok
Initializes prometheus work home ok
Initializes obagent work home ok
Initializes grafana work home ok
Initializes obproxy work home ok
Remote oceanbase-ce-4.2.1.1-101010012023111012.el7-e98c6ef860b5644c36f806e6fa2265255572b40a repository install ok
Remote oceanbase-ce-4.2.1.1-101010012023111012.el7-e98c6ef860b5644c36f806e6fa2265255572b40a repository lib check !!
Remote prometheus-2.37.1-10000102022110211.el7-58913c7606f05feb01bc1c6410346e5fc31cf263 repository install ok
Remote prometheus-2.37.1-10000102022110211.el7-58913c7606f05feb01bc1c6410346e5fc31cf263 repository lib check ok
Remote obagent-4.2.1-100000122023103020.el7-c08058fef64b2dc6b5e2f99748fbd76fe872e356 repository install ok
Remote obagent-4.2.1-100000122023103020.el7-c08058fef64b2dc6b5e2f99748fbd76fe872e356 repository lib check ok
Remote grafana-7.5.17-1-1bf1f338d3a3445d8599dc6902e7aeed4de4e0d6 repository install ok
Remote grafana-7.5.17-1-1bf1f338d3a3445d8599dc6902e7aeed4de4e0d6 repository lib check ok
Remote obproxy-ce-4.2.1.0-11.el7-0aed4b782120e4248b749f67be3d2cc82cdcb70d repository install ok
Remote obproxy-ce-4.2.1.0-11.el7-0aed4b782120e4248b749f67be3d2cc82cdcb70d repository lib check ok
Try to get lib-repository
Remote oceanbase-ce-libs-4.2.1.1-101010012023111012.el7-411c69202b38e7e656ced7146b85c01414727149 repository install ok
Remote oceanbase-ce-4.2.1.1-101010012023111012.el7-e98c6ef860b5644c36f806e6fa2265255572b40a repository lib check ok
demo deployed
Get local repositories ok
Search plugins ok
Open ssh connection ok
Load cluster param plugin ok
Check before start observer ok
[WARN] OBD-1007: (127.0.0.1) The recommended number of open files is 655350 (Current value: 102400)
[WARN] OBD-1012: (127.0.0.1) clog and data use the same disk (/)
Check before start obagent ok
Check before start obproxy ok
Check before start prometheus ok
Check before start grafana ok
Start observer ok
observer program health check ok
Connect to observer 127.0.0.1:2881 ok
Initialize oceanbase-ce ok
Start obagent ok
obagent program health check ok
Connect to Obagent ok
Start obproxy ok
obproxy program health check ok
Connect to obproxy ok
Initialize obproxy-ce ok
Start promethues ok
prometheus program health check ok
Connect to Prometheus ok
Initialize prometheus ok
Start grafana ok
grafana program health check ok
Connect to grafana ok
Initialize grafana ok
Wait for observer init ok
+---------------------------------------------+
| observer |
+-----------+---------+------+-------+--------+
| ip | version | port | zone | status |
+-----------+---------+------+-------+--------+
| 127.0.0.1 | 4.2.1.1 | 2881 | zone1 | ACTIVE |
+-----------+---------+------+-------+--------+
obclient -h127.0.0.1 -P2881 -uroot -Doceanbase -A
+-----------------------------------------------------------------+
| obagent |
+--------------+--------------------+--------------------+--------+
| ip | mgragent_http_port | monagent_http_port | status |
+--------------+--------------------+--------------------+--------+
| 192.168.0.30 | 8089 | 8088 | active |
+--------------+--------------------+--------------------+--------+
+---------------------------------------------+
| obproxy |
+-----------+------+-----------------+--------+
| ip | port | prometheus_port | status |
+-----------+------+-----------------+--------+
| 127.0.0.1 | 2883 | 2884 | active |
+-----------+------+-----------------+--------+
obclient -h127.0.0.1 -P2883 -uroot -Doceanbase -A
+-----------------------------------------------------+
| prometheus |
+--------------------------+------+----------+--------+
| url | user | password | status |
+--------------------------+------+----------+--------+
| http://192.168.0.30:9090 | | | active |
+--------------------------+------+----------+--------+
+--------------------------------------------------------------------+
| grafana |
+--------------------------------------+-------+------------+--------+
| url | user | password | status |
+--------------------------------------+-------+------------+--------+
| http://192.168.0.30:3000/d/oceanbase | admin | knAMYbBKCa | active |
+--------------------------------------+-------+------------+--------+
demo running
Trace ID: 961e8506-9120-11ee-a0ed-000c29fcb2df
If you want to view detailed obd logs, please run: obd display-trace 961e8506-9120-11ee-a0ed-000c29fcb2df
[root@centos7 ~]#
6.查看监听端口情况
[root@centos7 ~]# netstat -nlp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:111 0.0.0.0:* LISTEN 1/systemd
tcp 0 0 0.0.0.0:6000 0.0.0.0:* LISTEN 9689/X
tcp 0 0 192.168.122.1:53 0.0.0.0:* LISTEN 11310/dnsmasq
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 9546/sshd
tcp 0 0 127.0.0.1:631 0.0.0.0:* LISTEN 9545/cupsd
tcp 0 0 127.0.0.1:6010 0.0.0.0:* LISTEN 19852/sshd: root@pt
tcp 0 0 127.0.0.1:6011 0.0.0.0:* LISTEN 26351/sshd: root@pt
tcp 0 0 0.0.0.0:2881 0.0.0.0:* LISTEN 23557/observer
tcp 0 0 0.0.0.0:2882 0.0.0.0:* LISTEN 23557/observer
tcp 0 0 0.0.0.0:2883 0.0.0.0:* LISTEN 24203/obproxy
tcp 0 0 0.0.0.0:2884 0.0.0.0:* LISTEN 24203/obproxy
tcp6 0 0 :::111 :::* LISTEN 1/systemd
tcp6 0 0 :::6000 :::* LISTEN 9689/X
tcp6 0 0 :::22 :::* LISTEN 9546/sshd
tcp6 0 0 ::1:631 :::* LISTEN 9545/cupsd
tcp6 0 0 :::3000 :::* LISTEN 24374/grafana-serve
tcp6 0 0 :::8088 :::* LISTEN 24047/ob_monagent
tcp6 0 0 :::8089 :::* LISTEN 24048/ob_mgragent
tcp6 0 0 ::1:6010 :::* LISTEN 19852/sshd: root@pt
tcp6 0 0 ::1:6011 :::* LISTEN 26351/sshd: root@pt
tcp6 0 0 :::9090 :::* LISTEN 24324/prometheus
udp 0 0 0.0.0.0:36096 0.0.0.0:* 8947/avahi-daemon:
udp 0 0 192.168.122.1:53 0.0.0.0:* 11310/dnsmasq
udp 0 0 0.0.0.0:67 0.0.0.0:* 11310/dnsmasq
udp 0 0 0.0.0.0:68 0.0.0.0:* 9344/dhclient
udp 0 0 0.0.0.0:111 0.0.0.0:* 1/systemd
udp 0 0 0.0.0.0:616 0.0.0.0:* 8935/rpcbind
udp 0 0 0.0.0.0:5353 0.0.0.0:* 8947/avahi-daemon:
udp6 0 0 :::111 :::* 1/systemd
udp6 0 0 :::616 :::* 8935/rpcbind
raw6 0 0 :::58 :::* 7 9052/NetworkManager
Active UNIX domain sockets (only servers)
Proto RefCnt Flags Type State I-Node PID/Program name Path
unix 2 [ ACC ] STREAM LISTENING 48138 8941/lsmd /var/run/lsm/ipc/sim
unix 2 [ ACC ] STREAM LISTENING 48140 8941/lsmd /var/run/lsm/ipc/simc
unix 2 [ ACC ] STREAM LISTENING 52168 9584/gdm @/tmp/dbus-nNsbD7FJ
unix 2 [ ACC ] STREAM LISTENING 43280 1/systemd /var/run/libvirt/virtlockd-sock
unix 2 [ ACC ] STREAM LISTENING 48150 8925/abrtd /var/run/abrt/abrt.socket
unix 2 [ ACC ] STREAM LISTENING 53060 12263/dbus-daemon @/tmp/dbus-xFOruHpigT
unix 2 [ ACC ] STREAM LISTENING 51717 9689/X @/tmp/.X11-unix/X0
unix 2 [ ACC ] STREAM LISTENING 24098 1/systemd /run/lvm/lvmpolld.socket
unix 2 [ ACC ] STREAM LISTENING 54566 9558/libvirtd /var/run/libvirt/libvirt-sock
unix 2 [ ACC ] STREAM LISTENING 54568 9558/libvirtd /var/run/libvirt/libvirt-sock-ro
unix 2 [ ACC ] STREAM LISTENING 55221 12224/dbus-daemon @/tmp/dbus-06lEfAUfde
unix 2 [ ACC ] STREAM LISTENING 54570 9558/libvirtd /var/run/libvirt/libvirt-admin-sock
unix 2 [ ACC ] STREAM LISTENING 47406 8948/VGAuthService /var/run/vmware/guestServicePipe
unix 2 [ ACC ] STREAM LISTENING 53 1/systemd /run/systemd/journal/stdout
unix 2 [ ACC ] SEQPACKET LISTENING 23863 1/systemd /run/udev/control
unix 2 [ ACC ] STREAM LISTENING 44087 1/systemd /var/run/avahi-daemon/socket
unix 2 [ ACC ] STREAM LISTENING 44090 1/systemd /var/run/cups/cups.sock
unix 2 [ ACC ] STREAM LISTENING 44092 1/systemd /run/dbus/system_bus_socket
unix 2 [ ACC ] STREAM LISTENING 44095 1/systemd /var/run/libvirt/virtlogd-sock
unix 2 [ ACC ] STREAM LISTENING 44098 1/systemd /var/run/rpcbind.sock
unix 2 [ ACC ] STREAM LISTENING 44085 1/systemd @ISCSID_UIP_ABSTRACT_NAMESPACE
unix 2 [ ACC ] STREAM LISTENING 58449 13208/pulseaudio /run/user/42/pulse/native
unix 2 [ ACC ] STREAM LISTENING 58770 14742/ibus-daemon @/tmp/dbus-ds2ce4lg
unix 2 [ ACC ] STREAM LISTENING 75595 24048/ob_mgragent /root/obagent/run/ob_mgragent.24048.sock
unix 2 [ ACC ] STREAM LISTENING 75601 24047/ob_monagent /root/obagent/run/ob_monagent.24047.sock
unix 2 [ ACC ] STREAM LISTENING 52167 9584/gdm @/tmp/dbus-Oe9wr8ig
unix 2 [ ACC ] STREAM LISTENING 44667 8969/gssproxy /run/gssproxy.sock
unix 2 [ ACC ] STREAM LISTENING 49537 9052/NetworkManager /var/run/NetworkManager/private-dhcp
unix 2 [ ACC ] STREAM LISTENING 26513 1/systemd /run/systemd/private
unix 2 [ ACC ] STREAM LISTENING 55695 11537/gnome-session /tmp/.ICE-unix/11537
unix 2 [ ACC ] STREAM LISTENING 74406 24041/ob_agentd /root/obagent/run/ob_agentd.24041.sock
unix 2 [ ACC ] STREAM LISTENING 23997 1/systemd /run/lvm/lvmetad.socket
unix 2 [ ACC ] STREAM LISTENING 44086 1/systemd @ISCSIADM_ABSTRACT_NAMESPACE
unix 2 [ ACC ] STREAM LISTENING 55694 11537/gnome-session @/tmp/.ICE-unix/11537
unix 2 [ ACC ] STREAM LISTENING 75089 23557/observer run/sql.sock
unix 2 [ ACC ] STREAM LISTENING 75529 23557/observer run/lua.sock
unix 2 [ ACC ] STREAM LISTENING 52164 9584/gdm @/tmp/dbus-BdSvRW2M
unix 2 [ ACC ] STREAM LISTENING 47408 8969/gssproxy /var/lib/gssproxy/default.sock
unix 2 [ ACC ] STREAM LISTENING 51718 9689/X /tmp/.X11-unix/X0
unix 2 [ ACC ] STREAM LISTENING 52165 9584/gdm @/tmp/dbus-1D6bNvVJ
[root@centos7 ~]#
[root@centos7 ~]#
7.查看prometheus进程情况
[root@centos7 ~]# ps -ef|grep prome
root 24304 1 0 22:40 pts/0 00:00:00 bash prometheusd.sh --config.file=/root/prometheus/prometheus.yaml --web.listen-address=0.0.0.0:9090 --storage.tsdb.path=/root/prometheus/data --web.enable-lifecycle --daemon
root 24324 24304 0 22:40 pts/0 00:00:10 /root/prometheus/prometheus --config.file=/root/prometheus/prometheus.yaml --web.listen-address=0.0.0.0:9090 --storage.tsdb.path=/root/prometheus/data --web.enable-lifecycle
root 29177 19860 0 22:57 pts/0 00:00:00 grep --color=auto prome
[root@centos7 ~]#
[root@centos7 ~]#
8.查看grafana进程情况
[root@centos7 ~]# ps -ef|grep grafana
root 24374 1 0 22:40 pts/0 00:00:01 /root/grafana/bin/grafana-server --homepath=/root/grafana --config=/root/grafana/conf/obd-grafana.ini --pidfile=/root/grafana/run/grafana.pid
root 29246 19860 0 22:58 pts/0 00:00:00 grep --color=auto grafana
[root@centos7 ~]#
9.查看安装后的目录
[root@centos7 ~]# ll
total 501780
-rw-------. 1 root root 1509 Dec 2 18:12 anaconda-ks.cfg
drwxr-xr-x. 2 root root 6 Dec 2 19:09 Desktop
drwxr-xr-x. 2 root root 6 Dec 2 19:09 Documents
drwxr-xr-x. 2 root root 6 Dec 2 19:09 Downloads
drwxr-xr-x. 9 root root 134 Dec 2 22:40 grafana
-rw-r--r--. 1 root root 1557 Dec 2 18:48 initial-setup-ks.cfg
drwxr-xr-x. 2 root root 6 Dec 2 19:09 Music
drwxr-xr-x. 12 root root 173 Dec 2 22:40 obagent
drwxr-xr-x. 10 root root 138 Dec 2 22:40 obproxy-ce
drwxr-xr-x. 7 root root 100 Nov 17 15:48 oceanbase-all-in-one
-rw-r--r--. 1 root root 513811252 Dec 2 22:24 oceanbase-all-in-one-4.2.1.1-100120231117154841.el7.x86_64.tar.gz
drwxr-xr-x. 13 root root 137 Dec 2 22:39 oceanbase-ce
drwxr-xr-x. 2 root root 6 Dec 2 19:09 Pictures
drwxr-xr-x. 8 root root 200 Dec 2 22:40 prometheus
drwxr-xr-x. 2 root root 6 Dec 2 19:09 Public
drwxr-xr-x. 2 root root 6 Dec 2 19:09 Templates
drwxr-xr-x. 2 root root 6 Dec 2 19:09 Videos
10.使用命令行客户端登录数据库
[root@centos7 ~]# obclient -h127.0.0.1 -uroot -P2881
Welcome to the OceanBase. Commands end with ; or \g.
Your OceanBase connection id is 3221489807
Server version: OceanBase_CE 4.2.1.1 (r101010012023111012-2f6924cd5a576f09d6e7f212fac83f1a15ff531a) (Built Nov 10 2023 12:13:59)
Copyright (c) 2000, 2018, OceanBase and/or its affiliates. All rights reserved.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
obclient [(none)]>
obclient [(none)]> create user 'tpcc'@'%' identified with mysql_native_password by 'Test@1234';
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your OceanBase version for the right syntax to use near 'with mysql_native_password by 'Test@1234'' at line 1
obclient [(none)]> create user 'tpcc'@'%' identified by 'Test@1234';
Query OK, 0 rows affected (0.025 sec)
obclient [(none)]>
obclient [(none)]> grant all privileges on tpcc.* to 'tpcc'@'%' with grant option;
Query OK, 0 rows affected (0.022 sec)
obclient [(none)]> flush privileges;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your OceanBase version for the right syntax to use near 'flush privileges' at line 1
obclient [(none)]> create database if not exists tpcc;
Query OK, 1 row affected, 1 warning (0.003 sec)
obclient [(none)]>
obclient [(none)]> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| LBACSYS |
| mysql |
| oceanbase |
| ORAAUDITOR |
| SYS |
| test |
| tpcc |
+--------------------+
8 rows in set (0.008 sec)
obclient [(none)]>
obclient [(none)]> \q
Bye
11.查看tpcc表和数据情况
[root@centos7 ~]# obclient -h127.0.0.1 -utpcc -P2881
ERROR 1045 (42000): Access denied for user 'tpcc'@'xxx.xxx.xxx.xxx' (using password: NO)
[root@centos7 ~]# obclient -h127.0.0.1 -utpcc -P2881 -p
Enter password:
Welcome to the OceanBase. Commands end with ; or \g.
Your OceanBase connection id is 3221489878
Server version: OceanBase_CE 4.2.1.1 (r101010012023111012-2f6924cd5a576f09d6e7f212fac83f1a15ff531a) (Built Nov 10 2023 12:13:59)
Copyright (c) 2000, 2018, OceanBase and/or its affiliates. All rights reserved.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
obclient [(none)]>
obclient [(none)]> use tpcc;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Database changed
obclient [tpcc]>
obclient [tpcc]> show tables;
+------------------+
| Tables_in_tpcc |
+------------------+
| bmsql_config |
| bmsql_customer |
| bmsql_district |
| bmsql_history |
| bmsql_item |
| bmsql_new_order |
| bmsql_oorder |
| bmsql_order_line |
| bmsql_stock |
| bmsql_warehouse |
+------------------+
10 rows in set (0.002 sec)
obclient [tpcc]>
obclient [tpcc]>
obclient [tpcc]> select count(1) from bmsql_warehouse;
+----------+
| count(1) |
+----------+
| 10 |
+----------+
1 row in set (0.009 sec)
obclient [tpcc]>
obclient [tpcc]>