我爱编程

linux常用命令

2018-05-26  本文已影响0人  AMZ小楼
route add –net IP netmask MASK gw IP
route add -host 117.78.29.66 gw 192.26.6.1
route add -net 192.26.6.0/24 gw 192.26.6.1
route add -net 192.26.6.0/24 gw 0.0.0.0
df -h 卡成狗
systemctl restart proc-sys-fs-binfmt_misc.automount;
rewrite 规则
rewrite (/*) http://www.ttt.com:8601/text.html;

清理日志
lsof |grep deleted
curl 命令 查看接口是否有正常返回
jdk:
export JAVA_HOME=/usr/local/src/jdk1.7.0_79
export JRE_HOME=$JAVA_HOME/jre
export CLASSPATH=$JAVA_HOME/lib
export PATH=$PATH:$JAVA_HOME/bin
查看防火墙状态
firewall-cmd --state
停止firewall
systemctl stop firewalld.service
禁止firewall开机启动
systemctl disable firewalld.service 

getenforce
setenforce 0
hadoop2.6.1
用ip访问 http://192.168.57.129:50070/dfshealth.html#tab-overview
kafka模拟客户端口发送接收消息

#1、启动kafka
 ./bin/kafka-server-start.sh -daemon config/server.properties &
#2、创建topic–test
./bin/kafka-topics.sh --create --zookeeper localhost:2181--replication-factor 1 --partitions 1 --topic test
#3、列出已创建的topic列表
./bin/kafka-topics.sh --list --zookeeper localhost:2181
#4、模拟客户端去发送消息
./bin/kafka-console-producer.sh --broker-list localhost:9092 --topic test
#5、模拟客户端去接受消息
./bin/kafka-console-consumer.sh --zookeeper localhost:2181 --from-beginning --topic test
#6、查看指定的主题详情
./bin/kafka-topics.sh --describe --zookeeper localhost:2181 --topic test
连接数据库
export ORACLE_SID=test
sqlplus / as sysdba
startup 启动数据库
connect test/test@test
select * from dba_user;
show parameter instance
select value from v$parameter where name='service_names';
select name from v$database;
select userenv('language') from dual;
commit;

lsnrctl stop
ps -ef |grep ora_dbw0_
kill -9 pid
sqlplus /nolog
conn / as sysdba;
查看用户
select * from all_users;
create user linan identified by linan;
更改密码
alter user linan identified by linan 
授权dba用户
GRANT dba, connect, resource to linan;
授权普通用户
GRANT dba, connect, resource to linan;
commit;
conn username/password
oracle 建表离职
create table mytable
(
  id   NUMBER not null,
  name varchar(20) DEFAULT NULL,
  sex NUMBER DEFAULT NULL,
  mobile varchar(20) DEFAULT NULL,
  card_num varchar(20) DEFAULT NULL,
pin varchar(50) DEFAULT NULL,
bank_card varchar(20) DEFAULT NULL,
bank_code varchar(20) DEFAULT NULL,
id_card varchar(20) DEFAULT NULL,
card_type NUMBER DEFAULT NULL,
has_account NUMBER DEFAULT NULL,
choose_open NUMBER DEFAULT NULL,
area_code varchar(20) DEFAULT NULL,
source varchar(5) DEFAULT NULL,
source_user_id varchar(20) DEFAULT NULL,
create_date varchar(20) DEFAULT NULL,
update_date varchar(20) DEFAULT NULL
)
mysql配置
[client]  
 port=3306 
 socket=/tmp/mysql.sock 
    
 [mysql] 
 default-character-set=utf8 
    
 [mysqld] 
 user=mysql 
 character-set-server=utf8 
 explicit_defaults_for_timestamp=true 

 #索引和数据缓冲区大小,一般设置物理内存的60%-70%     
 innodb_buffer_pool_size = 1G 
 #缓冲池实例个数,推荐设置4个或8个 
 innodb_buffer_pool_instances = 4 
 #关键参数,0代表大约每秒写入到日志并同步到磁盘,数据库故障会丢失1秒左右事务数据。1为每执行一条SQL后写入到日志并同步到磁盘,I/                                                             O开销大,执行完SQL要等待日志读写,效率低。2代表只把日志写入到系统缓存区,再每秒同步到磁盘,效率很高,如果服务器故障,才会丢失事务数据。对数据安全性要求不是很高的推荐设置2,性能高,修改后效果明显。
 innodb_flush_log_at_trx_commit = 2   
 #默认是共享表空间,共享表空间idbdata文件不断增大,影响一定的I/O性能。推荐开启独立表空间模式,每个表的索引和数据都存在自己独立的表空间中,可以实现单表在不同数据库中移动。 
 innodb_file_per_table = ON 
 #日志缓冲区大小,由于日志最长每秒钟刷新一次,所以一般不用超过16M 
 innodb_log_buffer_size = 8M    
    
 datadir=/data/mysql 
 socket=/tmp/mysql.sock 

 # 禁止MySQL对外部 连接进行DNS解析
 skip-name-resolve    
 # Disabling symbolic-links is recommended to prevent assorted security risks 
 symbolic-links=0 
    
 # Recommended in standard MySQL setup 
 sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES  
    
 [mysqld_safe] 
 log-error=/var/log/mysqld.log 
 pid-file=/var/run/mysqld/mysqld.pid

上一篇下一篇

猜你喜欢

热点阅读