Recon 最初从领导者 OM 的 HTTP 端点获取 OM rocks DB 的完整快照,解压缩文件并初始化 RocksDB 以进行本地查询。通过对最后一个应用的序列 ID 的 RPC 调用,定期请求领导者 OM 进行增量更新,从而使数据库保持同步。如果由于某种原因而无法检索增量更新或将其应用于本地数据库,则会再次请求一个完整快照以使本地数据库与 OM DB 保持同步。因此,Recon 可能会显示陈旧的信息,因为本地数据库不会总是同步的。
vi /usr/local/soft/ozone-2.0.0/etc/hadoop/ozone-site.xml
内容修改如下
复制代码
<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<!-- Put site-specific property overrides in this file. -->
<configuration>
<property>
<name>ozone.metadata.dirs</name>
<value>/data/ozone/meta</value>
</property>
<property>
<name>ozone.scm.datanode.id.dir</name>
<value>/data/ozone/meta/node</value>
</property>
<property>
<name>ozone.enabled</name>
<value>true</value>
</property>
<property>
<name>ozone.om.address</name>
<value>node11:9862</value>
</property>
<property>
<name>ozone.scm.names</name>
<value>node11</value>
</property>
<property>
<name>ozone.scm.client.address</name>
<value>node11:9860</value>
</property>
<property>
<name>hadoop.tmp.dir</name>
<value>/data/ozone/hadoop-${user.name}</value>
</property>
<property>
<name>nfs.dump.dir</name>
<value>/data/ozone/.hdfs-nfs</value>
</property>
<property>
<name>dfs.journalnode.edits.dir</name>
<value>/data/ozone/hadoop/dfs/journalnode/</value>
</property>
</configuration>
其它参数如下
Ozone 参数汇总
Setting
Value
Comment
ozone.metadata.dirs
文件路径
元数据存储位置
ozone.scm.names
SCM 服务地址
SCM的主机名:端口,或者IP:端口
ozone.scm.block.client.address
SCM 服务地址和端口
Ozone 内部服务使用(如 OM)
ozone.scm.client.address
SCM 服务地址和端口
客户端使用
ozone.scm.datanode.address
SCM 服务地址和端口
Datanode 使用
ozone.om.address
OM 服务地址
Ozone handler 和 Ozone 文件系统使用
hdds.datanode.dir
文件路径
datanode中数据存储位置
b、修改ozone-env
复制代码
vi /usr/local/soft/ozone-2.0.0/etc/hadoop/ozone-env.sh
创建 Volume
ozone sh volume create /vol1
ozone sh volume create /testvolume1 -q=1GB
查看Volume
ozone sh volume list
基于Volume创建Bucket
ozone sh bucket create /vol1/bucket1
ozone sh bucket create /testvolume1/testbucket
查看Bucket信息
ozone sh bucket info /testvolume1/testbucket
上传文件
./ozone fs -put /path/to/local/file o3fs://bucket1.vol1/remote/file
ozone sh key put /testvolume1/testbucket/testfile testfile
ozone sh key info /testvolume1/testbucket/testfile
下载文件
ozone sh key get /testvolume1/testbucket/testfile getfile
FAQ:
1、OM总是关闭,出现java.lang.UnsatisfiedLinkError: /root/ozone_rocksdb_tools9064409345365245954/libozone_rocksdb_tools.so: /lib64/libstdc++.so.6: version `GLIBCXX_3.4.26' not found (required by /root/ozone_rocksdb_tools9064409345365245954/libozone_rocksdb_tools.so)