花辭

風月不瘦,雖以千年後。


  • 首頁

  • 關於

  • 標籤

  • 分類

  • 歸檔

  • 站點地圖

  • 公益404

乐理理论基础

發表於 2018-02-11 | 分類於 生活娱乐 | | 閱讀次數:

五线谱

大谱表: 高音谱表和低音谱表合并起来就是大谱表.

音符

音符是用来记录不同长短的音的进行符号. 音符包括三个组成部分: 符头和符干和符尾.

常见的音符有: 全音符、二分音符、四分音符、八分音符、十六分音符、三十二分音符等.

閱讀全文 »

Elastic实战自动补全

發表於 2017-11-01 | 分類於 入门教程 | | 閱讀次數:

自动补全(中文)

定义索引

1
2
3
4
5
6
7
[root@icloud-store ~]# curl -XPUT "http://192.168.0.103:9200/index_test?pretty=true" -H 'Content-Type: application/json' -d'
{
"index": {
"number_of_shards": "1",
"number_of_replicas": "1"
}
}'

定义类型

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
[root@icloud-store ~]# curl -XPOST "http://192.168.0.103:9200/index_test/product/_mapping?pretty=true" -H 'Content-Type: application/json' -d'
{
"properties": {
"name": {
"type": "text",
"analyzer": "ik_smart",
"search_analyzer": "ik_smart"
},
"tag": {
"type": "text",
"analyzer": "ik_smart",
"search_analyzer": "ik_smart"
},
"tag_suggest": {
"type": "completion",
"analyzer": "ik_smart",
"search_analyzer": "ik_smart"
}
}
}'
閱讀全文 »

Elastic索引定义应用

發表於 2017-10-11 | 分類於 入门教程 | | 閱讀次數:

数据索引

字段类型

Elastic数据类型和数据库字段类型映射关系

数据库类型 Elastic类型 说明
String/Varchar keyword 该field不做分词
String/Varchar/Text text 该field会经过分词处理
Integer integer int类型(32bit)
Long long long类型(64bit)
float float 浮点类型(32bit)
double double 浮点类型(64bit)
boolean boolean 布尔类型: true或者false
date/datetime date 日期类型: 2015-10-11, 2015-10-11T22:21:10
bytes/binary binary 二进制类型, 用于存储文件或者字节流
閱讀全文 »

Elastic分词插件介绍

發表於 2017-10-11 | 分類於 入门教程 | | 閱讀次數:

IK分词插件

插件主页

https://github.com/medcl/elasticsearch-analysis-ik

查看插件

1
2
3
4
[elon@icloud-store elasticsearch-6.0.0]$ bin/elasticsearch-plugin list
analysis-ik
analysis-pinyin
analysis-stconvert

分词测试

创建测试索引

1
2
3
4
5
6
[elon@icloud-store logs]# curl -XPUT "http://192.168.0.103:9200/index_test?pretty=true"
{
"acknowledged" : true,
"shards_acknowledged" : true,
"index" : "index_test"
}
閱讀全文 »

Elastic安装配置说明

發表於 2017-10-10 | 分類於 入门教程 | | 閱讀次數:

Elastic下载安装

下载Elastic

1
2
3
[root@elonsu cloud]# wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-5.6.0.tar.gz
[root@elonsu cloud]# tar -zxvf elasticsearch-5.6.0.tar.gz
[root@elonsu cloud]# mv elasticsearch-5.6.0 elastic

创建用户

Elastic默认不支持root用户启动, 这里创建用户dennisit

1
2
3
4
5
6
7
8
9
10
11
12
[root@elonsu cloud]# pwd
/export/cloud
[root@elonsu ~]# adduser dennisit
[root@elonsu ~]# passwd dennisit
Changing password for user dennisit.
New password:
Retype new password:
passwd: all authentication tokens updated successfully.
[root@elonsu cloud]# chown dennisit:dennisit elastic -R
[root@elonsu cloud]# su dennisit
[dennisit@elonsu cloud]$ cd elastic
[dennisit@elonsu elastic]$ bin/elasticsearch &
閱讀全文 »

持续集成 - 发布系统

發表於 2017-09-22 | 分類於 运维部署 | | 閱讀次數:

发布系统在技术团队中有着重要作用, 承担我们每天的服务部署工作, 企业发布系统根据企业技术能力来决定, 小公司不像那些公司一样,有充足的人力去开发一套自己的发布系统. 所以尽可能的去寻找一些适合企业应用的部署系统, 以提高人力成本.

这里推荐两款开源的发布系统:

  • jekins: https://jenkins.io/ (Java语言开发)[普遍]
  • walle: http://www.walle-web.io/ (PHP语言开发)[小众]

jekins可能大家都很熟悉,也有好多文章, walle是国人写的一个轻量的发布系统, 只所以推荐它 是因为相对其它开源的发布系统来说, 其UI界面至少看着比较舒服, 基本功能也都有. 支持国产开源.

Walle安装部署

Walle是基于PHP写的, 所以安装前需要安装PHP环境.

閱讀全文 »

