groupadd -g 54321 oinstall
groupadd -g 54322 dba
groupadd -g 54323 oper
useradd -u 54321 -g oinstall -G dba,oper oracle
vi /etc/oraInst.loc
以下以oracle用户 *** 作:
mkdir /u01/app
unzip linuxx64_12201_database.zip
cd database/
cp response/db_install.rsp inst.rsp
./runInstaller -showProgress -ignoreSysPrereqs -waitforcompletion -silent -responseFile /home/oracle/database/inst.rsp
inst.rsp文件中编辑如下
export ORACLE_HOME=/u01/app/oracle/product/12.2.0.1/dbhome_1
export ORACLE_SID=ORA12CR2
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ORACLE_HOME/lib
export PATH=$ORACLE_HOME/bin:$PATH
文件$ORACLE_HOME/dbs/initORA12CR2.ora内容如下
CDB数据文件地址:$ORACLE_BASE/oradata/<SID>/
PDB数据文件地址:$ORACLE_BASE/oradata/<SID>/<pdb>/
sqlplus / as sysdba
startup nomount
CREATE DATABASE ORA12CR2
MAXLOGFILES 16
MAXLOGMEMBERS 4
MAXDATAFILES 1024
MAXINSTANCES 1
MAXLOGHISTORY 680
CHARACTER SET AL32UTF8
DATAFILE '/u01/app/oracle/oradata/ORA12CR2/system01.dbf' SIZE 500M REUSE EXTENT MANAGEMENT LOCAL
SYSAUX DATAFILE '/u01/app/oracle/oradata/ORA12CR2/sysaux01.dbf' SIZE 500M
UNDO TABLESPACE UNDOTBS1 DATAFILE '/u01/app/oracle/oradata/ORA12CR2/undotbs01.dbf' SIZE 500M
DEFAULT TEMPORARY TABLESPACE TEMP TEMPFILE '/u01/app/oracle/oradata/ORA12CR2/temp01.dbf' SIZE 500M
DEFAULT TABLESPACE USERS DATAFILE '/u01/app/oracle/oradata/ORA12CR2/users01.dbf' SIZE 200M
LOGFILE GROUP 1 ('/u01/app/oracle/oradata/ORA12CR2/redo01a.dbf', '/u01/app/oracle/oradata/ORA12CR2/redo01b.dbf') SIZE 50M,
GROUP 2 ('/u01/app/oracle/oradata/ORA12CR2/redo02a.dbf', '/u01/app/oracle/oradata/ORA12CR2/redo02b.dbf') SIZE 50M,
GROUP 3 ('/u01/app/oracle/oradata/ORA12CR2/redo03a.dbf', '/u01/app/oracle/oradata/ORA12CR2/redo03b.dbf') SIZE 50M
USER sys IDENTIFIED BY oracle
USER system IDENTIFIED BY oracle
SQL>spool create_dd.lis
SQL>@?/rdbms/admin/catalog.sql
SQL>@?/rdbms/admin/catproc.sql
SQL>connect system/oracle
SQL>@?/sqlplus/admin/pupbld
listener.ora文件:
cd $ORACLE_HOME/dbs
以下必须输入强密码:
orapwd file=orapw<ORACLE_SID>password=<sys password>
否则就得加上format=12
orapwd file=orapw<ORACLE_SID>password=<sys password>format=12
1.下载和安装hbase数据库[root@tong1 ~]# wget http://mirrors.hust.edu.cn/apache/hbase/stable/hbase-0.98.9-hadoop2-bin.tar.gz
[root@tong1 ~]# tar xvf hbase-0.98.9-hadoop2-bin.tar.gz
[root@tong1 ~]# mv hbase-0.98.9-hadoop2 /usr/local/
[root@tong1 local]# chown -R hadoop:hadoop hbase-0.98.9-hadoop2
[root@tong1 local]# ll hbase-0.98.9-hadoop2
total 352
drwxr-xr-x. 4 hadoop hadoop 4096 Dec 16 14:16 bin
-rw-r--r--. 1 hadoop hadoop 164928 Dec 16 14:20 CHANGES.txt
drwxr-xr-x. 2 hadoop hadoop 4096 Jan 8 12:48 conf
drwxr-xr-x. 4 hadoop hadoop 4096 Dec 16 14:16 dev-support
drwxr-xr-x. 3 hadoop hadoop 4096 Dec 16 14:22 hbase-annotations
drwxr-xr-x. 3 hadoop hadoop 4096 Dec 16 14:23 hbase-assembly
drwxr-xr-x. 3 hadoop hadoop 4096 Dec 16 14:22 hbase-checkstyle
drwxr-xr-x. 3 hadoop hadoop 4096 Dec 16 14:23 hbase-client
drwxr-xr-x. 3 hadoop hadoop 4096 Dec 16 14:22 hbase-common
drwxr-xr-x. 3 hadoop hadoop 4096 Dec 16 14:23 hbase-examples
drwxr-xr-x. 3 hadoop hadoop 4096 Dec 16 14:25 hbase-hadoop1-compat
drwxr-xr-x. 3 hadoop hadoop 4096 Dec 16 14:23 hbase-hadoop2-compat
drwxr-xr-x. 3 hadoop hadoop 4096 Dec 16 14:23 hbase-hadoop-compat
drwxr-xr-x. 3 hadoop hadoop 4096 Dec 16 14:23 hbase-it
drwxr-xr-x. 3 hadoop hadoop 4096 Dec 16 14:23 hbase-prefix-tree
drwxr-xr-x. 3 hadoop hadoop 4096 Dec 16 14:23 hbase-protocol
drwxr-xr-x. 3 hadoop hadoop 4096 Dec 16 14:23 hbase-rest
drwxr-xr-x. 3 hadoop hadoop 4096 Dec 16 14:23 hbase-server
drwxr-xr-x. 3 hadoop hadoop 4096 Dec 16 14:23 hbase-shell
drwxr-xr-x. 2 hadoop hadoop 4096 Dec 16 14:23 hbase-testing-util
drwxr-xr-x. 3 hadoop hadoop 4096 Dec 16 14:23 hbase-thrift
-rw-r--r--. 1 hadoop hadoop 11358 Dec 2 07:36 LICENSE.txt
drwxrwxr-x. 2 hadoop hadoop 4096 Jan 8 12:01 logs
-rw-r--r--. 1 hadoop hadoop897 Dec 16 14:16 NOTICE.txt
-rw-r--r--. 1 hadoop hadoop 81667 Dec 16 14:16 pom.xml
-rw-r--r--. 1 hadoop hadoop 1377 Dec 16 14:16 README.txt
drwxr-xr-x. 3 hadoop hadoop 4096 Dec 16 06:37 src
[root@tong1 local]#
2.修改hbase配置文件
[root@tong1 local]# cd /usr/local/hbase-0.98.9-hadoop2/conf/
[root@tong1 conf]# vim hbase-site.xml
<configuration>
<property>
<name>hbase.rootdir</name>
<value>hdfs://tong1:9000/hbase</value>-与hadoop中的core-site.xml文件中一至
</property>
<property>
<name>hbase.cluster.distributed</name>
<value>true</value>
</property>
</configuration>
[root@tong1 conf]# vim hbase-env.sh
export JAVA_HOME=/usr/local/jdk1.8.0_25
[root@tong1 conf]#
3.启动hbase服务
[root@tong1 conf]# su - hadoop
[hadoop@tong1 ~]$ start-hbase.sh
localhost: starting zookeeper, logging to /usr/local/hbase-0.98.9-hadoop2/bin/../logs/hbase-hadoop-zookeeper-tong1.out
starting master, logging to /usr/local/hbase-0.98.9-hadoop2/logs/hbase-hadoop-master-tong1.out
localhost: starting regionserver, logging to /usr/local/hbase-0.98.9-hadoop2/bin/../logs/hbase-hadoop-regionserver-tong1.out
[hadoop@tong1 ~]$ hbase shell
2015-01-08 15:01:36,052 INFO [main] Configuration.deprecation: hadoop.native.lib is deprecated. Instead, use io.native.lib.available
2015-01-08 15:01:36,082 INFO [main] Configuration.deprecation: hadoop.native.lib is deprecated. Instead, use io.native.lib.available
2015-01-08 15:01:36,109 INFO [main] Configuration.deprecation: hadoop.native.lib is deprecated. Instead, use io.native.lib.available
2015-01-08 15:01:36,135 INFO [main] Configuration.deprecation: hadoop.native.lib is deprecated. Instead, use io.native.lib.available
2015-01-08 15:01:36,147 INFO [main] Configuration.deprecation: hadoop.native.lib is deprecated. Instead, use io.native.lib.available
HBase Shellenter 'help<RETURN>' for list of supported commands.
Type "exit<RETURN>" to leave the HBase Shell
Version 0.98.9-hadoop2, r96878ece501b0643e879254645d7f3a40eaf101f, Mon Dec 15 23:00:20 PST 2014
hbase(main):008:0* create 'tong1' ,'test'
0 row(s) in 0.9120 seconds
=>Hbase::Table - tong1
hbase(main):009:0>scan 'tong1'
ROW COLUMN+CELL
0 row(s) in 0.0390 seconds
hbase(main):010:0>
4.在浏览器查看状态即可。
其实安装过程并不烦琐,仅仅是事情方向比较多而已。(1)检查需要的安装包是否安装。(如果没有安装则安装)
(2)建立用户和目录。
(3)配置环境变量(包括系统环境变量和用户环境变量)
(4)配置安装变量(这个可能不需要,有些需要设置下lang=C,以及xshost +等)
如果想简化,那么个人认为办法就是自己写脚本,5年前安装oracle10g的时候我自己就写过一个,上面的所有事情,一个脚本搞定(第(3)步根据实际情况修改),写脚本的过程很烦,有几次都不想写了,但是坚持下来完成后发现,真的很爽。如果你想简化,那么就要大麻烦一次,然后就简单了。我的脚本不知道在什么地方了,前段时间中毒,估计是一起格式化了,所以现在只能是提这样一个建议了。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)