Elastic实战Rest统计

發表於 2017-09-03 | 分類於 入门教程 | | 閱讀次數:

索引信息

查看索引信息

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
[root@localhost elasticsearch-6.0.0 ]$ curl -XGET "http://127.0.0.1:9200/db_test?pretty=true"
{
"db_test" : {
"aliases" : { },
"mappings" : {
"tb_opus" : {
"properties" : {
"aliasName" : {
"type" : "text",
"fields" : {
"origin" : {
"type" : "keyword"
},
"pinyin" : {
"type" : "text",
"term_vector" : "with_positions_offsets",
"analyzer" : "ik_pinyin_analyzer"
},
"suggest" : {
"type" : "completion",
"analyzer" : "ik_max_word",
"preserve_separators" : true,
"preserve_position_increments" : true,
"max_input_length" : 50
}
},
"analyzer" : "ik_max_word"
},
"appId" : {
"type" : "long"
},
"author" : {
"type" : "text",
"fields" : {
"origin" : {
"type" : "keyword"
},
"pinyin" : {
"type" : "text",
"term_vector" : "with_positions_offsets",
"analyzer" : "ik_pinyin_analyzer"
},
"suggest" : {
"type" : "completion",
"analyzer" : "ik_max_word",
"preserve_separators" : true,
"preserve_position_increments" : true,
"max_input_length" : 50
}
},
"analyzer" : "ik_smart"
},
"createTime" : {
"type" : "date"
},
"enabled" : {
"type" : "integer"
},
"favoriteTotal" : {
"type" : "long"
},
"fingerprint" : {
"type" : "keyword"
},
"id" : {
"type" : "long"
},
"images" : {
"type" : "keyword"
},
"introduce" : {
"type" : "text",
"fields" : {
"pinyin" : {
"type" : "text",
"boost" : 10.0,
"term_vector" : "with_positions_offsets",
"analyzer" : "ik_pinyin_analyzer"
}
},
"analyzer" : "ik_smart"
},
"issueTime" : {
"type" : "long"
},
"opusName" : {
"type" : "text",
"fields" : {
"origin" : {
"type" : "keyword"
},
"pinyin" : {
"type" : "text",
"term_vector" : "with_positions_offsets",
"analyzer" : "ik_pinyin_analyzer"
},
"suggest" : {
"type" : "completion",
"analyzer" : "ik_max_word",
"preserve_separators" : true,
"preserve_position_increments" : true,
"max_input_length" : 50
}
},
"analyzer" : "ik_max_word"
},
"score" : {
"type" : "double"
},
"sort" : {
"type" : "long"
},
"tags" : {
"type" : "text",
"fields" : {
"origin" : {
"type" : "keyword"
},
"pinyin" : {
"type" : "text",
"term_vector" : "with_positions_offsets",
"analyzer" : "ik_pinyin_analyzer"
},
"suggest" : {
"type" : "completion",
"analyzer" : "ik_max_word",
"preserve_separators" : true,
"preserve_position_increments" : true,
"max_input_length" : 50
}
},
"analyzer" : "ik_max_word"
},
"type" : {
"type" : "integer"
},
"updateTime" : {
"type" : "date"
},
"userId" : {
"type" : "long"
},
"uuid" : {
"type" : "keyword"
},
"viewTotal" : {
"type" : "long"
}
}
}
},
"settings" : {
"index" : {
"number_of_shards" : "1",
"provided_name" : "db_test",
"creation_date" : "1514353694378",
"analysis" : {
"filter" : {
"mix_pinyin" : {
"lowercase" : "true",
"padding_char" : " ",
"first_letter" : "prefix",
"keep_original" : "true",
"remove_duplicated_term" : "true",
"type" : "pinyin",
"keep_full_pinyin" : "true"
}
},
"analyzer" : {
"ik_pinyin_analyzer" : {
"filter" : [
"mix_pinyin",
"word_delimiter"
],
"type" : "custom",
"tokenizer" : "ik_max_word"
},
"default" : {
"tokenizer" : "ik_max_word"
}
}
},
"number_of_replicas" : "1",
"uuid" : "seg7yr55R121l8tRW3r7uA",
"version" : {
"created" : "6000099"
}
}
}
}
}
閱讀全文 »

Elastic实战Rest查询

發表於 2017-09-01 | 分類於 入门教程 | | 閱讀次數:

索引信息

查看索引信息

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
[root@localhost elasticsearch-6.0.0 ]$ curl -XGET "http://127.0.0.1:9200/db_test?pretty=true"
{
"db_test" : {
"aliases" : { },
"mappings" : {
"tb_opus" : {
"properties" : {
"aliasName" : {
"type" : "text",
"fields" : {
"origin" : {
"type" : "keyword"
},
"pinyin" : {
"type" : "text",
"term_vector" : "with_positions_offsets",
"analyzer" : "ik_pinyin_analyzer"
},
"suggest" : {
"type" : "completion",
"analyzer" : "ik_max_word",
"preserve_separators" : true,
"preserve_position_increments" : true,
"max_input_length" : 50
}
},
"analyzer" : "ik_max_word"
},
"appId" : {
"type" : "long"
},
"author" : {
"type" : "text",
"fields" : {
"origin" : {
"type" : "keyword"
},
"pinyin" : {
"type" : "text",
"term_vector" : "with_positions_offsets",
"analyzer" : "ik_pinyin_analyzer"
},
"suggest" : {
"type" : "completion",
"analyzer" : "ik_max_word",
"preserve_separators" : true,
"preserve_position_increments" : true,
"max_input_length" : 50
}
},
"analyzer" : "ik_smart"
},
"createTime" : {
"type" : "date"
},
"enabled" : {
"type" : "integer"
},
"favoriteTotal" : {
"type" : "long"
},
"fingerprint" : {
"type" : "keyword"
},
"id" : {
"type" : "long"
},
"images" : {
"type" : "keyword"
},
"introduce" : {
"type" : "text",
"fields" : {
"pinyin" : {
"type" : "text",
"boost" : 10.0,
"term_vector" : "with_positions_offsets",
"analyzer" : "ik_pinyin_analyzer"
}
},
"analyzer" : "ik_smart"
},
"issueTime" : {
"type" : "long"
},
"opusName" : {
"type" : "text",
"fields" : {
"origin" : {
"type" : "keyword"
},
"pinyin" : {
"type" : "text",
"term_vector" : "with_positions_offsets",
"analyzer" : "ik_pinyin_analyzer"
},
"suggest" : {
"type" : "completion",
"analyzer" : "ik_max_word",
"preserve_separators" : true,
"preserve_position_increments" : true,
"max_input_length" : 50
}
},
"analyzer" : "ik_max_word"
},
"score" : {
"type" : "double"
},
"sort" : {
"type" : "long"
},
"tags" : {
"type" : "text",
"fields" : {
"origin" : {
"type" : "keyword"
},
"pinyin" : {
"type" : "text",
"term_vector" : "with_positions_offsets",
"analyzer" : "ik_pinyin_analyzer"
},
"suggest" : {
"type" : "completion",
"analyzer" : "ik_max_word",
"preserve_separators" : true,
"preserve_position_increments" : true,
"max_input_length" : 50
}
},
"analyzer" : "ik_max_word"
},
"type" : {
"type" : "integer"
},
"updateTime" : {
"type" : "date"
},
"userId" : {
"type" : "long"
},
"uuid" : {
"type" : "keyword"
},
"viewTotal" : {
"type" : "long"
}
}
}
},
"settings" : {
"index" : {
"number_of_shards" : "1",
"provided_name" : "db_test",
"creation_date" : "1514353694378",
"analysis" : {
"filter" : {
"mix_pinyin" : {
"lowercase" : "true",
"padding_char" : " ",
"first_letter" : "prefix",
"keep_original" : "true",
"remove_duplicated_term" : "true",
"type" : "pinyin",
"keep_full_pinyin" : "true"
}
},
"analyzer" : {
"ik_pinyin_analyzer" : {
"filter" : [
"mix_pinyin",
"word_delimiter"
],
"type" : "custom",
"tokenizer" : "ik_max_word"
},
"default" : {
"tokenizer" : "ik_max_word"
}
}
},
"number_of_replicas" : "1",
"uuid" : "seg7yr55R121l8tRW3r7uA",
"version" : {
"created" : "6000099"
}
}
}
}
}
閱讀全文 »

SpringBoot项目配置加密

發表於 2017-07-15 | 分類於 应用实践 | | 閱讀次數:

SpringBoot配置默认情况下是明文显示,安全性就比较低一些。jasypt该插件可以对配置文件进行加密, 提高配置的安全性

插件引入

1
2
3
4
5
<dependency>
<groupId>com.github.ulisesbocchio</groupId>
<artifactId>jasypt-spring-boot-starter</artifactId>
<version>2.1.0</version>
</dependency>

组件说明

使用组件原生API进行加解密,说明: 每次编码生成的编码结果串都会不一样, 均可以逆向解析.

閱讀全文 »

阿里云25端口封禁解决

發表於 2017-07-15 | 分類於 应用实践 | | 閱讀次數:

使用JavaMail发送邮件在阿里云服务器邮件发送失败

问题发现

问题产生: SpringBoot使用JavaMail发送邮件,本地测试是可以通过的,但项目部署到阿里云服务器后就不行了

问题原因: 阿里云处于安全考虑,TCP25端口出方向默认被封禁.

问题解决

对于阿里云线上服务器, 需要将邮箱的配置改为ssl加密465端口发送. application.properties配置文件中增加下面配置

旧版配置

1
2
3
4
spring.mail.host=smtp.qq.com
spring.mail.port=25
spring.mail.username=邮箱账号
spring.mail.password=邮箱密码
閱讀全文 »
12…7
蘇若年

蘇若年

64 文章
13 分類
71 標籤
RSS
© 2019 HuntsWork
由 Hexo 強力驅動
|
主題 — NexT.Pisces v5.1.4